Bug 1193124 - Ensure logical position is updated after seek. r=jwwang

MozReview-Commit-ID: KD4ylXbaDfu

--HG--
extra : rebase_source : c3e856ce515eeeec17b0dd9c64332fcff4d6deb5
This commit is contained in:
JW Wang 2016-04-18 18:57:47 +08:00
Родитель c90c8ee6e1
Коммит 006ae9baa3
2 изменённых файлов: 10 добавлений и 9 удалений

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

@ -1251,7 +1251,8 @@ MediaDecoder::OnSeekResolved(SeekResolveValue aVal)
mLogicallySeeking = false;
}
UpdateLogicalPosition(aVal.mEventVisibility);
// Ensure logical position is updated after seek.
UpdateLogicalPositionInternal(aVal.mEventVisibility);
if (aVal.mEventVisibility != MediaDecoderEventVisibility::Suppressed) {
mOwner->SeekCompleted();
@ -1302,14 +1303,10 @@ MediaDecoder::ChangeState(PlayState aState)
}
void
MediaDecoder::UpdateLogicalPosition(MediaDecoderEventVisibility aEventVisibility)
MediaDecoder::UpdateLogicalPositionInternal(MediaDecoderEventVisibility aEventVisibility)
{
MOZ_ASSERT(NS_IsMainThread());
if (mShuttingDown)
return;
// Per spec, offical position remains stable during pause and seek.
if (mPlayState == PLAY_STATE_PAUSED || IsSeeking()) {
if (mShuttingDown) {
return;
}

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

@ -411,11 +411,15 @@ private:
// thread.
void SeekingStarted(MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable);
void UpdateLogicalPosition(MediaDecoderEventVisibility aEventVisibility);
void UpdateLogicalPositionInternal(MediaDecoderEventVisibility aEventVisibility);
void UpdateLogicalPosition()
{
MOZ_ASSERT(NS_IsMainThread());
UpdateLogicalPosition(MediaDecoderEventVisibility::Observable);
// Per spec, offical position remains stable during pause and seek.
if (mPlayState == PLAY_STATE_PAUSED || IsSeeking()) {
return;
}
UpdateLogicalPositionInternal(MediaDecoderEventVisibility::Observable);
}
// Find the end of the cached data starting at the current decoder