Bug 1125776: Part7. Only notify reader we have data, when we actually do. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 04 Feb 2015 20:20:16 +1100
changeset 244930 d2c9755aaee2ddd816814465d8550aaaf79e76d8
parent 244929 22fb2f111021e4e04dfe91efa8c52a632c7e189a
child 244931 a9f556f084874a277a10768ef5fdf694a8ed9d48
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1125776
milestone38.0a1
Bug 1125776: Part7. Only notify reader we have data, when we actually do. r=mattwoodrow
dom/media/mediasource/TrackBuffer.cpp
--- a/dom/media/mediasource/TrackBuffer.cpp
+++ b/dom/media/mediasource/TrackBuffer.cpp
@@ -238,21 +238,21 @@ TrackBuffer::AppendData(LargeDataBuffer*
     mInitializationPromise.Reject(NS_ERROR_FAILURE, __func__);
     return p;
   }
 
   if (decoders.Length()) {
     // We're going to have to wait for the decoder to initialize, the promise
     // will be resolved once initialization completes.
     return p;
+  } else if (gotMedia) {
+    // Tell our reader that we have more data to ensure that playback starts if
+    // required when data is appended.
+    mParentDecoder->GetReader()->MaybeNotifyHaveData();
   }
-  // Tell our reader that we have more data to ensure that playback starts if
-  // required when data is appended.
-  mParentDecoder->GetReader()->MaybeNotifyHaveData();
-
   mInitializationPromise.Resolve(gotMedia, __func__);
   return p;
 }
 
 bool
 TrackBuffer::AppendDataToCurrentResource(LargeDataBuffer* aData, uint32_t aDuration)
 {
   MOZ_ASSERT(NS_IsMainThread());