Bug 1398139 - part2 : adjust sample's start time for chained ogg. r=jya
authorAlastor Wu <alwu@mozilla.com>
Fri, 15 Sep 2017 18:05:10 +0800
changeset 665694 9fe90be81abbcc63f2c0aab66222eb867b968990
parent 665693 1421239eef77ff58aaf7883a366d8f97536cdfa2
child 665695 39e86cbf34d57f5478838b9b0166ba44c4f68a71
push id80148
push userbmo:emilio@crisal.io
push dateFri, 15 Sep 2017 20:59:22 +0000
reviewersjya
bugs1398139
milestone57.0a1
Bug 1398139 - part2 : adjust sample's start time for chained ogg. r=jya For chained ogg files, the new part would contain new timestamp from zero, so we need to add the duration of previously decoded data to make sure the current time is correct. MozReview-Commit-ID: Bb1lCiKz4uQ
dom/media/ogg/OggDemuxer.cpp
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -1355,16 +1355,17 @@ OggTrackDemuxer::NextSample()
     data->mTrackInfo = mParent->mSharedAudioTrackInfo;
   }
   if (eos) {
     // We've encountered an end of bitstream packet; check for a chained
     // bitstream following this one.
     // This will also update mSharedAudioTrackInfo.
     mParent->ReadOggChain(data->GetEndTime());
   }
+  data->mTime += mParent->mDecodedAudioDuration;
   return data;
 }
 
 RefPtr<OggTrackDemuxer::SamplesPromise>
 OggTrackDemuxer::GetSamples(int32_t aNumSamples)
 {
   RefPtr<SamplesHolder> samples = new SamplesHolder;
   if (!aNumSamples) {