зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1129877 - Fix the crash. v1 r=mattwoodrow
We could also fix this by invoking .Reject() on the holder instead of on the raw promise. But there's actually no reason to involve the holder at all here.
This commit is contained in:
Родитель
fa0e01bfea
Коммит
07b1989d7b
|
@ -556,10 +556,7 @@ MP4Reader::RequestVideoData(bool aSkipToNextKeyframe,
|
|||
|
||||
if (mShutdown) {
|
||||
NS_WARNING("RequestVideoData on shutdown MP4Reader!");
|
||||
MonitorAutoLock lock(mVideo.mMonitor);
|
||||
nsRefPtr<VideoDataPromise> p = mVideo.mPromise.Ensure(__func__);
|
||||
p->Reject(CANCELED, __func__);
|
||||
return p;
|
||||
return VideoDataPromise::CreateAndReject(CANCELED, __func__);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(HasVideo() && mPlatform && mVideo.mDecoder);
|
||||
|
@ -590,14 +587,14 @@ MP4Reader::RequestAudioData()
|
|||
{
|
||||
MOZ_ASSERT(GetTaskQueue()->IsCurrentThreadIn());
|
||||
VLOG("RequestAudioData");
|
||||
if (mShutdown) {
|
||||
NS_WARNING("RequestAudioData on shutdown MP4Reader!");
|
||||
return AudioDataPromise::CreateAndReject(CANCELED, __func__);
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(mAudio.mMonitor);
|
||||
nsRefPtr<AudioDataPromise> p = mAudio.mPromise.Ensure(__func__);
|
||||
if (!mShutdown) {
|
||||
ScheduleUpdate(kAudio);
|
||||
} else {
|
||||
NS_WARNING("RequestAudioData on shutdown MP4Reader!");
|
||||
p->Reject(CANCELED, __func__);
|
||||
}
|
||||
ScheduleUpdate(kAudio);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче