Allow unsigned integers in adaptation set id

This commit is contained in:
Vishnu Chilakala 2023-06-28 17:08:49 +05:30 committed by tonihei
parent 7996766b22
commit e06c72ba26

View file

@ -393,7 +393,7 @@ public class DashManifestParser extends DefaultHandler
long timeShiftBufferDepthMs, long timeShiftBufferDepthMs,
boolean dvbProfileDeclared) boolean dvbProfileDeclared)
throws XmlPullParserException, IOException { throws XmlPullParserException, IOException {
int id = parseInt(xpp, "id", AdaptationSet.ID_UNSET); int id = parseUnsignedInt(xpp, "id", AdaptationSet.ID_UNSET);
@C.TrackType int contentType = parseContentType(xpp); @C.TrackType int contentType = parseContentType(xpp);
String mimeType = xpp.getAttributeValue(null, "mimeType"); String mimeType = xpp.getAttributeValue(null, "mimeType");
@ -1927,6 +1927,11 @@ public class DashManifestParser extends DefaultHandler
return text; return text;
} }
protected static int parseUnsignedInt(XmlPullParser xpp, String name, int defaultValue) {
String value = xpp.getAttributeValue(null, name);
return value == null ? defaultValue : Integer.parseUnsignedInt(value);
}
protected static int parseInt(XmlPullParser xpp, String name, int defaultValue) { protected static int parseInt(XmlPullParser xpp, String name, int defaultValue) {
String value = xpp.getAttributeValue(null, name); String value = xpp.getAttributeValue(null, name);
return value == null ? defaultValue : Integer.parseInt(value); return value == null ? defaultValue : Integer.parseInt(value);