Bug 1260950 - Set mInitialSizeFound to true when the initial size id found. r=jesup, r=pehrsons a=kwierso
authorctai <ctai@mozilla.com>
Thu, 31 Mar 2016 10:13:04 +0800
changeset 291114 c3fb02405b68aca36fdc60e556e13e49fe5482b0
parent 291113 297e38fbff063b5d7f1289be4af164b8642d727b
child 291115 b78ed68af2fb7051771b49260d7f5394a7c30c63
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, pehrsons, kwierso
bugs1260950
milestone48.0a1
Bug 1260950 - Set mInitialSizeFound to true when the initial size id found. r=jesup, r=pehrsons a=kwierso MozReview-Commit-ID: Ch3jCR4pFYN
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3099,21 +3099,23 @@ public:
                                 TrackID aInputTrackID) override
   {
     if (mInitialSizeFound || aQueuedMedia.GetType() != MediaSegment::VIDEO) {
       return;
     }
     const VideoSegment& video = static_cast<const VideoSegment&>(aQueuedMedia);
     for (VideoSegment::ConstChunkIterator c(video); !c.IsEnded(); c.Next()) {
       if (c->mFrame.GetIntrinsicSize() != gfx::IntSize(0,0)) {
+        mInitialSizeFound = true;
         nsCOMPtr<nsIRunnable> event =
           NS_NewRunnableMethodWithArgs<gfx::IntSize>(
               this, &StreamSizeListener::ReceivedSize,
               c->mFrame.GetIntrinsicSize());
         aGraph->DispatchToMainThreadAfterStreamStateUpdate(event.forget());
+        return;
       }
     }
   }
 
 private:
   // These fields may only be accessed on the main thread
   HTMLMediaElement* mElement;