Bug 1062098 - Do not attempt to display dropped frames. r=mattwoodrow, a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 31 Mar 2015 20:36:29 +1100
changeset 266935 f953bfcccb9cbfded5aabfc10a86c397ff2aec15
parent 266934 5b448d48857f763843392d525f82cf13f172a719
child 266936 8ddb0e3d862d57dcafd876705a3a4f6d78896374
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, sledru
bugs1062098
milestone39.0a2
Bug 1062098 - Do not attempt to display dropped frames. r=mattwoodrow, a=sledru
dom/media/fmp4/apple/AppleVTDecoder.cpp
--- a/dom/media/fmp4/apple/AppleVTDecoder.cpp
+++ b/dom/media/fmp4/apple/AppleVTDecoder.cpp
@@ -164,16 +164,17 @@ PlatformCallback(void* decompressionOutp
 
   // Validate our arguments.
   if (status != noErr || !image) {
     NS_WARNING("VideoToolbox decoder returned no data");
     return;
   }
   if (flags & kVTDecodeInfo_FrameDropped) {
     NS_WARNING("  ...frame dropped...");
+    return;
   }
   MOZ_ASSERT(CFGetTypeID(image) == CVPixelBufferGetTypeID(),
     "VideoToolbox returned an unexpected image type");
 
   // Forward the data back to an object method which can access
   // the correct MP4Reader callback.
   decoder->OutputFrame(image, frameRef);
 }
@@ -236,17 +237,17 @@ AppleVTDecoder::SubmitFrame(mp4_demuxer:
     NS_ERROR("Couldn't create CMSampleBuffer");
     return NS_ERROR_FAILURE;
   }
   rv = VTDecompressionSessionDecodeFrame(mSession,
                                          sample,
                                          0,
                                          CreateAppleFrameRef(aSample),
                                          &flags);
-  if (rv != noErr) {
+  if (rv != noErr && !(flags & kVTDecodeInfo_FrameDropped)) {
     NS_WARNING("Couldn't pass frame to decoder");
     return NS_ERROR_FAILURE;
   }
 
   // Ask for more data.
   if (mTaskQueue->IsEmpty()) {
     LOG("AppleVTDecoder task queue empty; requesting more data");
     mCallback->InputExhausted();