Bug 1912680 - Don't reject invalid h264 codec string, and pretend Firefox can play them. r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D220278
This commit is contained in:
Paul Adenot 2024-08-27 16:25:09 +00:00
parent 26c33120bf
commit fd5175e475
2 changed files with 3 additions and 10 deletions

View File

@ -487,17 +487,7 @@ bool ExtractH264CodecDetails(const nsAString& aCodec, uint8_t& aProfile,
level *= 10;
}
// Check if valid level value
aLevel = static_cast<H264_LEVEL>(level);
if (aLevel < H264_LEVEL::H264_LEVEL_1 ||
aLevel > H264_LEVEL::H264_LEVEL_6_2) {
return false;
}
if ((level % 10) > 2) {
if (level != 13) {
return false;
}
}
return true;
}

View File

@ -57,6 +57,9 @@ function check_mp4(v, enabled) {
// H.264 High Profile Level 3.1, AAC-LC
check("video/mp4; codecs=\"avc1.64001F, mp4a.40.2\"", "probably");
// Bogus H.264 level, return "probably" for web compat reasons
check("video/mp4; codecs=\"avc1.4D401D, mp4a.40.2\"", "probably");
check("video/mp4; codecs=\"avc1.42E01E\"", "probably");
check("video/mp4; codecs=\"avc1.42001E\"", "probably");
check("video/mp4; codecs=\"avc1.58A01E\"", "probably");