mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1134064: Part4. Fix racing condition should data get evicted. r=mattwoodrow
Should required data get evicted between the time we checked for availability and the time we started seeking, it would have caused the seek to fail. Instead cancel current seek and go back waiting for more data.
This commit is contained in:
parent
7c9260ddd3
commit
2c4cc92b83
@ -810,8 +810,12 @@ MediaSourceReader::OnVideoSeekFailed(nsresult aResult)
|
||||
void
|
||||
MediaSourceReader::DoAudioSeek()
|
||||
{
|
||||
SwitchAudioSource(&mPendingSeekTime);
|
||||
MOZ_ASSERT(GetAudioReader());
|
||||
if (SwitchAudioSource(&mPendingSeekTime) == SOURCE_NONE) {
|
||||
// Data we need got evicted since the last time we checked for data
|
||||
// availability. Abort current seek attempt.
|
||||
mWaitingForSeekData = true;
|
||||
return;
|
||||
}
|
||||
mAudioSeekRequest.Begin(GetAudioReader()->Seek(GetReaderAudioTime(mPendingSeekTime), 0)
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioSeekCompleted,
|
||||
@ -876,8 +880,12 @@ MediaSourceReader::AttemptSeek()
|
||||
void
|
||||
MediaSourceReader::DoVideoSeek()
|
||||
{
|
||||
SwitchVideoSource(&mPendingSeekTime);
|
||||
MOZ_ASSERT(GetVideoReader());
|
||||
if (SwitchVideoSource(&mPendingSeekTime) == SOURCE_NONE) {
|
||||
// Data we need got evicted since the last time we checked for data
|
||||
// availability. Abort current seek attempt.
|
||||
mWaitingForSeekData = true;
|
||||
return;
|
||||
}
|
||||
mVideoSeekRequest.Begin(GetVideoReader()->Seek(GetReaderVideoTime(mPendingSeekTime), 0)
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoSeekCompleted,
|
||||
|
Loading…
Reference in New Issue
Block a user