diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp index 46bccab7e483..bdf95e5632e9 100644 --- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp @@ -230,7 +230,9 @@ EMEDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, FlushableTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback) { - if (mCDMDecodesVideo && aConfig.mCrypto.mValid) { + MOZ_ASSERT(aConfig.mCrypto.mValid); + + if (mCDMDecodesVideo) { nsRefPtr wrapper = CreateDecoderWrapper(aCallback, mProxy, aVideoTaskQueue); wrapper->SetProxyTarget(new EMEVideoDecoder(mProxy, aConfig, @@ -252,10 +254,6 @@ EMEDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig, return nullptr; } - if (!aConfig.mCrypto.mValid) { - return decoder.forget(); - } - nsRefPtr emeDecoder(new EMEDecryptor(decoder, aCallback, mProxy, @@ -268,7 +266,9 @@ EMEDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, FlushableTaskQueue* aAudioTaskQueue, MediaDataDecoderCallback* aCallback) { - if (mCDMDecodesAudio && aConfig.mCrypto.mValid) { + MOZ_ASSERT(aConfig.mCrypto.mValid); + + if (mCDMDecodesAudio) { nsRefPtr wrapper = CreateDecoderWrapper(aCallback, mProxy, aAudioTaskQueue); wrapper->SetProxyTarget(new EMEAudioDecoder(mProxy, aConfig, @@ -284,10 +284,6 @@ EMEDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig, return nullptr; } - if (!aConfig.mCrypto.mValid) { - return decoder.forget(); - } - nsRefPtr emeDecoder(new EMEDecryptor(decoder, aCallback, mProxy,