зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1404441
- return NS_ERROR_DOM_MEDIA_OVERFLOW_ERR if MediaData::AdjustForStartTime() results in an invalid mTime. r=jya
MozReview-Commit-ID: 44VgbrknYbi --HG-- extra : rebase_source : 9bfbad053a955d7fb18f12a2f6cc6d3b43ee739d
This commit is contained in:
Родитель
ff35fd6ca5
Коммит
5a9ff8849d
|
@ -62,8 +62,12 @@ ReaderProxy::OnAudioDataRequestCompleted(RefPtr<AudioData> aAudio)
|
||||||
int64_t offset =
|
int64_t offset =
|
||||||
StartTime().ToMicroseconds() - mLoopingOffset.ToMicroseconds();
|
StartTime().ToMicroseconds() - mLoopingOffset.ToMicroseconds();
|
||||||
aAudio->AdjustForStartTime(offset);
|
aAudio->AdjustForStartTime(offset);
|
||||||
mLastAudioEndTime = aAudio->mTime;
|
if (aAudio->mTime.IsValid()) {
|
||||||
return AudioDataPromise::CreateAndResolve(aAudio.forget(), __func__);
|
mLastAudioEndTime = aAudio->mTime;
|
||||||
|
return AudioDataPromise::CreateAndResolve(aAudio.forget(), __func__);
|
||||||
|
}
|
||||||
|
return AudioDataPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR,
|
||||||
|
__func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<ReaderProxy::AudioDataPromise>
|
RefPtr<ReaderProxy::AudioDataPromise>
|
||||||
|
@ -149,8 +153,11 @@ ReaderProxy::RequestVideoData(const media::TimeUnit& aTimeThreshold)
|
||||||
__func__,
|
__func__,
|
||||||
[startTime](RefPtr<VideoData> aVideo) {
|
[startTime](RefPtr<VideoData> aVideo) {
|
||||||
aVideo->AdjustForStartTime(startTime);
|
aVideo->AdjustForStartTime(startTime);
|
||||||
return VideoDataPromise::CreateAndResolve(aVideo.forget(),
|
return aVideo->mTime.IsValid()
|
||||||
__func__);
|
? VideoDataPromise::CreateAndResolve(aVideo.forget(),
|
||||||
|
__func__)
|
||||||
|
: VideoDataPromise::CreateAndReject(
|
||||||
|
NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, __func__);
|
||||||
},
|
},
|
||||||
[](const MediaResult& aError) {
|
[](const MediaResult& aError) {
|
||||||
return VideoDataPromise::CreateAndReject(aError, __func__);
|
return VideoDataPromise::CreateAndReject(aError, __func__);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче