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
--- 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) {