Skip to content

Update DashManifestParser.java #2378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class DashManifestParser extends DefaultHandler
implements ParsingLoadable.Parser<DashManifest> {

private static final String TAG = "MpdParser";

public String defaultKid_value = "";
private static final Pattern FRAME_RATE_PATTERN = Pattern.compile("(\\d+)(?:/(\\d+))?");

private static final Pattern CEA_608_ACCESSIBILITY_PATTERN = Pattern.compile("CC([1-4])=.*");
Expand Down Expand Up @@ -584,6 +584,10 @@ protected AdaptationSet buildAdaptationSet(
: C.TRACK_TYPE_UNKNOWN;
}

public void set_default_kid(String default_kid) {
this.defaultKid_value = default_kid;
}

/**
* Parses a ContentProtection element.
*
Expand All @@ -606,6 +610,9 @@ protected AdaptationSet buildAdaptationSet(
case "urn:mpeg:dash:mp4protection:2011":
schemeType = xpp.getAttributeValue(null, "value");
String defaultKid = XmlPullParserUtil.getAttributeValueIgnorePrefix(xpp, "default_KID");
if (!TextUtils.isEmpty(defaultKid)){
defaultKid = defaultKid_value;
}
if (!TextUtils.isEmpty(defaultKid)
&& !"00000000-0000-0000-0000-000000000000".equals(defaultKid)) {
String[] defaultKidStrings = defaultKid.split("\\s+");
Expand Down