Bug 1428682 - set MediaData::mOffset properly in OggDemuxer.
mOffset is important for MediaCache to evaluate the playback rate in bytes for
a live stream. Failing to set this field (initially 0) will cause MediaCache to
assume very low playback rate (in bytes) and not to download enough bytes for
decoder to consume without underflow.
This issue is manifested by
bug 1427527 where a live ogg stream is played.
MozReview-Commit-ID: JiaXtpWCl09
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -1359,16 +1359,17 @@ OggTrackDemuxer::NextSample()
// mDecodedAudioDuration gets adjusted during ReadOggChain().
TimeUnit totalDuration = mParent->mDecodedAudioDuration;
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->mOffset = mParent->Resource(mType)->Tell();
// We adjust the start time of the sample to account for the potential ogg chaining.
data->mTime += totalDuration;
return data;
}
RefPtr<OggTrackDemuxer::SamplesPromise>
OggTrackDemuxer::GetSamples(int32_t aNumSamples)
{