Bug 1206977: P13. Assert that data fed to EMEDecoderModule is encrypted. r=cpearce

The PDMFactory ensures that the EMEDecoderModule is only used for encrypted data, we can simplify EMEDecoderModule and make strong assumptions
This commit is contained in:
Jean-Yves Avenard 2015-10-07 10:51:51 +11:00
Родитель 6f051abaa4
Коммит ac5814731c
1 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -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<MediaDataDecoderProxy> 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<MediaDataDecoder> 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<MediaDataDecoderProxy> 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<MediaDataDecoder> emeDecoder(new EMEDecryptor(decoder,
aCallback,
mProxy,