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 348049 09c6816c1341232382eabfdeab220f79c6fb3ba6
parent 348048 7254533af863b07efd4ee97188c565e2273ccebb
child 348050 000dc91517d648344729bc8764aee1cca8e91e77
child 348087 018f16f5f08eb862e6711a86b8aa3c54ae90ace2
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [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()
 {