Bug 1347439 - part 7: make sure TrackInfo in the sample is up to date. r?jya draft
authorJohn Lin <jolin@mozilla.com>
Wed, 15 Mar 2017 15:17:27 +0800
changeset 498979 74abc59a267f605f3f0104e5854e29a1dd2c46e0
parent 498978 0ada04dc26f98c5cf44eceaef0422dbef9e04505
child 498980 825a39baf2b27357fbf544a31c34d2fa7a5c4976
push id49299
push userbmo:jolin@mozilla.com
push dateWed, 15 Mar 2017 08:25:49 +0000
reviewersjya
bugs1347439, 1344649, 1336431
milestone53.0
Bug 1347439 - part 7: make sure TrackInfo in the sample is up to date. r?jya Cherry-picked from bug 1344649 part 5 for bug 1336431 MozReview-Commit-ID: GxgYsaSqKSR
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -288,16 +288,19 @@ H264Converter::CheckForSPSChange(MediaRa
                                             mCurrentConfig.mExtraData)) {
         return NS_OK;
       }
 
   if (MediaPrefs::MediaDecoderCheckRecycling() &&
       mDecoder->SupportDecoderRecycling()) {
     // Do not recreate the decoder, reuse it.
     UpdateConfigFromExtraData(extra_data);
+    if (!aSample->mTrackInfo) {
+      aSample->mTrackInfo = new SharedTrackInfo(mCurrentConfig, 0);
+    }
     mNeedKeyframe = true;
     return NS_OK;
   }
   // The SPS has changed, signal to flush the current decoder and create a
   // new one.
   mDecoder->Flush();
   Shutdown();
   return CreateDecoderAndInit(aSample);