Bug 1129732: Part4. Use sourcebufferdecoder's end time. r=mattwoodrow a=lmandel
☠☠ backed out by 77d5e3a30435 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 09 Feb 2015 23:29:00 +1100
changeset 249854 7f5d120245af74677a9fd7b4bd0d4ab5c5bafee0
parent 249853 81b4d96a95f5288010b011f6cb7e3967d493c2c4
child 249855 f24f0b0532f983d6ec010d1e09a8aaadf41b38c3
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [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)
 {