Bug 1237809: P2. Detect change of display size. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 12 Jan 2016 21:03:13 +1100
changeset 279731 a72fd5871157f2322e18decc08a41b8dbdcee8c1
parent 279730 deba095103f3eb220e26712d88c4542acd064e4b
child 279732 ed0c58e53473d1eff212d89baf8c97772faf8fc0
push id29885
push usercbook@mozilla.com
push dateWed, 13 Jan 2016 10:57:28 +0000
treeherdermozilla-central@531d1f6d1cde [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1237809
milestone46.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 1237809: P2. Detect change of display size. r=cpearce This is a similar problem as HE-AAC where the container information diverge with what it actually contains.
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1176,16 +1176,26 @@ MediaFormatReader::ReturnOutput(MediaDat
             "This is an unsupported configuration",
             mInfo.mAudio.mRate, audioData->mRate);
         mInfo.mAudio.mRate = audioData->mRate;
         mInfo.mAudio.mChannels = audioData->mChannels;
       }
     }
     mAudio.mPromise.Resolve(aData, __func__);
   } else if (aTrack == TrackInfo::kVideoTrack) {
+    if (aData->mType != MediaData::RAW_DATA) {
+      VideoData* videoData = static_cast<VideoData*>(aData);
+
+      if (videoData->mDisplay != mInfo.mVideo.mDisplay) {
+        LOG("change of video display size (%dx%d->%dx%d)",
+            mInfo.mVideo.mDisplay.width, mInfo.mVideo.mDisplay.height,
+            videoData->mDisplay.width, videoData->mDisplay.height);
+        mInfo.mVideo.mDisplay = videoData->mDisplay;
+      }
+    }
     mVideo.mPromise.Resolve(aData, __func__);
   }
   LOG("Resolved data promise for %s", TrackTypeToStr(aTrack));
 }
 
 size_t
 MediaFormatReader::SizeOfVideoQueueInFrames()
 {