Don't create TextureClients if the video bridge has shut down. (bug 1345735 part 1, r=mattwoodrow)
authorDavid Anderson <dvander@alliedmods.net>
Wed, 19 Apr 2017 07:24:43 -0700
changeset 565183 d6348ea45c2db438ba01ecdcf3da981026f5ba4c
parent 565182 724b17184279b2ab79720474e3d3b2427b30090c
child 565184 7c5628d40478bf50c4054acb5eb67871fa7168d5
push id54802
push userdgottwald@mozilla.com
push dateWed, 19 Apr 2017 15:26:27 +0000
reviewersmattwoodrow
bugs1345735
milestone55.0a1
Don't create TextureClients if the video bridge has shut down. (bug 1345735 part 1, r=mattwoodrow)
dom/media/ipc/VideoDecoderParent.cpp
--- a/dom/media/ipc/VideoDecoderParent.cpp
+++ b/dom/media/ipc/VideoDecoderParent.cpp
@@ -159,16 +159,21 @@ VideoDecoderParent::RecvInput(const Medi
 }
 
 void
 VideoDecoderParent::ProcessDecodedData(
   const MediaDataDecoder::DecodedData& aData)
 {
   MOZ_ASSERT(OnManagerThread());
 
+  // If the video decoder bridge has shut down, stop.
+  if (!mKnowsCompositor->GetTextureForwarder()) {
+    return;
+  }
+
   for (const auto& data : aData) {
     MOZ_ASSERT(data->mType == MediaData::VIDEO_DATA,
                 "Can only decode videos using VideoDecoderParent!");
     VideoData* video = static_cast<VideoData*>(data.get());
 
     MOZ_ASSERT(video->mImage, "Decoded video must output a layer::Image to "
                               "be used with VideoDecoderParent");