mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1105066 - Make SeekPromise return the time we actually seeked to; r=kentuckyfriedtakahe
This commit is contained in:
parent
a60b16a806
commit
f05ddb6181
@ -52,7 +52,7 @@ public:
|
||||
|
||||
typedef MediaPromise<nsRefPtr<AudioData>, NotDecodedReason> AudioDataPromise;
|
||||
typedef MediaPromise<nsRefPtr<VideoData>, NotDecodedReason> VideoDataPromise;
|
||||
typedef MediaPromise<bool, nsresult> SeekPromise;
|
||||
typedef MediaPromise<int64_t, nsresult> SeekPromise;
|
||||
typedef MediaPromise<MediaData::Type, WaitForDataRejectValue> WaitForDataPromise;
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaDecoderReader)
|
||||
|
@ -2395,7 +2395,7 @@ void MediaDecoderStateMachine::DecodeSeek()
|
||||
}
|
||||
|
||||
void
|
||||
MediaDecoderStateMachine::OnSeekCompleted()
|
||||
MediaDecoderStateMachine::OnSeekCompleted(int64_t aTime)
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
|
||||
mWaitingForDecoderSeek = false;
|
||||
|
@ -400,7 +400,7 @@ public:
|
||||
OnNotDecoded(MediaData::VIDEO_DATA, aReason);
|
||||
}
|
||||
|
||||
void OnSeekCompleted();
|
||||
void OnSeekCompleted(int64_t aTime);
|
||||
void OnSeekFailed(nsresult aResult);
|
||||
|
||||
void OnWaitForDataResolved(MediaData::Type aType)
|
||||
|
@ -340,7 +340,7 @@ AndroidMediaReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime,
|
||||
mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget;
|
||||
}
|
||||
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(mAudioSeekTimeUs, __func__);
|
||||
}
|
||||
|
||||
AndroidMediaReader::ImageBufferCallback::ImageBufferCallback(mozilla::layers::ImageContainer *aImageContainer) :
|
||||
|
@ -529,7 +529,7 @@ AppleMP3Reader::Seek(int64_t aTime,
|
||||
|
||||
ResetDecode();
|
||||
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTime, __func__);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -377,7 +377,7 @@ DirectShowReader::Seek(int64_t aTargetUs,
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTargetUs, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -906,17 +906,20 @@ MP4Reader::Seek(int64_t aTime,
|
||||
return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
|
||||
}
|
||||
|
||||
int64_t seekTime = aTime;
|
||||
mQueuedVideoSample = nullptr;
|
||||
if (mDemuxer->HasValidVideo()) {
|
||||
mDemuxer->SeekVideo(aTime);
|
||||
mDemuxer->SeekVideo(seekTime);
|
||||
mQueuedVideoSample = PopSampleLocked(kVideo);
|
||||
if (mQueuedVideoSample) {
|
||||
seekTime = mQueuedVideoSample->composition_timestamp;
|
||||
}
|
||||
}
|
||||
if (mDemuxer->HasValidAudio()) {
|
||||
mDemuxer->SeekAudio(
|
||||
mQueuedVideoSample ? mQueuedVideoSample->composition_timestamp : aTime);
|
||||
mDemuxer->SeekAudio(seekTime);
|
||||
}
|
||||
LOG("MP4Reader::Seek(%lld) exit", aTime);
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(seekTime, __func__);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -814,7 +814,7 @@ GStreamerReader::Seek(int64_t aTarget,
|
||||
gst_message_unref(message);
|
||||
LOG(PR_LOG_DEBUG, "seek completed");
|
||||
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTarget, __func__);
|
||||
}
|
||||
|
||||
nsresult GStreamerReader::GetBuffered(dom::TimeRanges* aBuffered)
|
||||
|
@ -611,7 +611,7 @@ MediaSourceReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime,
|
||||
}
|
||||
|
||||
void
|
||||
MediaSourceReader::OnSeekCompleted()
|
||||
MediaSourceReader::OnSeekCompleted(int64_t aTime)
|
||||
{
|
||||
mPendingSeeks--;
|
||||
FinalizeSeek();
|
||||
@ -637,7 +637,7 @@ MediaSourceReader::FinalizeSeek()
|
||||
if (NS_FAILED(mSeekResult)) {
|
||||
mSeekPromise.Reject(mSeekResult, __func__);
|
||||
} else {
|
||||
mSeekPromise.Resolve(true, __func__);
|
||||
mSeekPromise.Resolve(mPendingSeekTime, __func__);
|
||||
}
|
||||
mSeekResult = NS_OK;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
void OnVideoDecoded(VideoData* aSample);
|
||||
void OnVideoNotDecoded(NotDecodedReason aReason);
|
||||
|
||||
void OnSeekCompleted();
|
||||
void OnSeekCompleted(int64_t aTime);
|
||||
void OnSeekFailed(nsresult aResult);
|
||||
|
||||
virtual bool IsWaitForDataSupported() MOZ_OVERRIDE { return true; }
|
||||
|
@ -1434,7 +1434,7 @@ OggReader::Seek(int64_t aTarget,
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTarget, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1056,7 +1056,7 @@ MediaCodecReader::Seek(int64_t aTime,
|
||||
MOZ_ASSERT(mAudioTrack.mTaskQueue->IsEmpty());
|
||||
DispatchAudioTask();
|
||||
}
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTime, __func__);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -572,7 +572,7 @@ MediaOmxReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int6
|
||||
mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget;
|
||||
}
|
||||
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(mAudioSeekTimeUs, __func__);
|
||||
}
|
||||
|
||||
void MediaOmxReader::SetIdle() {
|
||||
|
@ -242,7 +242,7 @@ RawReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, int64_t aCu
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTime, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ WaveReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime, int64_t
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTarget, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -959,7 +959,7 @@ WebMReader::Seek(int64_t aTarget, int64_t aStartTime, int64_t aEndTime,
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTarget, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -898,7 +898,7 @@ WMFReader::Seek(int64_t aTargetUs,
|
||||
if (NS_FAILED(res)) {
|
||||
return SeekPromise::CreateAndReject(res, __func__);
|
||||
} else {
|
||||
return SeekPromise::CreateAndResolve(true, __func__);
|
||||
return SeekPromise::CreateAndResolve(aTargetUs, __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user