From 4255184fd240350e62221f10a60f8d6d4c60bd40 Mon Sep 17 00:00:00 2001 From: alwu Date: Mon, 26 Feb 2024 22:24:52 +0000 Subject: [PATCH] Bug 1881620 - part2 : use ExternalEngineStateMachine for non-mse media only when the media engine pref allows non-encrypted playback. r=jolin Depends on D202511 Differential Revision: https://phabricator.services.mozilla.com/D202758 --- dom/media/ChannelMediaDecoder.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dom/media/ChannelMediaDecoder.cpp b/dom/media/ChannelMediaDecoder.cpp index c6da221f94ac..cea3e44c3656 100644 --- a/dom/media/ChannelMediaDecoder.cpp +++ b/dom/media/ChannelMediaDecoder.cpp @@ -221,9 +221,10 @@ MediaDecoderStateMachineBase* ChannelMediaDecoder::CreateStateMachine( mReader = DecoderTraits::CreateReader(ContainerType(), init); #ifdef MOZ_WMF_MEDIA_ENGINE - // TODO : Only for testing development for now. In the future this should be - // used for encrypted content only. - if (StaticPrefs::media_wmf_media_engine_enabled() && + // only use it when the pref allows media engine non-encrypted playback + // 1=enabled encrypted and clear, 3=enabled clear + if ((StaticPrefs::media_wmf_media_engine_enabled() == 1 || + StaticPrefs::media_wmf_media_engine_enabled() == 3) && StaticPrefs::media_wmf_media_engine_channel_decoder_enabled() && !aDisableExternalEngine) { return new ExternalEngineStateMachine(this, mReader);