Bug 1130913: Only create a new decoder if we have a new media segment. r=mattwoodrow

This commit is contained in:
Jean-Yves Avenard 2015-02-11 17:40:10 +11:00
Родитель 967797cbd8
Коммит 90b61d5576
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -211,7 +211,7 @@ TrackBuffer::AppendData(LargeDataBuffer* aData, int64_t aTimestampOffset)
}
if (gotMedia) {
if (mLastEndTimestamp &&
if (mParser->IsMediaSegmentPresent(aData) && mLastEndTimestamp &&
(!mParser->TimestampsFuzzyEqual(start, mLastEndTimestamp.value()) ||
mLastTimestampOffset != aTimestampOffset ||
mDecoderPerSegment ||
@ -256,11 +256,12 @@ TrackBuffer::AppendData(LargeDataBuffer* aData, int64_t aTimestampOffset)
// We're going to have to wait for the decoder to initialize, the promise
// will be resolved once initialization completes.
return p;
} else if (gotMedia) {
// Tell our reader that we have more data to ensure that playback starts if
// required when data is appended.
mParentDecoder->GetReader()->MaybeNotifyHaveData();
}
// Tell our reader that we have more data to ensure that playback starts if
// required when data is appended.
mParentDecoder->GetReader()->MaybeNotifyHaveData();
mInitializationPromise.Resolve(gotMedia, __func__);
return p;
}