зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1089586: Abort pending seeks. r=jwwang
We only perform the last seek requested instead.
This commit is contained in:
Родитель
9323ac2f6a
Коммит
9396c59cd0
|
@ -1411,7 +1411,9 @@ MediaFormatReader::Seek(int64_t aTime, int64_t aUnused)
|
|||
|
||||
nsRefPtr<SeekPromise> p = mSeekPromise.Ensure(__func__);
|
||||
|
||||
AttemptSeek();
|
||||
RefPtr<nsIRunnable> task(
|
||||
NS_NewRunnableMethod(this, &MediaFormatReader::AttemptSeek));
|
||||
OwnerThread()->Dispatch(task.forget());
|
||||
|
||||
return p;
|
||||
}
|
||||
|
@ -1420,6 +1422,13 @@ void
|
|||
MediaFormatReader::AttemptSeek()
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
if (mPendingSeekTime.isNothing()) {
|
||||
return;
|
||||
}
|
||||
// An internal seek may be pending due to Seek queueing multiple tasks calling
|
||||
// AttemptSeek ; we can ignore those by resetting any pending demuxer's seek.
|
||||
mAudio.mSeekRequest.DisconnectIfExists();
|
||||
mVideo.mSeekRequest.DisconnectIfExists();
|
||||
if (HasVideo()) {
|
||||
DoVideoSeek();
|
||||
} else if (HasAudio()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче