Bug 1315586 - DecodedStream::NotifyOutput() should compare |a->mTime| to GetPosition() instead of |aTime|. draft
authorJW Wang <jwwang@mozilla.com>
Mon, 07 Nov 2016 11:10:53 +0800
changeset 434668 6672aa8851c672f2f76c8289e83a1883ac9fbce1
parent 434667 7507c777d2f57ff496dacd73af96911f9b1845fe
child 434671 d140eb33849757e4757690a36b066f33501dc55b
push id34784
push userjwwang@mozilla.com
push dateMon, 07 Nov 2016 03:12:00 +0000
bugs1315586
milestone52.0a1
Bug 1315586 - DecodedStream::NotifyOutput() should compare |a->mTime| to GetPosition() instead of |aTime|. MozReview-Commit-ID: AyqsW9w5Je0
dom/media/mediasink/DecodedStream.cpp
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -724,20 +724,21 @@ DecodedStream::GetPosition(TimeStamp* aT
   return mStartTime.ref() + mLastOutputTime;
 }
 
 void
 DecodedStream::NotifyOutput(int64_t aTime)
 {
   AssertOwnerThread();
   mLastOutputTime = aTime;
+  int64_t currentTime = GetPosition();
 
   // Remove audio samples that have been played by MSG from the queue.
   RefPtr<MediaData> a = mAudioQueue.PeekFront();
-  for (; a && a->mTime < aTime;) {
+  for (; a && a->mTime < currentTime;) {
     RefPtr<MediaData> releaseMe = mAudioQueue.PopFront();
     a = mAudioQueue.PeekFront();
   }
 }
 
 void
 DecodedStream::ConnectListener()
 {