bug 1123492 ResetDecode() on subreaders when switching to current or seeking r=mattwoodrow

This commit is contained in:
Karl Tomlinson 2015-02-18 19:23:31 +13:00
parent d39d2824f6
commit 16ad66eef2
3 changed files with 4 additions and 14 deletions

View File

@ -508,6 +508,7 @@ MediaSourceReader::SwitchAudioSource(int64_t* aTarget)
return SOURCE_EXISTING;
}
mAudioSourceDecoder = newDecoder;
GetAudioReader()->ResetDecode();
if (usedFuzz) {
// A decoder buffered range is continuous. We would have failed the exact
// search but succeeded the fuzzy one if our target was shortly before
@ -554,6 +555,7 @@ MediaSourceReader::SwitchVideoSource(int64_t* aTarget)
return SOURCE_EXISTING;
}
mVideoSourceDecoder = newDecoder;
GetVideoReader()->ResetDecode();
if (usedFuzz) {
// A decoder buffered range is continuous. We would have failed the exact
// search but succeeded the fuzzy one if our target was shortly before
@ -810,6 +812,7 @@ MediaSourceReader::OnVideoSeekFailed(nsresult aResult)
void
MediaSourceReader::DoAudioSeek()
{
GetAudioReader()->ResetDecode();
if (SwitchAudioSource(&mPendingSeekTime) == SOURCE_NONE) {
// Data we need got evicted since the last time we checked for data
// availability. Abort current seek attempt.
@ -860,9 +863,6 @@ MediaSourceReader::AttemptSeek()
}
ResetDecode();
for (uint32_t i = 0; i < mTrackBuffers.Length(); ++i) {
mTrackBuffers[i]->ResetDecode();
}
// Decoding discontinuity upon seek, reset last times to seek target.
mLastAudioTime = mPendingSeekTime;
@ -880,6 +880,7 @@ MediaSourceReader::AttemptSeek()
void
MediaSourceReader::DoVideoSeek()
{
GetVideoReader()->ResetDecode();
if (SwitchVideoSource(&mPendingSeekTime) == SOURCE_NONE) {
// Data we need got evicted since the last time we checked for data
// availability. Abort current seek attempt.

View File

@ -839,14 +839,6 @@ TrackBuffer::BreakCycles()
MOZ_ASSERT(!mParentDecoder);
}
void
TrackBuffer::ResetDecode()
{
for (uint32_t i = 0; i < mDecoders.Length(); ++i) {
mDecoders[i]->GetReader()->ResetDecode();
}
}
void
TrackBuffer::ResetParserState()
{

View File

@ -81,9 +81,6 @@ public:
void BreakCycles();
// Call ResetDecode() on each decoder in mDecoders.
void ResetDecode();
// Run MSE Reset Parser State Algorithm.
// 3.5.2 Reset Parser State
// http://w3c.github.io/media-source/#sourcebuffer-reset-parser-state