Bug 1398139 - part2 : adjust sample's start time for chained ogg. draft
authorAlastor Wu <alwu@mozilla.com>
Fri, 15 Sep 2017 18:05:10 +0800
changeset 665394 45272d9d1b0ce9589fd75dda1e4915cfa77d4d99
parent 665321 61c5242746d2554e70c93aab406e29b8fbb1b4d6
child 665395 c512768466f66558bd06eb2b308a9da212827bbb
push id80028
push useralwu@mozilla.com
push dateFri, 15 Sep 2017 10:09:04 +0000
bugs1398139
milestone57.0a1
Bug 1398139 - part2 : adjust sample's start time for chained ogg. 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) {