Bug 1315586 - DecodedStream::NotifyOutput() should compare |a->mTime| to GetPosition() instead of |aTime|. r=pehrsons
authorJW Wang <jwwang@mozilla.com>
Mon, 07 Nov 2016 11:10:53 +0800
changeset 351401 09c6816c1341232382eabfdeab220f79c6fb3ba6
parent 351400 7254533af863b07efd4ee97188c565e2273ccebb
child 351402 000dc91517d648344729bc8764aee1cca8e91e77
child 351439 018f16f5f08eb862e6711a86b8aa3c54ae90ace2
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1315586
milestone52.0a1
Bug 1315586 - DecodedStream::NotifyOutput() should compare |a->mTime| to GetPosition() instead of |aTime|. r=pehrsons 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()
 {