Bug 1129732: Part4. Use sourcebufferdecoder's end time. r=mattwoodrow a=lmandel
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 09 Feb 2015 23:29:00 +1100
changeset 240836 6fede35aa9f6b7d47b1d3546d52582f78d04445c
parent 240835 1c5814ce8adee2321d85b02885abdf51f7965683
child 240837 550f936c3293dcb7b2e78b3c0a9b04d33559662b
push id7668
push userrgiles@mozilla.com
push dateSun, 22 Feb 2015 18:35:58 +0000
treeherdermozilla-aurora@550f936c3293 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, lmandel
bugs1129732
milestone37.0a2
Bug 1129732: Part4. Use sourcebufferdecoder's end time. r=mattwoodrow a=lmandel
dom/media/mediasource/MediaSourceReader.cpp
--- a/dom/media/mediasource/MediaSourceReader.cpp
+++ b/dom/media/mediasource/MediaSourceReader.cpp
@@ -197,23 +197,22 @@ MediaSourceReader::OnAudioDecoded(AudioD
 // time that is greater than mLastAudioTime, which is the actual sample
 // end time.
 // Reader switching is based on the buffered end time though so they can be
 // quite different. By using the EOS_FUZZ_US and the buffered end time we
 // attempt to account for this difference.
 static void
 AdjustEndTime(int64_t* aEndTime, SourceBufferDecoder* aDecoder)
 {
-  if (aDecoder && aDecoder->GetReader()) {
+  if (aDecoder) {
     nsRefPtr<dom::TimeRanges> ranges = new dom::TimeRanges();
-    aDecoder->GetReader()->GetBuffered(ranges);
+    aDecoder->GetBuffered(ranges);
     if (ranges->Length() > 0) {
       // End time is a double so we convert to nearest by adding 0.5.
-      int64_t end =
-        (ranges->GetEndTime() + aDecoder->GetTimestampOffset()) * USECS_PER_S + 0.5;
+      int64_t end = ranges->GetEndTime() * USECS_PER_S + 0.5;
       *aEndTime = std::max(*aEndTime, end);
     }
   }
 }
 
 void
 MediaSourceReader::OnAudioNotDecoded(NotDecodedReason aReason)
 {