Bug 1496529 - P5. Don't unnecessarily wait on decoder to shutdown r=bryce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 09 Oct 2018 16:59:14 +0000
changeset 496089 93312ff3f1808a9e79a961d879c340eee99a22b1
parent 496088 b76ae0d758d9ae80d762c901c0faa321ddba57f1
child 496090 40f7fbd43f5189d6710be9a96bc852f73debf6ac
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbryce
bugs1496529
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496529 - P5. Don't unnecessarily wait on decoder to shutdown r=bryce Depends on D7864 Differential Revision: https://phabricator.services.mozilla.com/D7865
media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
--- a/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
@@ -152,24 +152,20 @@ WebrtcMediaDataDecoder::RegisterDecodeCo
 {
   mCallback = aCallback;
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
 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;
 }
 
 bool
 WebrtcMediaDataDecoder::OnTaskQueue() const
 {