From 260aeead8422df04d3b9ea9bd371daeb07f37e17 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Wed, 18 Mar 2015 14:10:57 +1100 Subject: [PATCH] Bug 1143586: Part1. Be more relaxed when parsing h264 codecs' levels. r=cpearce --- dom/media/VideoUtils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index e6a942e8e4d..ac7b803707f 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -233,6 +233,12 @@ ExtractH264CodecDetails(const nsAString& aCodec, aLevel = PromiseFlatString(Substring(aCodec, 9, 2)).ToInteger(&rv, 16); NS_ENSURE_SUCCESS(rv, false); + if (aLevel == 9) { + aLevel = H264_LEVEL_1_b; + } else if (aLevel <= 5) { + aLevel *= 10; + } + // Capture the constraint_set flag value for the purpose of Telemetry. // We don't NS_ENSURE_SUCCESS here because ExtractH264CodecDetails doesn't // care about this, but we make sure constraints is above 4 (constraint_set5_flag)