зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1189138: [MSE] P3. Properly shift our demuxing index when data is added. r=gerald
Should frames be added before our current demuxing position, we must shift the index ; otherwise the next retrieved frames will be the wrong one.
This commit is contained in:
Родитель
024aff6746
Коммит
625eecf933
|
@ -1515,6 +1515,12 @@ TrackBuffersManager::InsertFrames(TrackBuffer& aSamples,
|
|||
CheckNextInsertionIndex(aTrackData,
|
||||
TimeUnit::FromMicroseconds(aSamples[0]->mTime));
|
||||
|
||||
// Adjust our demuxing index if necessary.
|
||||
if (trackBuffer.mNextGetSampleIndex.isSome() &&
|
||||
trackBuffer.mNextInsertionIndex.ref() <= trackBuffer.mNextGetSampleIndex.ref()) {
|
||||
trackBuffer.mNextGetSampleIndex.ref() += aSamples.Length();
|
||||
}
|
||||
|
||||
TrackBuffer& data = trackBuffer.mBuffers.LastElement();
|
||||
data.InsertElementsAt(trackBuffer.mNextInsertionIndex.ref(), aSamples);
|
||||
trackBuffer.mNextInsertionIndex.ref() += aSamples.Length();
|
||||
|
|
Загрузка…
Ссылка в новой задаче