Bug 1496529 - P5. Don't unnecessarily wait on decoder to shutdown r=bryce

Depends on D7864

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2018-10-09 16:59:14 +00:00
parent 2ae449a166
commit 26ace1a1c9

View File

@ -157,14 +157,10 @@ WebrtcMediaDataDecoder::RegisterDecodeCompleteCallback(
int32_t
WebrtcMediaDataDecoder::Release()
{
RefPtr<ShutdownPromise> p =
mDecoder->Flush()->Then(mTaskQueue,
__func__,
[this]() { return mDecoder->Shutdown(); },
[this]() { return mDecoder->Shutdown(); });
media::Await(do_AddRef(mThreadPool), p);
RefPtr<MediaDataDecoder> decoder = mDecoder.forget();
decoder->Flush()->Then(
mTaskQueue, __func__, [decoder]() { decoder->Shutdown(); });
mDecoder = nullptr;
mNeedKeyframe = true;
return WEBRTC_VIDEO_CODEC_OK;