Bug 1583986 - add pref to control ffvpx mp3 decoding so we can turn it off if needed. r=bwc,jya

Differential Revision: https://phabricator.services.mozilla.com/D47499

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Michael Froman 2019-09-30 14:29:08 +00:00
parent bae04a811a
commit 0821463d17
2 changed files with 11 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "FFmpegAudioDecoder.h"
#include "TimeUnits.h"
#include "VideoUtils.h"
#include "mozilla/StaticPrefs_media.h"
namespace mozilla {
@ -264,6 +265,11 @@ MediaResult FFmpegAudioDecoder<LIBAV_VER>::DoDecode(MediaRawData* aSample,
AVCodecID FFmpegAudioDecoder<LIBAV_VER>::GetCodecId(
const nsACString& aMimeType) {
if (aMimeType.EqualsLiteral("audio/mpeg")) {
#ifdef FFVPX_VERSION
if (!StaticPrefs::media_ffvpx_mp3_enabled()) {
return AV_CODEC_ID_NONE;
}
#endif
return AV_CODEC_ID_MP3;
} else if (aMimeType.EqualsLiteral("audio/flac")) {
return AV_CODEC_ID_FLAC;

View File

@ -5645,6 +5645,11 @@
type: RelaxedAtomicBool
value: true
mirror: always
- name: media.ffvpx.mp3.enabled
type: RelaxedAtomicBool
value: true
mirror: always
#endif
#if defined(MOZ_FFMPEG) || defined(MOZ_FFVPX)