Commit 5a6d1435 by olly Committed by Oliver Woodman

Fix overzealous ContentProtection filtering.

Failing to parse a UUID from a ContentProtection should only
result in filtering if there was actually a cenc:pssh element
there for us to get it from.

Issue: #1256
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117220417
parent 7cddd1b1
......@@ -317,16 +317,18 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
String schemeIdUri = xpp.getAttributeValue(null, "schemeIdUri");
UUID uuid = null;
SchemeInitData data = null;
boolean seenPsshElement = false;
do {
xpp.next();
// The cenc:pssh element is defined in 23001-7:2015.
if (ParserUtil.isStartTag(xpp, "cenc:pssh") && xpp.next() == XmlPullParser.TEXT) {
seenPsshElement = true;
data = new SchemeInitData(MimeTypes.VIDEO_MP4,
Base64.decode(xpp.getText(), Base64.DEFAULT));
uuid = PsshAtomUtil.parseUuid(data.data);
}
} while (!ParserUtil.isEndTag(xpp, "ContentProtection"));
if (uuid == null) {
if (seenPsshElement && uuid == null) {
Log.w(TAG, "Skipped unsupported ContentProtection element");
return null;
}
......
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 sign in to comment