Bug 1126465 - Stop invoking On*NotDecoded when we didn't actually go through the promise. r=mattwoodrow, a=sledru
authorBobby Holley <bobbyholley@gmail.com>
Thu, 29 Jan 2015 22:11:11 -0800
changeset 243640 dbb452162854
parent 243639 23b7a843e75d
child 243641 ebd1573c5911
push id4421
push userryanvm@gmail.com
push date2015-02-02 19:52 +0000
treeherdermozilla-beta@08a02585bc60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, sledru
bugs1126465
milestone36.0
Bug 1126465 - Stop invoking On*NotDecoded when we didn't actually go through the promise. r=mattwoodrow, a=sledru This isn't right, and it means that we can't assume at the top of On{Audio,Video}{,Not}Decoded() that we're fresh out of promise dispatch, which we want to do.
dom/media/mediasource/MediaSourceReader.cpp
--- a/dom/media/mediasource/MediaSourceReader.cpp
+++ b/dom/media/mediasource/MediaSourceReader.cpp
@@ -152,17 +152,17 @@ MediaSourceReader::RequestAudioDataCompl
   mAudioReader->RequestAudioData()->Then(GetTaskQueue(), __func__, this,
                                          &MediaSourceReader::OnAudioDecoded,
                                          &MediaSourceReader::OnAudioNotDecoded);
 }
 
 void
 MediaSourceReader::RequestAudioDataFailed(nsresult aResult)
 {
-  OnAudioNotDecoded(DECODE_ERROR);
+  mAudioPromise.Reject(DECODE_ERROR, __func__);
 }
 
 void
 MediaSourceReader::OnAudioDecoded(AudioData* aSample)
 {
   MSE_DEBUGV("MediaSourceReader(%p)::OnAudioDecoded [mTime=%lld mDuration=%lld mDiscontinuity=%d]",
              this, aSample->mTime, aSample->mDuration, aSample->mDiscontinuity);
   if (mDropAudioBeforeThreshold) {
@@ -293,17 +293,17 @@ MediaSourceReader::RequestVideoDataCompl
   mVideoReader->RequestVideoData(false, 0)
               ->Then(GetTaskQueue(), __func__, this,
                      &MediaSourceReader::OnVideoDecoded, &MediaSourceReader::OnVideoNotDecoded);
 }
 
 void
 MediaSourceReader::RequestVideoDataFailed(nsresult aResult)
 {
-  OnVideoNotDecoded(DECODE_ERROR);
+  mVideoPromise.Reject(DECODE_ERROR, __func__);
 }
 
 void
 MediaSourceReader::OnVideoDecoded(VideoData* aSample)
 {
   MSE_DEBUGV("MediaSourceReader(%p)::OnVideoDecoded [mTime=%lld mDuration=%lld mDiscontinuity=%d]",
              this, aSample->mTime, aSample->mDuration, aSample->mDiscontinuity);
   if (mDropVideoBeforeThreshold) {