Bug 1370487: Don't incorrectly recreate a decoder. r=JamesCheng
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 07 Jun 2017 17:25:16 +0200
changeset 410954 50a90931ab2e1f58a48a8eb7f064a5dda9f73116
parent 410953 14d24ce5d4aafa57ca7568b4a70a2c47c6569dc7
child 410955 ab4f6b6cd8dd8897cd7bf7be4a05da4bca1ecc48
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamesCheng
bugs1370487
milestone55.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 1370487: Don't incorrectly recreate a decoder. r=JamesCheng On android and devices supporting decoder recycling the decoder would be reset for every new sample not containing inband SPS/PPS MozReview-Commit-ID: 8BHALsDgPvg
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -380,21 +380,22 @@ H264Converter::CheckForSPSChange(MediaRa
       // change as the H264Converter will be recreated by the MediaFormatReader
       // instead. So there's no point in testing for changes.
       return NS_OK;
     }
     // This sample doesn't contain inband SPS/PPS
     // We now check if the out of band one has changed.
     // This scenario can only occur on Android with devices that can recycle a
     // decoder.
-    if (mp4_demuxer::AnnexB::HasSPS(aSample->mExtraData) &&
-        !mp4_demuxer::AnnexB::CompareExtraData(aSample->mExtraData,
-                                               mOriginalExtraData)) {
-      extra_data = mOriginalExtraData = aSample->mExtraData;
+    if (!mp4_demuxer::AnnexB::HasSPS(aSample->mExtraData) ||
+        mp4_demuxer::AnnexB::CompareExtraData(aSample->mExtraData,
+                                              mOriginalExtraData)) {
+      return NS_OK;
     }
+    extra_data = mOriginalExtraData = aSample->mExtraData;
   }
   if (mp4_demuxer::AnnexB::CompareExtraData(extra_data,
                                             mCurrentConfig.mExtraData)) {
     return NS_OK;
   }
 
   RefPtr<MediaRawData> sample = aSample;
   MOZ_ASSERT(mCanRecycleDecoder.isSome());