Bug 1309516 part 0 - make sure that the VideoSink::Redraw() always draws something; r?jwwang draft
authorKaku Kuo <kaku@mozilla.com>
Tue, 15 Nov 2016 12:04:26 +0800
changeset 441566 43c22e76c98403b6f4b72962ea7de350fa9e1c05
parent 441455 f09e137ead39230eaa94f47988ccce2cfcda4195
child 441567 27c708c5b2586227d7c7b2d301ce28082a997854
push id36449
push userbmo:kaku@mozilla.com
push dateSat, 19 Nov 2016 07:05:35 +0000
reviewersjwwang
bugs1309516
milestone53.0a1
Bug 1309516 part 0 - make sure that the VideoSink::Redraw() always draws something; r?jwwang MozReview-Commit-ID: BQ0FDyNPuri
dom/media/mediasink/VideoSink.cpp
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -284,18 +284,20 @@ VideoSink::Redraw(const VideoInfo& aInfo
 {
   AssertOwnerThread();
 
   // No video track, nothing to draw.
   if (!aInfo.IsValid() || !mContainer) {
     return;
   }
 
-  if (VideoQueue().GetSize() > 0) {
-    RenderVideoFrames(1);
+  RefPtr<MediaData> frame = VideoQueue().PeekFront();
+  if (frame) {
+    VideoData* video = frame->As<VideoData>();
+    mContainer->SetCurrentFrame(video->mDisplay, video->mImage, TimeStamp::Now());
     return;
   }
 
   // When we reach here, it means there are no frames in this video track.
   // Draw a blank frame to ensure there is something in the image container
   // to fire 'loadeddata'.
   RefPtr<Image> blank =
     mContainer->GetImageContainer()->CreatePlanarYCbCrImage();