Bug 1286454 part 2 - remove MediaDecoderReader::mAudioDiscontinuity since it leads to nothing now; r=jwwang
authorKaku Kuo <kaku@mozilla.com>
Thu, 25 Aug 2016 18:14:17 +0800
changeset 311730 78979124b83af5fa87081285f4e9a9d151137c76
parent 311729 4cb4952bbbdebd8ac0d2dccaf3a6b09bacc68f24
child 311731 37299ee3c9e0993b6f367001eb3dddd6f7ea91c4
push id20417
push userryanvm@gmail.com
push dateTue, 30 Aug 2016 13:55:34 +0000
treeherderfx-team@b18c8bcdc116 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1286454
milestone51.0a1
Bug 1286454 part 2 - remove MediaDecoderReader::mAudioDiscontinuity since it leads to nothing now; r=jwwang MozReview-Commit-ID: DjOXLa5aDm1
dom/media/MediaDecoderReader.cpp
dom/media/MediaDecoderReader.h
--- a/dom/media/MediaDecoderReader.cpp
+++ b/dom/media/MediaDecoderReader.cpp
@@ -219,17 +219,16 @@ MediaDecoderReader::MediaDecoderReader(A
   , mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK),
                              /* aSupportsTailDispatch = */ true))
   , mWatchManager(this, mTaskQueue)
   , mBuffered(mTaskQueue, TimeIntervals(), "MediaDecoderReader::mBuffered (Canonical)")
   , mDuration(mTaskQueue, NullableTimeUnit(), "MediaDecoderReader::mDuration (Mirror)")
   , mIgnoreAudioOutputFormat(false)
   , mHitAudioDecodeError(false)
   , mShutdown(false)
-  , mAudioDiscontinuity(false)
   , mVideoDiscontinuity(false)
   , mIsSuspended(mTaskQueue, true,
                  "MediaDecoderReader::mIsSuspended (Canonical)")
 {
   MOZ_COUNT_CTOR(MediaDecoderReader);
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mDecoder && mDecoder->DataArrivedEvent()) {
@@ -292,17 +291,16 @@ nsresult MediaDecoderReader::ResetDecode
   if (aTracks.contains(TrackInfo::kVideoTrack)) {
     VideoQueue().Reset();
     mVideoDiscontinuity = true;
     mBaseVideoPromise.RejectIfExists(CANCELED, __func__);
   }
 
   if (aTracks.contains(TrackInfo::kAudioTrack)) {
     AudioQueue().Reset();
-    mAudioDiscontinuity = true;
     mBaseAudioPromise.RejectIfExists(CANCELED, __func__);
   }
 
   return NS_OK;
 }
 
 RefPtr<MediaDecoderReader::MediaDataPromise>
 MediaDecoderReader::DecodeToFirstVideoData()
@@ -488,19 +486,16 @@ MediaDecoderReader::RequestAudioData()
     if (AudioQueue().GetSize() == 0) {
       RefPtr<nsIRunnable> task(new ReRequestAudioTask(this));
       mTaskQueue->Dispatch(task.forget());
       return p;
     }
   }
   if (AudioQueue().GetSize() > 0) {
     RefPtr<AudioData> a = AudioQueue().PopFront();
-    if (mAudioDiscontinuity) {
-      mAudioDiscontinuity = false;
-    }
     mBaseAudioPromise.Resolve(a, __func__);
   } else if (AudioQueue().IsFinished()) {
     mBaseAudioPromise.Reject(mHitAudioDecodeError ? DECODE_ERROR : END_OF_STREAM, __func__);
     mHitAudioDecodeError = false;
   } else {
     MOZ_ASSERT(false, "Dropping this promise on the floor");
   }
 
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -461,17 +461,16 @@ private:
 
   // Promises used only for the base-class (sync->async adapter) implementation
   // of Request{Audio,Video}Data.
   MozPromiseHolder<MediaDataPromise> mBaseAudioPromise;
   MozPromiseHolder<MediaDataPromise> mBaseVideoPromise;
 
   // Flags whether a the next audio/video sample comes after a "gap" or
   // "discontinuity" in the stream. For example after a seek.
-  bool mAudioDiscontinuity;
   bool mVideoDiscontinuity;
   Canonical<bool> mIsSuspended;
 
   MediaEventListener mDataArrivedListener;
 };
 
 } // namespace mozilla