SPAIN TV+ v2.14.8版本的 MD5 值为:fb654ec376ec94e584d29f71bc1f6f4b
以下内容为反编译后的 d.java 源代码,内容仅作参考
package y3;
import a5.y;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
import android.util.Xml;
import com.google.ads.interactivemedia.v3.internal.aen;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import m2.q2;
import m2.u1;
import org.xml.sax.helpers.DefaultHandler;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
import r2.m;
import v4.g0;
import x4.b0;
import x4.c1;
import x4.d1;
import x4.w0;
import x4.x;
import y3.k;
public class d extends DefaultHandler implements g0.a<c> {
private static final Pattern f22887b = Pattern.compile("(\\d+)(?:/(\\d+))?");
private static final Pattern f22888c = Pattern.compile("CC([1-4])=.*");
private static final Pattern f22889d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
private static final int[] f22890e = {-1, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14};
private final XmlPullParserFactory f22891a;
public static final class a {
public final u1 f22892a;
public final y<b> f22893b;
public final k f22894c;
public final String f22895d;
public final ArrayList<m.b> f22896e;
public final ArrayList<e> f22897f;
public final long f22898g;
public final List<e> f22899h;
public final List<e> f22900i;
public a(u1 u1Var, List<b> list, k kVar, String str, ArrayList<m.b> arrayList, ArrayList<e> arrayList2, List<e> list2, List<e> list3, long j8) {
this.f22892a = u1Var;
this.f22893b = y.B(list);
this.f22894c = kVar;
this.f22895d = str;
this.f22896e = arrayList;
this.f22897f = arrayList2;
this.f22899h = list2;
this.f22900i = list3;
this.f22898g = j8;
}
}
public d() {
try {
this.f22891a = XmlPullParserFactory.newInstance();
} catch (XmlPullParserException e8) {
throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e8);
}
}
protected static int D(List<e> list) {
String str;
for (int i8 = 0; i8 < list.size(); i8++) {
e eVar = list.get(i8);
if ("urn:scte:dash:cc:cea-608:2015".equals(eVar.f22901a) && (str = eVar.f22902b) != null) {
Matcher matcher = f22888c.matcher(str);
if (matcher.matches()) {
return Integer.parseInt(matcher.group(1));
}
x.j("MpdParser", "Unable to parse CEA-608 channel number from: " + eVar.f22902b);
}
}
return -1;
}
protected static int E(List<e> list) {
String str;
for (int i8 = 0; i8 < list.size(); i8++) {
e eVar = list.get(i8);
if ("urn:scte:dash:cc:cea-708:2015".equals(eVar.f22901a) && (str = eVar.f22902b) != null) {
Matcher matcher = f22889d.matcher(str);
if (matcher.matches()) {
return Integer.parseInt(matcher.group(1));
}
x.j("MpdParser", "Unable to parse CEA-708 service block number from: " + eVar.f22902b);
}
}
return -1;
}
protected static long H(XmlPullParser xmlPullParser, String str, long j8) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? j8 : c1.R0(attributeValue);
}
protected static e I(XmlPullParser xmlPullParser, String str) {
String r02 = r0(xmlPullParser, "schemeIdUri", "");
String r03 = r0(xmlPullParser, "value", null);
String r04 = r0(xmlPullParser, "id", null);
do {
xmlPullParser.next();
} while (!d1.d(xmlPullParser, str));
return new e(r02, r03, r04);
}
protected static int J(XmlPullParser xmlPullParser) {
char c8;
String attributeValue = xmlPullParser.getAttributeValue(null, "value");
if (attributeValue == null) {
return -1;
}
String e8 = z4.b.e(attributeValue);
e8.hashCode();
switch (e8.hashCode()) {
case 1596796:
if (e8.equals("4000")) {
c8 = 0;
break;
}
c8 = 65535;
break;
case 2937391:
if (e8.equals("a000")) {
c8 = 1;
break;
}
c8 = 65535;
break;
case 3094035:
if (e8.equals("f801")) {
c8 = 2;
break;
}
c8 = 65535;
break;
case 3133436:
if (e8.equals("fa01")) {
c8 = 3;
break;
}
c8 = 65535;
break;
default:
c8 = 65535;
break;
}
switch (c8) {
case 0:
return 1;
case 1:
return 2;
case 2:
return 6;
case 3:
return 8;
default:
return -1;
}
}
protected static int K(XmlPullParser xmlPullParser) {
int U = U(xmlPullParser, "value", -1);
if (U <= 0 || U >= 33) {
return -1;
}
return U;
}
protected static int L(XmlPullParser xmlPullParser) {
int bitCount;
String attributeValue = xmlPullParser.getAttributeValue(null, "value");
if (attributeValue == null || (bitCount = Integer.bitCount(Integer.parseInt(attributeValue, 16))) == 0) {
return -1;
}
return bitCount;
}
protected static long M(XmlPullParser xmlPullParser, String str, long j8) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? j8 : c1.S0(attributeValue);
}
protected static String N(List<e> list) {
for (int i8 = 0; i8 < list.size(); i8++) {
e eVar = list.get(i8);
String str = eVar.f22901a;
if ("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str) && "JOC".equals(eVar.f22902b)) {
return "audio/eac3-joc";
}
if ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str) && "ec+3".equals(eVar.f22902b)) {
return "audio/eac3-joc";
}
}
return "audio/eac3";
}
protected static float R(XmlPullParser xmlPullParser, String str, float f8) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? f8 : Float.parseFloat(attributeValue);
}
protected static float S(XmlPullParser xmlPullParser, float f8) {
String group;
String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate");
if (attributeValue != null) {
Matcher matcher = f22887b.matcher(attributeValue);
if (matcher.matches()) {
int parseInt = Integer.parseInt(matcher.group(1));
float f9 = parseInt;
return !TextUtils.isEmpty(matcher.group(2)) ? f9 / Integer.parseInt(group) : f9;
}
return f8;
}
return f8;
}
protected static int U(XmlPullParser xmlPullParser, String str, int i8) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? i8 : Integer.parseInt(attributeValue);
}
protected static long W(List<e> list) {
for (int i8 = 0; i8 < list.size(); i8++) {
e eVar = list.get(i8);
if (z4.b.a("http://dashif.org/guidelines/last-segment-number", eVar.f22901a)) {
return Long.parseLong(eVar.f22902b);
}
}
return -1L;
}
protected static long X(XmlPullParser xmlPullParser, String str, long j8) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? j8 : Long.parseLong(attributeValue);
}
protected static int Z(XmlPullParser xmlPullParser) {
int U = U(xmlPullParser, "value", -1);
if (U >= 0) {
int[] iArr = f22890e;
if (U < iArr.length) {
return iArr[U];
}
return -1;
}
return -1;
}
private long b(List<k.d> list, long j8, long j9, int i8, long j10) {
int m8 = i8 >= 0 ? i8 + 1 : (int) c1.m(j10 - j8, j9);
for (int i9 = 0; i9 < m8; i9++) {
list.add(m(j8, j9));
j8 += j9;
}
return j8;
}
private static int p(int i8, int i9) {
if (i8 == -1) {
return i9;
}
if (i9 == -1) {
return i8;
}
x4.a.g(i8 == i9);
return i8;
}
private static String q(String str, String str2) {
if (str == null) {
return str2;
}
if (str2 == null) {
return str;
}
x4.a.g(str.equals(str2));
return str;
}
private static void r(ArrayList<m.b> arrayList) {
String str;
int i8 = 0;
while (true) {
if (i8 >= arrayList.size()) {
str = null;
break;
}
m.b bVar = arrayList.get(i8);
if (m2.n.f17690c.equals(bVar.f20516c) && (str = bVar.f20517d) != null) {
arrayList.remove(i8);
break;
}
i8++;
}
if (str == null) {
return;
}
for (int i9 = 0; i9 < arrayList.size(); i9++) {
m.b bVar2 = arrayList.get(i9);
if (m2.n.f17689b.equals(bVar2.f20516c) && bVar2.f20517d == null) {
arrayList.set(i9, new m.b(m2.n.f17690c, str, bVar2.f20518e, bVar2.f20519f));
}
}
}
protected static String r0(XmlPullParser xmlPullParser, String str, String str2) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? str2 : attributeValue;
}
private static void s(ArrayList<m.b> arrayList) {
for (int size = arrayList.size() - 1; size >= 0; size--) {
m.b bVar = arrayList.get(size);
if (!bVar.e()) {
int i8 = 0;
while (true) {
if (i8 >= arrayList.size()) {
break;
} else if (arrayList.get(i8).b(bVar)) {
arrayList.remove(size);
break;
} else {
i8++;
}
}
}
}
}
protected static String s0(XmlPullParser xmlPullParser, String str) {
String str2 = "";
do {
xmlPullParser.next();
if (xmlPullParser.getEventType() == 4) {
str2 = xmlPullParser.getText();
} else {
w(xmlPullParser);
}
} while (!d1.d(xmlPullParser, str));
return str2;
}
private static long t(long j8, long j9) {
if (j9 != -9223372036854775807L) {
j8 = j9;
}
if (j8 == Long.MAX_VALUE) {
return -9223372036854775807L;
}
return j8;
}
private static String u(String str, String str2) {
if (b0.o(str)) {
return b0.c(str2);
}
if (b0.s(str)) {
return b0.n(str2);
}
if (b0.r(str) || b0.p(str)) {
return str;
}
if ("application/mp4".equals(str)) {
String g8 = b0.g(str2);
return "text/vtt".equals(g8) ? "application/x-mp4-vtt" : g8;
}
return null;
}
private boolean v(String[] strArr) {
for (String str : strArr) {
if (str.startsWith("urn:dvb:dash:profile:dvb-dash:")) {
return true;
}
}
return false;
}
public static void w(XmlPullParser xmlPullParser) {
if (d1.e(xmlPullParser)) {
int i8 = 1;
while (i8 != 0) {
xmlPullParser.next();
if (d1.e(xmlPullParser)) {
i8++;
} else if (d1.c(xmlPullParser)) {
i8--;
}
}
}
}
protected int A(XmlPullParser xmlPullParser) {
char c8;
String r02 = r0(xmlPullParser, "schemeIdUri", null);
r02.hashCode();
int i8 = -1;
switch (r02.hashCode()) {
case -2128649360:
if (r02.equals("urn:dts:dash:audio_channel_configuration:2012")) {
c8 = 0;
break;
}
c8 = 65535;
break;
case -1352850286:
if (r02.equals("urn:mpeg:dash:23003:3:audio_channel_configuration:2011")) {
c8 = 1;
break;
}
c8 = 65535;
break;
case -1138141449:
if (r02.equals("tag:dolby.com,2014:dash:audio_channel_configuration:2011")) {
c8 = 2;
break;
}
c8 = 65535;
break;
case -986633423:
if (r02.equals("urn:mpeg:mpegB:cicp:ChannelConfiguration")) {
c8 = 3;
break;
}
c8 = 65535;
break;
case -79006963:
if (r02.equals("tag:dts.com,2014:dash:audio_channel_configuration:2012")) {
c8 = 4;
break;
}
c8 = 65535;
break;
case 312179081:
if (r02.equals("tag:dts.com,2018:uhd:audio_channel_configuration")) {
c8 = 5;
break;
}
c8 = 65535;
break;
case 2036691300:
if (r02.equals("urn:dolby:dash:audio_channel_configuration:2011")) {
c8 = 6;
break;
}
c8 = 65535;
break;
default:
c8 = 65535;
break;
}
switch (c8) {
case 0:
case 4:
i8 = K(xmlPullParser);
break;
case 1:
i8 = U(xmlPullParser, "value", -1);
break;
case 2:
case 6:
i8 = J(xmlPullParser);
break;
case 3:
i8 = Z(xmlPullParser);
break;
case 5:
i8 = L(xmlPullParser);
break;
}
do {
xmlPullParser.next();
} while (!d1.d(xmlPullParser, "AudioChannelConfiguration"));
return i8;
}
protected long B(XmlPullParser xmlPullParser, long j8) {
String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityTimeOffset");
if (attributeValue == null) {
return j8;
}
if ("INF".equals(attributeValue)) {
return Long.MAX_VALUE;
}
return Float.parseFloat(attributeValue) * 1000000.0f;
}
protected List<b> C(XmlPullParser xmlPullParser, List<b> list, boolean z7) {
String attributeValue = xmlPullParser.getAttributeValue(null, "dvb:priority");
int parseInt = attributeValue != null ? Integer.parseInt(attributeValue) : z7 ? 1 : Integer.MIN_VALUE;
String attributeValue2 = xmlPullParser.getAttributeValue(null, "dvb:weight");
int parseInt2 = attributeValue2 != null ? Integer.parseInt(attributeValue2) : 1;
String attributeValue3 = xmlPullParser.getAttributeValue(null, "serviceLocation");
String s02 = s0(xmlPullParser, "BaseURL");
if (w0.b(s02)) {
if (attributeValue3 == null) {
attributeValue3 = s02;
}
return a5.g0.j(new b(s02, attributeValue3, parseInt, parseInt2));
}
ArrayList arrayList = new ArrayList();
for (int i8 = 0; i8 < list.size(); i8++) {
b bVar = list.get(i8);
String d8 = w0.d(bVar.f22870a, s02);
String str = attributeValue3 == null ? d8 : attributeValue3;
if (z7) {
parseInt = bVar.f22872c;
parseInt2 = bVar.f22873d;
str = bVar.f22871b;
}
arrayList.add(new b(d8, str, parseInt, parseInt2));
}
return arrayList;
}
protected Pair<String, m.b> F(XmlPullParser xmlPullParser) {
String str;
UUID uuid;
UUID uuid2;
byte[] bArr;
byte[] bArr2;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue != null) {
String e8 = z4.b.e(attributeValue);
e8.hashCode();
char c8 = 65535;
switch (e8.hashCode()) {
case -1980789791:
if (e8.equals("urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e")) {
c8 = 0;
break;
}
break;
case 489446379:
if (e8.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) {
c8 = 1;
break;
}
break;
case 755418770:
if (e8.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) {
c8 = 2;
break;
}
break;
case 1812765994:
if (e8.equals("urn:mpeg:dash:mp4protection:2011")) {
c8 = 3;
break;
}
break;
}
switch (c8) {
case 0:
uuid = m2.n.f17690c;
str = null;
uuid2 = null;
bArr = uuid2;
bArr2 = uuid2;
break;
case 1:
uuid = m2.n.f17692e;
str = null;
uuid2 = null;
bArr = uuid2;
bArr2 = uuid2;
break;
case 2:
uuid = m2.n.f17691d;
str = null;
uuid2 = null;
bArr = uuid2;
bArr2 = uuid2;
break;
case 3:
str = xmlPullParser.getAttributeValue(null, "value");
String b8 = d1.b(xmlPullParser, "default_KID");
if (!TextUtils.isEmpty(b8) && !"00000000-0000-0000-0000-000000000000".equals(b8)) {
String[] split = b8.split("\\s+");
UUID[] uuidArr = new UUID[split.length];
for (int i8 = 0; i8 < split.length; i8++) {
uuidArr[i8] = UUID.fromString(split[i8]);
}
uuid = m2.n.f17689b;
bArr = null;
bArr2 = f3.l.b(uuid, uuidArr, null);
break;
} else {
uuid = null;
uuid2 = uuid;
bArr = uuid2;
bArr2 = uuid2;
break;
}
break;
}
do {
xmlPullParser.next();
if (!d1.f(xmlPullParser, "clearkey:Laurl") && xmlPullParser.next() == 4) {
bArr = xmlPullParser.getText();
bArr2 = bArr2;
} else if (!d1.f(xmlPullParser, "ms:laurl")) {
bArr = xmlPullParser.getAttributeValue(null, "licenseUrl");
bArr2 = bArr2;
} else if (bArr2 == null && d1.g(xmlPullParser, "pssh") && xmlPullParser.next() == 4) {
byte[] decode = Base64.decode(xmlPullParser.getText(), 0);
UUID f8 = f3.l.f(decode);
if (f8 == null) {
x.j("MpdParser", "Skipping malformed cenc:pssh data");
uuid = f8;
bArr2 = null;
} else {
bArr2 = decode;
uuid = f8;
}
} else {
if (bArr2 == null) {
UUID uuid3 = m2.n.f17692e;
if (uuid3.equals(uuid) && d1.f(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
bArr2 = f3.l.a(uuid3, Base64.decode(xmlPullParser.getText(), 0));
}
}
w(xmlPullParser);
bArr2 = bArr2;
}
} while (!d1.d(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new m.b(uuid, bArr, "video/mp4", bArr2) : null);
}
str = null;
uuid = null;
uuid2 = uuid;
bArr = uuid2;
bArr2 = uuid2;
do {
xmlPullParser.next();
if (!d1.f(xmlPullParser, "clearkey:Laurl")) {
}
if (!d1.f(xmlPullParser, "ms:laurl")) {
}
} while (!d1.d(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new m.b(uuid, bArr, "video/mp4", bArr2) : null);
}
protected int G(XmlPullParser xmlPullParser) {
String attributeValue = xmlPullParser.getAttributeValue(null, "contentType");
if (TextUtils.isEmpty(attributeValue)) {
return -1;
}
if ("audio".equals(attributeValue)) {
return 1;
}
if ("video".equals(attributeValue)) {
return 2;
}
return "text".equals(attributeValue) ? 3 : -1;
}
protected Pair<Long, m3.a> O(XmlPullParser xmlPullParser, String str, String str2, long j8, ByteArrayOutputStream byteArrayOutputStream) {
long X = X(xmlPullParser, "id", 0L);
long X2 = X(xmlPullParser, "duration", -9223372036854775807L);
long X3 = X(xmlPullParser, "presentationTime", 0L);
long X0 = c1.X0(X2, 1000L, j8);
long X02 = c1.X0(X3, 1000000L, j8);
String r02 = r0(xmlPullParser, "messageData", null);
byte[] P = P(xmlPullParser, byteArrayOutputStream);
Long valueOf = Long.valueOf(X02);
if (r02 != null) {
P = c1.q0(r02);
}
return Pair.create(valueOf, d(str, str2, X, X0, P));
}
protected byte[] P(XmlPullParser xmlPullParser, ByteArrayOutputStream byteArrayOutputStream) {
byteArrayOutputStream.reset();
XmlSerializer newSerializer = Xml.newSerializer();
newSerializer.setOutput(byteArrayOutputStream, z4.d.f23228c.name());
while (true) {
xmlPullParser.nextToken();
if (d1.d(xmlPullParser, "Event")) {
newSerializer.flush();
return byteArrayOutputStream.toByteArray();
}
switch (xmlPullParser.getEventType()) {
case 0:
newSerializer.startDocument(null, Boolean.FALSE);
break;
case 1:
newSerializer.endDocument();
break;
case 2:
newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
for (int i8 = 0; i8 < xmlPullParser.getAttributeCount(); i8++) {
newSerializer.attribute(xmlPullParser.getAttributeNamespace(i8), xmlPullParser.getAttributeName(i8), xmlPullParser.getAttributeValue(i8));
}
break;
case 3:
newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
break;
case 4:
newSerializer.text(xmlPullParser.getText());
break;
case 5:
newSerializer.cdsect(xmlPullParser.getText());
break;
case 6:
newSerializer.entityRef(xmlPullParser.getText());
break;
case 7:
newSerializer.ignorableWhitespace(xmlPullParser.getText());
break;
case 8:
newSerializer.processingInstruction(xmlPullParser.getText());
break;
case 9:
newSerializer.comment(xmlPullParser.getText());
break;
case 10:
newSerializer.docdecl(xmlPullParser.getText());
break;
}
}
}
protected f Q(XmlPullParser xmlPullParser) {
String r02 = r0(xmlPullParser, "schemeIdUri", "");
String r03 = r0(xmlPullParser, "value", "");
long X = X(xmlPullParser, "timescale", 1L);
ArrayList arrayList = new ArrayList();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(aen.f5571q);
do {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Event")) {
arrayList.add(O(xmlPullParser, r02, r03, X, byteArrayOutputStream));
} else {
w(xmlPullParser);
}
} while (!d1.d(xmlPullParser, "EventStream"));
long[] jArr = new long[arrayList.size()];
m3.a[] aVarArr = new m3.a[arrayList.size()];
for (int i8 = 0; i8 < arrayList.size(); i8++) {
Pair pair = (Pair) arrayList.get(i8);
jArr[i8] = ((Long) pair.first).longValue();
aVarArr[i8] = (m3.a) pair.second;
}
return e(r02, r03, X, jArr, aVarArr);
}
protected i T(XmlPullParser xmlPullParser) {
return d0(xmlPullParser, "sourceURL", "range");
}
protected String V(XmlPullParser xmlPullParser) {
return s0(xmlPullParser, "Label");
}
protected c Y(XmlPullParser xmlPullParser, Uri uri) {
long j8;
ArrayList arrayList;
ArrayList arrayList2;
long j9;
Throwable th;
ArrayList arrayList3;
long j10;
boolean z7;
long j11;
d dVar = this;
boolean v8 = dVar.v(dVar.b0(xmlPullParser, "profiles", new String[0]));
long j12 = -9223372036854775807L;
long H = H(xmlPullParser, "availabilityStartTime", -9223372036854775807L);
long M = M(xmlPullParser, "mediaPresentationDuration", -9223372036854775807L);
long M2 = M(xmlPullParser, "minBufferTime", -9223372036854775807L);
Throwable th2 = null;
boolean equals = "dynamic".equals(xmlPullParser.getAttributeValue(null, "type"));
long M3 = equals ? M(xmlPullParser, "minimumUpdatePeriod", -9223372036854775807L) : -9223372036854775807L;
long M4 = equals ? M(xmlPullParser, "timeShiftBufferDepth", -9223372036854775807L) : -9223372036854775807L;
long M5 = equals ? M(xmlPullParser, "suggestedPresentationDelay", -9223372036854775807L) : -9223372036854775807L;
long H2 = H(xmlPullParser, "publishTime", -9223372036854775807L);
long j13 = equals ? 0L : -9223372036854775807L;
ArrayList j14 = a5.g0.j(new b(uri.toString(), uri.toString(), v8 ? 1 : Integer.MIN_VALUE, 1));
ArrayList arrayList4 = new ArrayList();
ArrayList arrayList5 = new ArrayList();
long j15 = equals ? -9223372036854775807L : 0L;
h hVar = null;
o oVar = null;
Uri uri2 = null;
l lVar = null;
boolean z8 = false;
boolean z9 = false;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser, "BaseURL")) {
if (!z8) {
j13 = dVar.B(xmlPullParser, j13);
z8 = true;
}
arrayList5.addAll(dVar.C(xmlPullParser, j14, v8));
} else if (d1.f(xmlPullParser, "ProgramInformation")) {
hVar = c0(xmlPullParser);
} else if (d1.f(xmlPullParser, "UTCTiming")) {
oVar = v0(xmlPullParser);
} else if (d1.f(xmlPullParser, "Location")) {
uri2 = w0.e(uri.toString(), xmlPullParser.nextText());
} else if (d1.f(xmlPullParser, "ServiceDescription")) {
lVar = q0(xmlPullParser);
} else {
if (!d1.f(xmlPullParser, "Period") || z9) {
j8 = j13;
arrayList = arrayList5;
arrayList2 = j14;
j9 = j12;
th = th2;
arrayList3 = arrayList4;
w(xmlPullParser);
} else {
j8 = j13;
ArrayList arrayList6 = arrayList4;
arrayList = arrayList5;
arrayList2 = j14;
j9 = j12;
th = th2;
Pair<g, Long> a02 = a0(xmlPullParser, !arrayList5.isEmpty() ? arrayList5 : j14, j15, j8, H, M4, v8);
g gVar = (g) a02.first;
if (gVar.f22910b != j9) {
long longValue = ((Long) a02.second).longValue();
if (longValue == j9) {
arrayList3 = arrayList6;
j10 = j9;
} else {
j10 = gVar.f22910b + longValue;
arrayList3 = arrayList6;
}
arrayList3.add(gVar);
j15 = j10;
z7 = z9;
} else if (!equals) {
throw q2.c("Unable to determine start of period " + arrayList6.size(), th);
} else {
arrayList3 = arrayList6;
z7 = true;
}
z9 = z7;
}
j13 = j8;
if (d1.d(xmlPullParser, "MPD")) {
arrayList4 = arrayList3;
th2 = th;
arrayList5 = arrayList;
j14 = arrayList2;
j12 = j9;
dVar = this;
} else {
if (M == j9) {
if (j15 != j9) {
j11 = j15;
if (arrayList3.isEmpty()) {
return g(H, j11, M2, equals, M3, M4, M5, H2, hVar, oVar, lVar, uri2, arrayList3);
}
throw q2.c("No periods found.", th);
} else if (!equals) {
throw q2.c("Unable to determine duration of static manifest.", th);
}
}
j11 = M;
if (arrayList3.isEmpty()) {
}
}
}
arrayList = arrayList5;
arrayList2 = j14;
j9 = j12;
th = th2;
arrayList3 = arrayList4;
if (d1.d(xmlPullParser, "MPD")) {
}
}
}
protected Pair<g, Long> a0(XmlPullParser xmlPullParser, List<b> list, long j8, long j9, long j10, long j11, boolean z7) {
long j12;
ArrayList arrayList;
ArrayList arrayList2;
ArrayList arrayList3;
Object obj;
long j13;
k l02;
d dVar = this;
XmlPullParser xmlPullParser2 = xmlPullParser;
Object obj2 = null;
String attributeValue = xmlPullParser2.getAttributeValue(null, "id");
long M = M(xmlPullParser2, "start", j8);
long j14 = -9223372036854775807L;
long j15 = j10 != -9223372036854775807L ? j10 + M : -9223372036854775807L;
long M2 = M(xmlPullParser2, "duration", -9223372036854775807L);
ArrayList arrayList4 = new ArrayList();
ArrayList arrayList5 = new ArrayList();
ArrayList arrayList6 = new ArrayList();
long j16 = j9;
long j17 = -9223372036854775807L;
k.e eVar = null;
e eVar2 = null;
boolean z8 = false;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser2, "BaseURL")) {
if (!z8) {
j16 = dVar.B(xmlPullParser2, j16);
z8 = true;
}
arrayList6.addAll(dVar.C(xmlPullParser2, list, z7));
arrayList3 = arrayList5;
arrayList = arrayList6;
j13 = j14;
obj = obj2;
arrayList2 = arrayList4;
} else {
if (d1.f(xmlPullParser2, "AdaptationSet")) {
j12 = j16;
arrayList = arrayList6;
arrayList2 = arrayList4;
arrayList2.add(y(xmlPullParser, !arrayList6.isEmpty() ? arrayList6 : list, eVar, M2, j16, j17, j15, j11, z7));
xmlPullParser2 = xmlPullParser;
arrayList3 = arrayList5;
} else {
j12 = j16;
ArrayList arrayList7 = arrayList5;
arrayList = arrayList6;
arrayList2 = arrayList4;
xmlPullParser2 = xmlPullParser;
if (d1.f(xmlPullParser2, "EventStream")) {
arrayList7.add(Q(xmlPullParser));
arrayList3 = arrayList7;
} else {
arrayList3 = arrayList7;
if (d1.f(xmlPullParser2, "SegmentBase")) {
eVar = j0(xmlPullParser2, null);
obj = null;
j16 = j12;
j13 = -9223372036854775807L;
} else {
if (d1.f(xmlPullParser2, "SegmentList")) {
long B = B(xmlPullParser2, -9223372036854775807L);
obj = null;
l02 = k0(xmlPullParser, null, j15, M2, j12, B, j11);
j17 = B;
j16 = j12;
j13 = -9223372036854775807L;
} else {
obj = null;
if (d1.f(xmlPullParser2, "SegmentTemplate")) {
long B2 = B(xmlPullParser2, -9223372036854775807L);
j13 = -9223372036854775807L;
l02 = l0(xmlPullParser, null, y.H(), j15, M2, j12, B2, j11);
j17 = B2;
j16 = j12;
} else {
j13 = -9223372036854775807L;
if (d1.f(xmlPullParser2, "AssetIdentifier")) {
eVar2 = I(xmlPullParser2, "AssetIdentifier");
} else {
w(xmlPullParser);
}
j16 = j12;
}
}
eVar = l02;
}
}
}
obj = null;
j13 = -9223372036854775807L;
j16 = j12;
}
if (d1.d(xmlPullParser2, "Period")) {
return Pair.create(h(attributeValue, M, arrayList2, arrayList3, eVar2), Long.valueOf(M2));
}
arrayList4 = arrayList2;
arrayList6 = arrayList;
obj2 = obj;
arrayList5 = arrayList3;
j14 = j13;
dVar = this;
}
}
protected String[] b0(XmlPullParser xmlPullParser, String str, String[] strArr) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? strArr : attributeValue.split(",");
}
protected y3.a c(int i8, int i9, List<j> list, List<e> list2, List<e> list3, List<e> list4) {
return new y3.a(i8, i9, list, list2, list3, list4);
}
protected h c0(XmlPullParser xmlPullParser) {
String str = null;
String r02 = r0(xmlPullParser, "moreInformationURL", null);
String r03 = r0(xmlPullParser, "lang", null);
String str2 = null;
String str3 = null;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Title")) {
str = xmlPullParser.nextText();
} else if (d1.f(xmlPullParser, "Source")) {
str2 = xmlPullParser.nextText();
} else if (d1.f(xmlPullParser, "Copyright")) {
str3 = xmlPullParser.nextText();
} else {
w(xmlPullParser);
}
String str4 = str3;
if (d1.d(xmlPullParser, "ProgramInformation")) {
return new h(str, str2, str4, r02, r03);
}
str3 = str4;
}
}
protected m3.a d(String str, String str2, long j8, long j9, byte[] bArr) {
return new m3.a(str, str2, j9, j8, bArr);
}
protected i d0(XmlPullParser xmlPullParser, String str, String str2) {
long j8;
long j9;
String attributeValue = xmlPullParser.getAttributeValue(null, str);
String attributeValue2 = xmlPullParser.getAttributeValue(null, str2);
if (attributeValue2 != null) {
String[] split = attributeValue2.split("-");
j8 = Long.parseLong(split[0]);
if (split.length == 2) {
j9 = (Long.parseLong(split[1]) - j8) + 1;
return i(attributeValue, j8, j9);
}
} else {
j8 = 0;
}
j9 = -1;
return i(attributeValue, j8, j9);
}
protected f e(String str, String str2, long j8, long[] jArr, m3.a[] aVarArr) {
return new f(str, str2, j8, jArr, aVarArr);
}
protected a e0(XmlPullParser xmlPullParser, List<b> list, String str, String str2, int i8, int i9, float f8, int i10, int i11, String str3, List<e> list2, List<e> list3, List<e> list4, List<e> list5, k kVar, long j8, long j9, long j10, long j11, long j12, boolean z7) {
long j13;
ArrayList arrayList;
ArrayList arrayList2;
ArrayList arrayList3;
ArrayList arrayList4;
ArrayList arrayList5;
ArrayList arrayList6;
ArrayList arrayList7;
int i12;
long B;
k kVar2;
d dVar = this;
String attributeValue = xmlPullParser.getAttributeValue(null, "id");
int U = U(xmlPullParser, "bandwidth", -1);
String r02 = r0(xmlPullParser, "mimeType", str);
String r03 = r0(xmlPullParser, "codecs", str2);
int U2 = U(xmlPullParser, "width", i8);
int U3 = U(xmlPullParser, "height", i9);
float S = S(xmlPullParser, f8);
int U4 = U(xmlPullParser, "audioSamplingRate", i11);
ArrayList arrayList8 = new ArrayList();
ArrayList arrayList9 = new ArrayList();
ArrayList arrayList10 = new ArrayList(list4);
ArrayList arrayList11 = new ArrayList(list5);
ArrayList arrayList12 = new ArrayList();
int i13 = i10;
k kVar3 = kVar;
long j14 = j10;
String str4 = null;
boolean z8 = false;
long j15 = j11;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser, "BaseURL")) {
if (!z8) {
j14 = dVar.B(xmlPullParser, j14);
z8 = true;
}
arrayList12.addAll(dVar.C(xmlPullParser, list, z7));
} else if (d1.f(xmlPullParser, "AudioChannelConfiguration")) {
kVar2 = kVar3;
arrayList = arrayList12;
arrayList5 = arrayList8;
i12 = A(xmlPullParser);
arrayList6 = arrayList9;
arrayList7 = arrayList11;
if (d1.d(xmlPullParser, "Representation")) {
break;
}
arrayList11 = arrayList7;
arrayList9 = arrayList6;
arrayList8 = arrayList5;
kVar3 = kVar2;
dVar = this;
i13 = i12;
arrayList12 = arrayList;
} else if (d1.f(xmlPullParser, "SegmentBase")) {
kVar3 = dVar.j0(xmlPullParser, (k.e) kVar3);
} else {
if (d1.f(xmlPullParser, "SegmentList")) {
B = dVar.B(xmlPullParser, j15);
j13 = j14;
arrayList = arrayList12;
arrayList2 = arrayList11;
arrayList3 = arrayList9;
arrayList4 = arrayList10;
kVar3 = k0(xmlPullParser, (k.b) kVar3, j8, j9, j13, B, j12);
arrayList5 = arrayList8;
} else {
j13 = j14;
arrayList = arrayList12;
arrayList2 = arrayList11;
arrayList3 = arrayList9;
arrayList4 = arrayList10;
if (d1.f(xmlPullParser, "SegmentTemplate")) {
B = dVar.B(xmlPullParser, j15);
arrayList5 = arrayList8;
kVar3 = l0(xmlPullParser, (k.c) kVar3, list5, j8, j9, j13, B, j12);
} else {
arrayList5 = arrayList8;
if (d1.f(xmlPullParser, "ContentProtection")) {
Pair<String, m.b> F = F(xmlPullParser);
Object obj = F.first;
if (obj != null) {
str4 = (String) obj;
}
Object obj2 = F.second;
if (obj2 != null) {
arrayList5.add((m.b) obj2);
}
i12 = i13;
j14 = j13;
arrayList7 = arrayList2;
arrayList6 = arrayList3;
arrayList10 = arrayList4;
kVar2 = kVar3;
if (d1.d(xmlPullParser, "Representation")) {
}
} else {
if (d1.f(xmlPullParser, "InbandEventStream")) {
arrayList6 = arrayList3;
arrayList6.add(I(xmlPullParser, "InbandEventStream"));
arrayList7 = arrayList2;
arrayList10 = arrayList4;
} else {
arrayList6 = arrayList3;
if (d1.f(xmlPullParser, "EssentialProperty")) {
arrayList10 = arrayList4;
arrayList10.add(I(xmlPullParser, "EssentialProperty"));
arrayList7 = arrayList2;
} else {
arrayList10 = arrayList4;
if (d1.f(xmlPullParser, "SupplementalProperty")) {
arrayList7 = arrayList2;
arrayList7.add(I(xmlPullParser, "SupplementalProperty"));
} else {
arrayList7 = arrayList2;
w(xmlPullParser);
}
}
}
i12 = i13;
j14 = j13;
kVar2 = kVar3;
if (d1.d(xmlPullParser, "Representation")) {
}
}
}
}
i12 = i13;
j15 = B;
j14 = j13;
arrayList7 = arrayList2;
arrayList6 = arrayList3;
arrayList10 = arrayList4;
kVar2 = kVar3;
if (d1.d(xmlPullParser, "Representation")) {
}
}
arrayList = arrayList12;
arrayList5 = arrayList8;
i12 = i13;
kVar2 = kVar3;
arrayList6 = arrayList9;
arrayList7 = arrayList11;
if (d1.d(xmlPullParser, "Representation")) {
}
}
ArrayList arrayList13 = arrayList7;
ArrayList arrayList14 = arrayList10;
ArrayList arrayList15 = arrayList6;
u1 f9 = f(attributeValue, r02, U2, U3, S, i12, U4, U, str3, list2, list3, r03, arrayList14, arrayList13);
k.e eVar = kVar2;
if (kVar2 == null) {
eVar = new k.e();
}
boolean isEmpty = arrayList.isEmpty();
ArrayList arrayList16 = arrayList;
if (isEmpty) {
arrayList16 = list;
}
return new a(f9, arrayList16, eVar, str4, arrayList5, arrayList15, arrayList14, arrayList13, -1L);
}
protected u1 f(String str, String str2, int i8, int i9, float f8, int i10, int i11, int i12, String str3, List<e> list, List<e> list2, String str4, List<e> list3, List<e> list4) {
String str5 = str4;
String u8 = u(str2, str5);
if ("audio/eac3".equals(u8)) {
u8 = N(list4);
if ("audio/eac3-joc".equals(u8)) {
str5 = "ec+3";
}
}
u1.b V = new u1.b().S(str).K(str2).e0(u8).I(str5).Z(i12).g0(p0(list)).c0(i0(list) | f0(list2) | h0(list3) | h0(list4)).V(str3);
if (b0.s(u8)) {
V.j0(i8).Q(i9).P(f8);
} else if (b0.o(u8)) {
V.H(i10).f0(i11);
} else if (b0.r(u8)) {
V.F("application/cea-608".equals(u8) ? D(list2) : "application/cea-708".equals(u8) ? E(list2) : -1);
} else if (b0.p(u8)) {
V.j0(i8).Q(i9);
}
return V.E();
}
protected int f0(List<e> list) {
int t02;
int i8 = 0;
for (int i9 = 0; i9 < list.size(); i9++) {
e eVar = list.get(i9);
if (z4.b.a("urn:mpeg:dash:role:2011", eVar.f22901a)) {
t02 = g0(eVar.f22902b);
} else if (z4.b.a("urn:tva:metadata:cs:AudioPurposeCS:2007", eVar.f22901a)) {
t02 = t0(eVar.f22902b);
}
i8 |= t02;
}
return i8;
}
protected c g(long j8, long j9, long j10, boolean z7, long j11, long j12, long j13, long j14, h hVar, o oVar, l lVar, Uri uri, List<g> list) {
return new c(j8, j9, j10, z7, j11, j12, j13, j14, hVar, oVar, lVar, uri, list);
}
protected int g0(String str) {
if (str == null) {
return 0;
}
char c8 = 65535;
switch (str.hashCode()) {
case -2060497896:
if (str.equals("subtitle")) {
c8 = 0;
break;
}
break;
case -1724546052:
if (str.equals("description")) {
c8 = 1;
break;
}
break;
case -1580883024:
if (str.equals("enhanced-audio-intelligibility")) {
c8 = 2;
break;
}
break;
case -1574842690:
if (str.equals("forced_subtitle")) {
c8 = 3;
break;
}
break;
case -1408024454:
if (str.equals("alternate")) {
c8 = 4;
break;
}
break;
case -1396432756:
if (str.equals("forced-subtitle")) {
c8 = 5;
break;
}
break;
case 99825:
if (str.equals("dub")) {
c8 = 6;
break;
}
break;
case 3343801:
if (str.equals("main")) {
c8 = 7;
break;
}
break;
case 3530173:
if (str.equals("sign")) {
c8 = '\b';
break;
}
break;
case 552573414:
if (str.equals("caption")) {
c8 = '\t';
break;
}
break;
case 899152809:
if (str.equals("commentary")) {
c8 = '\n';
break;
}
break;
case 1629013393:
if (str.equals("emergency")) {
c8 = 11;
break;
}
break;
case 1855372047:
if (str.equals("supplementary")) {
c8 = '\f';
break;
}
break;
}
switch (c8) {
case 0:
case 3:
case 5:
return 128;
case 1:
return aen.f5571q;
case 2:
return aen.f5573s;
case 4:
return 2;
case 6:
return 16;
case 7:
return 1;
case '\b':
return 256;
case '\t':
return 64;
case '\n':
return 8;
case 11:
return 32;
case '\f':
return 4;
default:
return 0;
}
}
protected g h(String str, long j8, List<y3.a> list, List<f> list2, e eVar) {
return new g(str, j8, list, list2, eVar);
}
protected int h0(List<e> list) {
int i8 = 0;
for (int i9 = 0; i9 < list.size(); i9++) {
if (z4.b.a("http://dashif.org/guidelines/trickmode", list.get(i9).f22901a)) {
i8 |= aen.f5576v;
}
}
return i8;
}
protected i i(String str, long j8, long j9) {
return new i(str, j8, j9);
}
protected int i0(List<e> list) {
int i8 = 0;
for (int i9 = 0; i9 < list.size(); i9++) {
e eVar = list.get(i9);
if (z4.b.a("urn:mpeg:dash:role:2011", eVar.f22901a)) {
i8 |= g0(eVar.f22902b);
}
}
return i8;
}
protected j j(a aVar, String str, String str2, ArrayList<m.b> arrayList, ArrayList<e> arrayList2) {
u1.b c8 = aVar.f22892a.c();
if (str != null) {
c8.U(str);
}
String str3 = aVar.f22895d;
if (str3 != null) {
str2 = str3;
}
ArrayList<m.b> arrayList3 = aVar.f22896e;
arrayList3.addAll(arrayList);
if (!arrayList3.isEmpty()) {
r(arrayList3);
s(arrayList3);
c8.M(new r2.m(str2, arrayList3));
}
ArrayList<e> arrayList4 = aVar.f22897f;
arrayList4.addAll(arrayList2);
return j.o(aVar.f22898g, c8.E(), aVar.f22893b, aVar.f22894c, arrayList4, aVar.f22899h, aVar.f22900i, null);
}
protected k.e j0(XmlPullParser xmlPullParser, k.e eVar) {
long j8;
long j9;
long X = X(xmlPullParser, "timescale", eVar != null ? eVar.f22938b : 1L);
long X2 = X(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.f22939c : 0L);
long j10 = eVar != null ? eVar.f22952d : 0L;
long j11 = eVar != null ? eVar.f22953e : 0L;
String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
if (attributeValue != null) {
String[] split = attributeValue.split("-");
j9 = Long.parseLong(split[0]);
j8 = (Long.parseLong(split[1]) - j9) + 1;
} else {
j8 = j11;
j9 = j10;
}
i iVar = eVar != null ? eVar.f22937a : null;
do {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Initialization")) {
iVar = T(xmlPullParser);
} else {
w(xmlPullParser);
}
} while (!d1.d(xmlPullParser, "SegmentBase"));
return n(iVar, X, X2, j9, j8);
}
protected k.b k(i iVar, long j8, long j9, long j10, long j11, List<k.d> list, long j12, List<i> list2, long j13, long j14) {
return new k.b(iVar, j8, j9, j10, j11, list, j12, list2, c1.K0(j13), c1.K0(j14));
}
protected k.b k0(XmlPullParser xmlPullParser, k.b bVar, long j8, long j9, long j10, long j11, long j12) {
long X = X(xmlPullParser, "timescale", bVar != null ? bVar.f22938b : 1L);
long X2 = X(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.f22939c : 0L);
long X3 = X(xmlPullParser, "duration", bVar != null ? bVar.f22941e : -9223372036854775807L);
long X4 = X(xmlPullParser, "startNumber", bVar != null ? bVar.f22940d : 1L);
long t8 = t(j10, j11);
List<k.d> list = null;
List<i> list2 = null;
i iVar = null;
do {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Initialization")) {
iVar = T(xmlPullParser);
} else if (d1.f(xmlPullParser, "SegmentTimeline")) {
list = m0(xmlPullParser, X, j9);
} else if (d1.f(xmlPullParser, "SegmentURL")) {
if (list2 == null) {
list2 = new ArrayList<>();
}
list2.add(n0(xmlPullParser));
} else {
w(xmlPullParser);
}
} while (!d1.d(xmlPullParser, "SegmentList"));
if (bVar != null) {
if (iVar == null) {
iVar = bVar.f22937a;
}
if (list == null) {
list = bVar.f22942f;
}
if (list2 == null) {
list2 = bVar.f22946j;
}
}
return k(iVar, X, X2, X4, X3, list, t8, list2, j12, j8);
}
protected k.c l(i iVar, long j8, long j9, long j10, long j11, long j12, List<k.d> list, long j13, n nVar, n nVar2, long j14, long j15) {
return new k.c(iVar, j8, j9, j10, j11, j12, list, j13, nVar, nVar2, c1.K0(j14), c1.K0(j15));
}
protected k.c l0(XmlPullParser xmlPullParser, k.c cVar, List<e> list, long j8, long j9, long j10, long j11, long j12) {
long X = X(xmlPullParser, "timescale", cVar != null ? cVar.f22938b : 1L);
long X2 = X(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.f22939c : 0L);
long X3 = X(xmlPullParser, "duration", cVar != null ? cVar.f22941e : -9223372036854775807L);
long X4 = X(xmlPullParser, "startNumber", cVar != null ? cVar.f22940d : 1L);
long W = W(list);
long t8 = t(j10, j11);
List<k.d> list2 = null;
n u02 = u0(xmlPullParser, "media", cVar != null ? cVar.f22948k : null);
n u03 = u0(xmlPullParser, "initialization", cVar != null ? cVar.f22947j : null);
i iVar = null;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Initialization")) {
iVar = T(xmlPullParser);
} else if (d1.f(xmlPullParser, "SegmentTimeline")) {
list2 = m0(xmlPullParser, X, j9);
} else {
w(xmlPullParser);
}
if (d1.d(xmlPullParser, "SegmentTemplate")) {
break;
}
}
if (cVar != null) {
if (iVar == null) {
iVar = cVar.f22937a;
}
if (list2 == null) {
list2 = cVar.f22942f;
}
}
return l(iVar, X, X2, X4, W, X3, list2, t8, u03, u02, j12, j8);
}
protected k.d m(long j8, long j9) {
return new k.d(j8, j9);
}
protected List<k.d> m0(XmlPullParser xmlPullParser, long j8, long j9) {
ArrayList arrayList = new ArrayList();
long j10 = 0;
long j11 = -9223372036854775807L;
boolean z7 = false;
int i8 = 0;
do {
xmlPullParser.next();
if (d1.f(xmlPullParser, "S")) {
long X = X(xmlPullParser, "t", -9223372036854775807L);
if (z7) {
j10 = b(arrayList, j10, j11, i8, X);
}
if (X == -9223372036854775807L) {
X = j10;
}
j11 = X(xmlPullParser, "d", -9223372036854775807L);
i8 = U(xmlPullParser, "r", 0);
j10 = X;
z7 = true;
} else {
w(xmlPullParser);
}
} while (!d1.d(xmlPullParser, "SegmentTimeline"));
if (z7) {
b(arrayList, j10, j11, i8, c1.X0(j9, j8, 1000L));
}
return arrayList;
}
protected k.e n(i iVar, long j8, long j9, long j10, long j11) {
return new k.e(iVar, j8, j9, j10, j11);
}
protected i n0(XmlPullParser xmlPullParser) {
return d0(xmlPullParser, "media", "mediaRange");
}
protected o o(String str, String str2) {
return new o(str, str2);
}
protected int o0(String str) {
if (str == null) {
return 0;
}
return (str.equals("forced_subtitle") || str.equals("forced-subtitle")) ? 2 : 0;
}
protected int p0(List<e> list) {
int i8 = 0;
for (int i9 = 0; i9 < list.size(); i9++) {
e eVar = list.get(i9);
if (z4.b.a("urn:mpeg:dash:role:2011", eVar.f22901a)) {
i8 |= o0(eVar.f22902b);
}
}
return i8;
}
protected l q0(XmlPullParser xmlPullParser) {
long j8 = -9223372036854775807L;
long j9 = -9223372036854775807L;
long j10 = -9223372036854775807L;
float f8 = -3.4028235E38f;
float f9 = -3.4028235E38f;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser, "Latency")) {
j8 = X(xmlPullParser, "target", -9223372036854775807L);
j9 = X(xmlPullParser, "min", -9223372036854775807L);
j10 = X(xmlPullParser, "max", -9223372036854775807L);
} else if (d1.f(xmlPullParser, "PlaybackRate")) {
f8 = R(xmlPullParser, "min", -3.4028235E38f);
f9 = R(xmlPullParser, "max", -3.4028235E38f);
}
long j11 = j8;
long j12 = j9;
long j13 = j10;
float f10 = f8;
float f11 = f9;
if (d1.d(xmlPullParser, "ServiceDescription")) {
return new l(j11, j12, j13, f10, f11);
}
j8 = j11;
j9 = j12;
j10 = j13;
f8 = f10;
f9 = f11;
}
}
protected int t0(String str) {
if (str == null) {
return 0;
}
char c8 = 65535;
switch (str.hashCode()) {
case 49:
if (str.equals("1")) {
c8 = 0;
break;
}
break;
case 50:
if (str.equals("2")) {
c8 = 1;
break;
}
break;
case 51:
if (str.equals("3")) {
c8 = 2;
break;
}
break;
case 52:
if (str.equals("4")) {
c8 = 3;
break;
}
break;
case 54:
if (str.equals("6")) {
c8 = 4;
break;
}
break;
}
switch (c8) {
case 0:
return aen.f5571q;
case 1:
return aen.f5573s;
case 2:
return 4;
case 3:
return 8;
case 4:
return 1;
default:
return 0;
}
}
protected n u0(XmlPullParser xmlPullParser, String str, n nVar) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue != null ? n.b(attributeValue) : nVar;
}
protected o v0(XmlPullParser xmlPullParser) {
return o(xmlPullParser.getAttributeValue(null, "schemeIdUri"), xmlPullParser.getAttributeValue(null, "value"));
}
@Override
public c a(Uri uri, InputStream inputStream) {
try {
XmlPullParser newPullParser = this.f22891a.newPullParser();
newPullParser.setInput(inputStream, null);
if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
return Y(newPullParser, uri);
}
throw q2.c("inputStream does not contain a valid media presentation description", null);
} catch (XmlPullParserException e8) {
throw q2.c(null, e8);
}
}
protected y3.a y(XmlPullParser xmlPullParser, List<b> list, k kVar, long j8, long j9, long j10, long j11, long j12, boolean z7) {
long j13;
ArrayList<e> arrayList;
Object obj;
long j14;
ArrayList arrayList2;
ArrayList arrayList3;
ArrayList arrayList4;
ArrayList arrayList5;
ArrayList arrayList6;
ArrayList<m.b> arrayList7;
String str;
String str2;
ArrayList arrayList8;
int i8;
ArrayList<e> arrayList9;
long B;
d dVar = this;
XmlPullParser xmlPullParser2 = xmlPullParser;
int U = U(xmlPullParser2, "id", -1);
int G = G(xmlPullParser);
String attributeValue = xmlPullParser2.getAttributeValue(null, "mimeType");
String attributeValue2 = xmlPullParser2.getAttributeValue(null, "codecs");
int U2 = U(xmlPullParser2, "width", -1);
int U3 = U(xmlPullParser2, "height", -1);
float S = S(xmlPullParser2, -1.0f);
int U4 = U(xmlPullParser2, "audioSamplingRate", -1);
String str3 = "lang";
String attributeValue3 = xmlPullParser2.getAttributeValue(null, "lang");
String attributeValue4 = xmlPullParser2.getAttributeValue(null, "label");
ArrayList<m.b> arrayList10 = new ArrayList<>();
ArrayList<e> arrayList11 = new ArrayList<>();
ArrayList arrayList12 = new ArrayList();
ArrayList arrayList13 = new ArrayList();
ArrayList arrayList14 = new ArrayList();
ArrayList arrayList15 = new ArrayList();
ArrayList arrayList16 = new ArrayList();
ArrayList arrayList17 = new ArrayList();
k.e eVar = kVar;
int i9 = G;
String str4 = attributeValue3;
String str5 = attributeValue4;
String str6 = null;
int i10 = -1;
boolean z8 = false;
long j15 = j9;
long j16 = j10;
while (true) {
xmlPullParser.next();
if (d1.f(xmlPullParser2, "BaseURL")) {
if (!z8) {
j15 = dVar.B(xmlPullParser2, j15);
z8 = true;
}
j13 = j16;
arrayList = arrayList11;
arrayList17.addAll(dVar.C(xmlPullParser2, list, z7));
} else {
j13 = j16;
arrayList = arrayList11;
if (d1.f(xmlPullParser2, "ContentProtection")) {
Pair<String, m.b> F = F(xmlPullParser);
Object obj2 = F.first;
if (obj2 != null) {
str6 = (String) obj2;
}
Object obj3 = F.second;
if (obj3 != null) {
arrayList10.add((m.b) obj3);
}
} else {
if (d1.f(xmlPullParser2, "ContentComponent")) {
str2 = q(str4, xmlPullParser2.getAttributeValue(null, str3));
obj = null;
j14 = j15;
arrayList2 = arrayList17;
arrayList8 = arrayList16;
arrayList3 = arrayList15;
arrayList4 = arrayList14;
arrayList5 = arrayList13;
arrayList6 = arrayList12;
arrayList7 = arrayList10;
str = str3;
i8 = p(i9, G(xmlPullParser));
arrayList9 = arrayList;
} else {
int i11 = i9;
String str7 = str4;
if (d1.f(xmlPullParser2, "Role")) {
arrayList13.add(I(xmlPullParser2, "Role"));
} else if (d1.f(xmlPullParser2, "AudioChannelConfiguration")) {
i10 = A(xmlPullParser);
} else if (d1.f(xmlPullParser2, "Accessibility")) {
arrayList12.add(I(xmlPullParser2, "Accessibility"));
} else if (d1.f(xmlPullParser2, "EssentialProperty")) {
arrayList14.add(I(xmlPullParser2, "EssentialProperty"));
} else if (d1.f(xmlPullParser2, "SupplementalProperty")) {
arrayList15.add(I(xmlPullParser2, "SupplementalProperty"));
} else if (d1.f(xmlPullParser2, "Representation")) {
j14 = j15;
arrayList2 = arrayList17;
arrayList3 = arrayList15;
arrayList4 = arrayList14;
arrayList5 = arrayList13;
arrayList6 = arrayList12;
arrayList7 = arrayList10;
str = str3;
obj = null;
str2 = str7;
a e02 = e0(xmlPullParser, !arrayList17.isEmpty() ? arrayList17 : list, attributeValue, attributeValue2, U2, U3, S, i10, U4, str7, arrayList5, arrayList6, arrayList4, arrayList3, eVar, j11, j8, j14, j13, j12, z7);
int p8 = p(i11, b0.k(e02.f22892a.f17876m));
arrayList8 = arrayList16;
arrayList8.add(e02);
xmlPullParser2 = xmlPullParser;
i8 = p8;
arrayList9 = arrayList;
} else {
obj = null;
j14 = j15;
arrayList2 = arrayList17;
arrayList3 = arrayList15;
arrayList4 = arrayList14;
arrayList5 = arrayList13;
arrayList6 = arrayList12;
arrayList7 = arrayList10;
str = str3;
str2 = str7;
arrayList8 = arrayList16;
if (d1.f(xmlPullParser, "SegmentBase")) {
eVar = j0(xmlPullParser, (k.e) eVar);
i8 = i11;
arrayList9 = arrayList;
j16 = j13;
xmlPullParser2 = xmlPullParser;
} else {
if (d1.f(xmlPullParser, "SegmentList")) {
B = B(xmlPullParser, j13);
i8 = i11;
eVar = k0(xmlPullParser, (k.b) eVar, j11, j8, j14, B, j12);
xmlPullParser2 = xmlPullParser;
} else {
j16 = j13;
i8 = i11;
if (d1.f(xmlPullParser, "SegmentTemplate")) {
B = B(xmlPullParser, j16);
xmlPullParser2 = xmlPullParser;
eVar = l0(xmlPullParser, (k.c) eVar, arrayList3, j11, j8, j14, B, j12);
} else {
xmlPullParser2 = xmlPullParser;
if (d1.f(xmlPullParser2, "InbandEventStream")) {
arrayList9 = arrayList;
arrayList9.add(I(xmlPullParser2, "InbandEventStream"));
} else {
arrayList9 = arrayList;
if (d1.f(xmlPullParser2, "Label")) {
str5 = V(xmlPullParser);
} else if (d1.e(xmlPullParser)) {
z(xmlPullParser);
}
}
}
}
j16 = B;
arrayList9 = arrayList;
}
if (!d1.d(xmlPullParser2, "AdaptationSet")) {
break;
}
arrayList11 = arrayList9;
arrayList16 = arrayList8;
arrayList17 = arrayList2;
arrayList15 = arrayList3;
j15 = j14;
arrayList14 = arrayList4;
arrayList13 = arrayList5;
arrayList12 = arrayList6;
arrayList10 = arrayList7;
str3 = str;
i9 = i8;
str4 = str2;
dVar = this;
}
obj = null;
j14 = j15;
arrayList2 = arrayList17;
arrayList3 = arrayList15;
arrayList4 = arrayList14;
arrayList5 = arrayList13;
arrayList6 = arrayList12;
arrayList7 = arrayList10;
str = str3;
i8 = i11;
str2 = str7;
arrayList9 = arrayList;
j16 = j13;
arrayList8 = arrayList16;
if (!d1.d(xmlPullParser2, "AdaptationSet")) {
}
}
j16 = j13;
if (!d1.d(xmlPullParser2, "AdaptationSet")) {
}
}
}
j16 = j13;
j14 = j15;
arrayList8 = arrayList16;
arrayList4 = arrayList14;
arrayList5 = arrayList13;
arrayList6 = arrayList12;
arrayList7 = arrayList10;
str = str3;
arrayList9 = arrayList;
i8 = i9;
str2 = str4;
obj = null;
arrayList2 = arrayList17;
arrayList3 = arrayList15;
if (!d1.d(xmlPullParser2, "AdaptationSet")) {
}
}
ArrayList arrayList18 = new ArrayList(arrayList8.size());
for (int i12 = 0; i12 < arrayList8.size(); i12++) {
arrayList18.add(j((a) arrayList8.get(i12), str5, str6, arrayList7, arrayList9));
}
return c(U, i8, arrayList18, arrayList6, arrayList4, arrayList3);
}
protected void z(XmlPullParser xmlPullParser) {
w(xmlPullParser);
}
}