Commit 571587c3 authored by sandersd's avatar sandersd Committed by Commit bot

Check that containers are supported by Chrome in requestMediaKeySystemAccess().

This can only fail if a CDM declares support for a container that Chrome does not, which would be a bug in CDM registration.

BUG=374751

Review URL: https://codereview.chromium.org/1035923004

Cr-Commit-Position: refs/heads/master@{#322486}
parent 64549361
......@@ -146,13 +146,19 @@ static bool IsSupportedContentType(
return false;
}
if (codec_vector.empty())
return true;
// Check that |container_mime_type| is supported by Chrome. This can only
// happen if the CDM declares support for a container that Chrome does not.
if (!net::IsSupportedMediaMimeType(container_lower)) {
NOTREACHED();
return false;
}
// Check that |codecs| are supported by Chrome. This is done primarily to
// validate extended codecs, but it also ensures that the CDM cannot support
// codecs that Chrome does not (which could complicate the robustness
// algorithm).
if (codec_vector.empty())
return true;
codec_vector.clear();
net::ParseCodecString(codecs, &codec_vector, false);
return (net::IsSupportedStrictMediaMimeType(container_lower, codec_vector) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment