mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1126465 - Factor out calls to Request{Audio,Video}Data into a helper method. r=mattwoodrow
This commit is contained in:
parent
5d7499a6e3
commit
caff9d581b
@ -140,7 +140,7 @@ MediaSourceReader::RequestAudioData()
|
||||
}
|
||||
// Fallback to using current reader
|
||||
default:
|
||||
RequestAudioDataComplete(0);
|
||||
DoAudioRequest();
|
||||
break;
|
||||
}
|
||||
return p;
|
||||
@ -154,7 +154,11 @@ MediaSourceReader::RequestAudioDataComplete(int64_t aTime)
|
||||
MOZ_RELEASE_ASSERT(mAudioPromise.IsEmpty()); // Already rejected in ::Seek().
|
||||
return;
|
||||
}
|
||||
DoAudioRequest();
|
||||
}
|
||||
|
||||
void MediaSourceReader::DoAudioRequest()
|
||||
{
|
||||
mAudioRequest.Begin(mAudioReader->RequestAudioData()
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnAudioDecoded,
|
||||
@ -289,10 +293,7 @@ MediaSourceReader::RequestVideoData(bool aSkipToNextKeyframe, int64_t aTimeThres
|
||||
}
|
||||
// Fallback to using current reader.
|
||||
default:
|
||||
mVideoRequest.Begin(mVideoReader->RequestVideoData(mDropVideoBeforeThreshold, mTimeThreshold)
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoDecoded,
|
||||
&MediaSourceReader::OnVideoNotDecoded));
|
||||
DoVideoRequest();
|
||||
break;
|
||||
}
|
||||
|
||||
@ -307,6 +308,12 @@ MediaSourceReader::RequestVideoDataComplete(int64_t aTime)
|
||||
MOZ_ASSERT(mVideoPromise.IsEmpty()); // Already rejected in ::Seek().
|
||||
return;
|
||||
}
|
||||
DoVideoRequest();
|
||||
}
|
||||
|
||||
void
|
||||
MediaSourceReader::DoVideoRequest()
|
||||
{
|
||||
mVideoRequest.Begin(mVideoReader->RequestVideoData(mDropVideoBeforeThreshold, mTimeThreshold)
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoDecoded,
|
||||
@ -331,10 +338,7 @@ MediaSourceReader::OnVideoDecoded(VideoData* aSample)
|
||||
if (aSample->mTime < mTimeThreshold) {
|
||||
MSE_DEBUG("MediaSourceReader(%p)::OnVideoDecoded mTime=%lld < mTimeThreshold=%lld",
|
||||
this, aSample->mTime, mTimeThreshold);
|
||||
mVideoRequest.Begin(mVideoReader->RequestVideoData(mDropVideoBeforeThreshold, mTimeThreshold)
|
||||
->RefableThen(GetTaskQueue(), __func__, this,
|
||||
&MediaSourceReader::OnVideoDecoded,
|
||||
&MediaSourceReader::OnVideoNotDecoded));
|
||||
DoVideoRequest();
|
||||
return;
|
||||
}
|
||||
mDropVideoBeforeThreshold = false;
|
||||
|
@ -161,6 +161,10 @@ private:
|
||||
};
|
||||
SwitchReaderResult SwitchAudioReader(int64_t aTarget, int64_t aError = 0);
|
||||
SwitchReaderResult SwitchVideoReader(int64_t aTarget, int64_t aError = 0);
|
||||
|
||||
void DoAudioRequest();
|
||||
void DoVideoRequest();
|
||||
|
||||
void RequestAudioDataComplete(int64_t aTime);
|
||||
void RequestAudioDataFailed(nsresult aResult);
|
||||
void RequestVideoDataComplete(int64_t aTime);
|
||||
|
Loading…
Reference in New Issue
Block a user