Bug 1674043 - P3. Early reject AV1 in mp4 decoding if decoder is turned off. r=bryce

There's no need to start the whole PDMFactory machinery if we know it's already disabled.

Additionally, fix tests making assumptions on the changes above.
Flyby fix for flac tests.

Differential Revision: https://phabricator.services.mozilla.com/D95242
This commit is contained in:
Jean-Yves Avenard 2020-11-02 15:46:57 +00:00
Родитель 57cc7b894c
Коммит 4f1c319c0f
4 изменённых файлов: 7 добавлений и 6 удалений

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

@ -15,7 +15,6 @@ bool FlacDecoder::IsEnabled() {
#ifdef MOZ_FFVPX
return StaticPrefs::media_flac_enabled();
#else
// Until bug 1295886 is fixed.
return false;
#endif
}

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

@ -112,7 +112,7 @@ nsTArray<UniquePtr<TrackInfo>> MP4Decoder::GetTracksInfo(
continue;
}
#ifdef MOZ_AV1
if (IsAV1CodecString(codec)) {
if (StaticPrefs::media_av1_enabled() && IsAV1CodecString(codec)) {
tracks.AppendElement(
CreateTrackInfoWithMIMETypeAndContainerTypeExtraParameters(
"video/av1"_ns, aType));

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

@ -777,7 +777,6 @@ tags=mtg capturestream
[test_can_play_type.html]
skip-if = (android_version == '25' && debug) # android(bug 1232305)
[test_can_play_type_mpeg.html]
skip-if = (android_version == '25' && debug) || (os == 'win' && processor == 'aarch64') # bug 1526080 # android(bug 1232305)
[test_can_play_type_no_ogg.html]
skip-if = (android_version == '25' && debug) # android(bug 1232305)
[test_can_play_type_ogg.html]

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

@ -84,8 +84,9 @@ function check_mp4(v, enabled) {
check("audio/mp4; codecs=opus", "probably");
// Flac.
check("audio/mp4; codecs=\"flac\"", "probably");
check("audio/mp4; codecs=flac", "probably");
var haveFlac = getPref("media.flac.enabled");
check("audio/mp4; codecs=\"flac\"", haveFlac ? "probably" : "");
check("audio/mp4; codecs=flac", haveFlac ? "probably" : "");
// VP9.
[ "video/mp4; codecs=vp9",
@ -100,7 +101,9 @@ function check_mp4(v, enabled) {
ok(MediaSource.isTypeSupported(codec), "VP9 in MP4 should be supported in MSE");
}
});
check("video/mp4; codecs=\"av1\"", "probably");
var haveAV1 = getPref("media.av1.enabled");
check("video/mp4; codecs=\"av1\"", haveAV1 ? "probably" : "");
}
function check_mp3(v, enabled) {