Bug 1561486 - shutdown demuxer early. r=alwu

We don't need the demuxer after we've resolved the promise.

Differential Revision: https://phabricator.services.mozilla.com/D36713

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-07-10 12:04:50 +00:00
Родитель b50884dcdc
Коммит a34f058d11
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -257,17 +257,12 @@ void BenchmarkPlayback::InitDecoder(UniquePtr<TrackInfo>&& aInfo) {
void BenchmarkPlayback::FinalizeShutdown() { void BenchmarkPlayback::FinalizeShutdown() {
MOZ_ASSERT(OnThread()); MOZ_ASSERT(OnThread());
MOZ_ASSERT(mFinished, "GlobalShutdown must have been run");
MOZ_ASSERT(!mDecoder, "mDecoder must have been shutdown already"); MOZ_ASSERT(!mDecoder, "mDecoder must have been shutdown already");
MOZ_ASSERT(!mDemuxer, "mDemuxer must have been shutdown already");
MOZ_DIAGNOSTIC_ASSERT(mDecoderTaskQueue->IsEmpty()); MOZ_DIAGNOSTIC_ASSERT(mDecoderTaskQueue->IsEmpty());
mDecoderTaskQueue = nullptr; mDecoderTaskQueue = nullptr;
if (mTrackDemuxer) {
mTrackDemuxer->Reset();
mTrackDemuxer->BreakCycles();
mTrackDemuxer = nullptr;
}
mDemuxer = nullptr;
RefPtr<Benchmark> ref(mGlobalState); RefPtr<Benchmark> ref(mGlobalState);
ref->Thread()->Dispatch(NS_NewRunnableFunction( ref->Thread()->Dispatch(NS_NewRunnableFunction(
"BenchmarkPlayback::FinalizeShutdown", [ref]() { ref->Dispose(); })); "BenchmarkPlayback::FinalizeShutdown", [ref]() { ref->Dispose(); }));
@ -295,6 +290,13 @@ void BenchmarkPlayback::GlobalShutdown() {
} else { } else {
FinalizeShutdown(); FinalizeShutdown();
} }
if (mTrackDemuxer) {
mTrackDemuxer->Reset();
mTrackDemuxer->BreakCycles();
mTrackDemuxer = nullptr;
}
mDemuxer = nullptr;
} }
void BenchmarkPlayback::Output(MediaDataDecoder::DecodedData&& aResults) { void BenchmarkPlayback::Output(MediaDataDecoder::DecodedData&& aResults) {