mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1374210: Reject/Cancel any pending operations. r=gerald
MozReview-Commit-ID: GVlzm2GWT1D --HG-- extra : rebase_source : a94491b69960a2679ae20433461ecb51e1821b15
This commit is contained in:
parent
b599411285
commit
851b08981f
@ -192,16 +192,24 @@ H264Converter::Shutdown()
|
||||
{
|
||||
mInitPromiseRequest.DisconnectIfExists();
|
||||
mDecodePromiseRequest.DisconnectIfExists();
|
||||
mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
||||
mDrainRequest.DisconnectIfExists();
|
||||
mFlushRequest.DisconnectIfExists();
|
||||
mShutdownRequest.DisconnectIfExists();
|
||||
mFlushPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
|
||||
mNeedAVCC.reset();
|
||||
mShutdownRequest.DisconnectIfExists();
|
||||
|
||||
if (mShutdownPromise) {
|
||||
// We have a shutdown in progress, return that promise instead as we can't
|
||||
// shutdown a decoder twice.
|
||||
return mShutdownPromise.forget();
|
||||
}
|
||||
return ShutdownDecoder();
|
||||
}
|
||||
|
||||
RefPtr<ShutdownPromise>
|
||||
H264Converter::ShutdownDecoder()
|
||||
{
|
||||
mNeedAVCC.reset();
|
||||
if (mDecoder) {
|
||||
RefPtr<MediaDataDecoder> decoder = mDecoder.forget();
|
||||
return decoder->Shutdown();
|
||||
@ -479,7 +487,7 @@ void H264Converter::FlushThenShutdownDecoder(MediaRawData* aPendingSample)
|
||||
return;
|
||||
}
|
||||
|
||||
mShutdownPromise = Shutdown();
|
||||
mShutdownPromise = ShutdownDecoder();
|
||||
mShutdownPromise
|
||||
->Then(AbstractThread::GetCurrent()->AsTaskQueue(),
|
||||
__func__,
|
||||
|
@ -76,6 +76,7 @@ private:
|
||||
void DecodeFirstSample(MediaRawData* aSample);
|
||||
void DrainThenFlushDecoder(MediaRawData* aPendingSample);
|
||||
void FlushThenShutdownDecoder(MediaRawData* aPendingSample);
|
||||
RefPtr<ShutdownPromise> ShutdownDecoder();
|
||||
|
||||
RefPtr<PlatformDecoderModule> mPDM;
|
||||
const VideoInfo mOriginalConfig;
|
||||
|
Loading…
Reference in New Issue
Block a user