Brazzers Premium v2.1.5版本的 MD5 值为:822198ebc1561433ac78052c8b72a0ea
以下内容为反编译后的 e.java 源代码,内容仅作参考
package m5;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.util.Pair;
import android.util.Xml;
import com.davemorrissey.labs.subscaleview.BuildConfig;
import d6.p0;
import e6.n0;
import e6.u;
import g4.b1;
import g4.i0;
import g4.j0;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import l4.o0;
import m4.v;
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 v8.l0;
import v8.x0;
import v8.y;
public class e extends DefaultHandler implements p0.a {
public static final Pattern A = Pattern.compile("(\\d+)(?:/(\\d+))?");
public static final Pattern B = Pattern.compile("CC([1-4])=.*");
public static final Pattern C = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
public static final int[] D = {-1, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14};
public final XmlPullParserFactory f7485z;
public e() {
try {
this.f7485z = XmlPullParserFactory.newInstance();
} catch (XmlPullParserException e10) {
throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e10);
}
}
public static int b(int i10, int i11) {
if (i10 == -1) {
return i11;
}
if (i11 == -1) {
return i10;
}
e6.a.d(i10 == i11);
return i10;
}
public static long c(long j10, long j11) {
if (j11 != -9223372036854775807L) {
j10 = j11;
}
if (j10 == Long.MAX_VALUE) {
return -9223372036854775807L;
}
return j10;
}
public static void d(XmlPullParser xmlPullParser) {
if (e6.h.h(xmlPullParser)) {
int i10 = 1;
while (i10 != 0) {
xmlPullParser.next();
if (e6.h.h(xmlPullParser)) {
i10++;
} else {
if (xmlPullParser.getEventType() == 3) {
i10--;
}
}
}
}
}
public static f j(XmlPullParser xmlPullParser, String str) {
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue == null) {
attributeValue = BuildConfig.FLAVOR;
}
String attributeValue2 = xmlPullParser.getAttributeValue(null, "value");
if (attributeValue2 == null) {
attributeValue2 = null;
}
String attributeValue3 = xmlPullParser.getAttributeValue(null, "id");
String str2 = attributeValue3 != null ? attributeValue3 : null;
do {
xmlPullParser.next();
} while (!e6.h.g(xmlPullParser, str));
return new f(attributeValue, attributeValue2, str2);
}
public static long k(XmlPullParser xmlPullParser, String str, long j10) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
if (attributeValue == null) {
return j10;
}
Matcher matcher = n0.f4104h.matcher(attributeValue);
if (matcher.matches()) {
boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1));
String group = matcher.group(3);
double parseDouble = group != null ? Double.parseDouble(group) * 3.1556908E7d : 0.0d;
String group2 = matcher.group(5);
double parseDouble2 = parseDouble + (group2 != null ? Double.parseDouble(group2) * 2629739.0d : 0.0d);
String group3 = matcher.group(7);
double parseDouble3 = parseDouble2 + (group3 != null ? Double.parseDouble(group3) * 86400.0d : 0.0d);
String group4 = matcher.group(10);
double parseDouble4 = parseDouble3 + (group4 != null ? Double.parseDouble(group4) * 3600.0d : 0.0d);
String group5 = matcher.group(12);
double parseDouble5 = parseDouble4 + (group5 != null ? Double.parseDouble(group5) * 60.0d : 0.0d);
String group6 = matcher.group(14);
long parseDouble6 = (long) ((parseDouble5 + (group6 != null ? Double.parseDouble(group6) : 0.0d)) * 1000.0d);
return isEmpty ? -parseDouble6 : parseDouble6;
}
return (long) (Double.parseDouble(attributeValue) * 3600.0d * 1000.0d);
}
public static float l(XmlPullParser xmlPullParser, float f10) {
String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate");
if (attributeValue != null) {
Matcher matcher = A.matcher(attributeValue);
if (matcher.matches()) {
int parseInt = Integer.parseInt(matcher.group(1));
String group = matcher.group(2);
return !TextUtils.isEmpty(group) ? parseInt / Integer.parseInt(group) : parseInt;
}
return f10;
}
return f10;
}
public static int m(XmlPullParser xmlPullParser, String str, int i10) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? i10 : Integer.parseInt(attributeValue);
}
public static long n(XmlPullParser xmlPullParser, String str, long j10) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? j10 : Long.parseLong(attributeValue);
}
public static String x(XmlPullParser xmlPullParser, String str) {
String str2 = BuildConfig.FLAVOR;
do {
xmlPullParser.next();
if (xmlPullParser.getEventType() == 4) {
str2 = xmlPullParser.getText();
} else {
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, str));
return str2;
}
public final long a(List list, long j10, long j11, int i10, long j12) {
int i11;
if (i10 >= 0) {
i11 = i10 + 1;
} else {
int i12 = n0.f4097a;
i11 = (int) ((((j12 - j10) + j11) - 1) / j11);
}
for (int i13 = 0; i13 < i11; i13++) {
list.add(new q(j10, j11));
j10 += j11;
}
return j10;
}
public int e(XmlPullParser xmlPullParser) {
char c10;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue == null) {
attributeValue = null;
}
Objects.requireNonNull(attributeValue);
char c11 = 0;
int i10 = -1;
switch (attributeValue.hashCode()) {
case -1352850286:
if (attributeValue.equals("urn:mpeg:dash:23003:3:audio_channel_configuration:2011")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case -1138141449:
if (attributeValue.equals("tag:dolby.com,2014:dash:audio_channel_configuration:2011")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case -986633423:
if (attributeValue.equals("urn:mpeg:mpegB:cicp:ChannelConfiguration")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case 2036691300:
if (attributeValue.equals("urn:dolby:dash:audio_channel_configuration:2011")) {
c10 = 3;
break;
}
c10 = 65535;
break;
default:
c10 = 65535;
break;
}
if (c10 != 0) {
if (c10 != 1) {
if (c10 == 2) {
int m10 = m(xmlPullParser, "value", -1);
if (m10 >= 0) {
int[] iArr = D;
if (m10 < iArr.length) {
i10 = iArr[m10];
}
}
}
}
String attributeValue2 = xmlPullParser.getAttributeValue(null, "value");
if (attributeValue2 != null) {
String b10 = c6.i.b(attributeValue2);
Objects.requireNonNull(b10);
switch (b10.hashCode()) {
case 1596796:
break;
case 2937391:
if (b10.equals("a000")) {
c11 = 1;
break;
}
c11 = 65535;
break;
case 3094035:
if (b10.equals("f801")) {
c11 = 2;
break;
}
c11 = 65535;
break;
case 3133436:
if (b10.equals("fa01")) {
c11 = 3;
break;
}
c11 = 65535;
break;
default:
c11 = 65535;
break;
}
if (c11 == 0) {
i10 = 1;
} else if (c11 == 1) {
i10 = 2;
} else if (c11 == 2) {
i10 = 6;
} else if (c11 == 3) {
i10 = 8;
}
}
} else {
i10 = m(xmlPullParser, "value", -1);
}
do {
xmlPullParser.next();
} while (!e6.h.g(xmlPullParser, "AudioChannelConfiguration"));
return i10;
}
public long f(XmlPullParser xmlPullParser, long j10) {
String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityTimeOffset");
if (attributeValue == null) {
return j10;
}
if ("INF".equals(attributeValue)) {
return Long.MAX_VALUE;
}
return Float.parseFloat(attributeValue) * 1000000.0f;
}
public List g(XmlPullParser xmlPullParser, List list) {
String attributeValue = xmlPullParser.getAttributeValue(null, "dvb:priority");
int parseInt = attributeValue != null ? Integer.parseInt(attributeValue) : 1;
String attributeValue2 = xmlPullParser.getAttributeValue(null, "dvb:weight");
int parseInt2 = attributeValue2 != null ? Integer.parseInt(attributeValue2) : 1;
String attributeValue3 = xmlPullParser.getAttributeValue(null, "serviceLocation");
String x7 = x(xmlPullParser, "BaseURL");
if (attributeValue3 == null) {
attributeValue3 = x7;
}
if ((x7 == null || o0.c(x7)[0] == -1) ? false : true) {
return l0.a(new b(x7, attributeValue3, parseInt, parseInt2));
}
ArrayList arrayList = new ArrayList();
for (int i10 = 0; i10 < list.size(); i10++) {
b bVar = (b) list.get(i10);
arrayList.add(new b(o0.m(bVar.f7461a, x7), bVar.f7462b, bVar.f7463c, bVar.f7464d));
}
return arrayList;
}
public Pair h(XmlPullParser xmlPullParser) {
String str;
UUID uuid;
byte[] bArr;
String str2;
boolean z10;
UUID uuid2;
char c10;
UUID uuid3;
String str3;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue != null) {
String b10 = c6.i.b(attributeValue);
Objects.requireNonNull(b10);
int hashCode = b10.hashCode();
if (hashCode == 489446379) {
if (b10.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) {
c10 = 0;
if (c10 != 0) {
}
uuid = uuid3;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid3;
str = null;
} else if (hashCode != 755418770) {
if (hashCode == 1812765994 && b10.equals("urn:mpeg:dash:mp4protection:2011")) {
c10 = 2;
if (c10 != 0) {
uuid3 = g4.h.f4569e;
} else if (c10 == 1) {
uuid3 = g4.h.f4568d;
} else if (c10 == 2) {
str = xmlPullParser.getAttributeValue(null, "value");
int attributeCount = xmlPullParser.getAttributeCount();
int i10 = 0;
while (true) {
if (i10 >= attributeCount) {
str3 = null;
break;
}
String attributeName = xmlPullParser.getAttributeName(i10);
int indexOf = attributeName.indexOf(58);
if (indexOf != -1) {
attributeName = attributeName.substring(indexOf + 1);
}
if (attributeName.equals("default_KID")) {
str3 = xmlPullParser.getAttributeValue(i10);
break;
}
i10++;
}
if (!TextUtils.isEmpty(str3) && !"00000000-0000-0000-0000-000000000000".equals(str3)) {
String[] split = str3.split("\\s+");
UUID[] uuidArr = new UUID[split.length];
for (int i11 = 0; i11 < split.length; i11++) {
uuidArr[i11] = UUID.fromString(split[i11]);
}
uuid = g4.h.f4566b;
bArr = com.bumptech.glide.j.b(uuid, uuidArr, null);
str2 = null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "ms:laurl")) {
str2 = xmlPullParser.getAttributeValue(null, "licenseUrl");
} else {
if (bArr == null) {
if (e6.h.h(xmlPullParser)) {
String name = xmlPullParser.getName();
int indexOf2 = name.indexOf(58);
if (indexOf2 != -1) {
name = name.substring(indexOf2 + 1);
}
if (name.equals("pssh")) {
z10 = true;
if (z10 && xmlPullParser.next() == 4) {
byte[] decode = Base64.decode(xmlPullParser.getText(), 0);
y.e m10 = com.bumptech.glide.j.m(decode);
uuid2 = m10 != null ? null : (UUID) m10.A;
if (uuid2 != null) {
Log.w("MpdParser", "Skipping malformed cenc:pssh data");
uuid = uuid2;
bArr = null;
} else {
UUID uuid4 = uuid2;
bArr = decode;
uuid = uuid4;
}
}
}
}
z10 = false;
if (z10) {
byte[] decode2 = Base64.decode(xmlPullParser.getText(), 0);
y.e m102 = com.bumptech.glide.j.m(decode2);
if (m102 != null) {
}
if (uuid2 != null) {
}
}
}
if (bArr == null) {
UUID uuid5 = g4.h.f4569e;
if (uuid5.equals(uuid) && e6.h.i(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
bArr = com.bumptech.glide.j.a(uuid5, Base64.decode(xmlPullParser.getText(), 0));
}
}
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new l4.j(uuid, str2, "video/mp4", bArr) : null);
}
uuid = null;
}
uuid = uuid3;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid3;
str = null;
} else {
if (b10.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) {
c10 = 1;
if (c10 != 0) {
}
uuid = uuid3;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid3;
str = null;
}
bArr = null;
str2 = null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "ms:laurl")) {
}
} while (!e6.h.g(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new l4.j(uuid, str2, "video/mp4", bArr) : null);
}
str = null;
uuid = null;
bArr = null;
str2 = null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "ms:laurl")) {
}
} while (!e6.h.g(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new l4.j(uuid, str2, "video/mp4", bArr) : null);
}
public int i(XmlPullParser xmlPullParser) {
String attributeValue = xmlPullParser.getAttributeValue(null, "contentType");
if (!TextUtils.isEmpty(attributeValue)) {
if ("audio".equals(attributeValue)) {
return 1;
}
if ("video".equals(attributeValue)) {
return 2;
}
if ("text".equals(attributeValue)) {
return 3;
}
}
return -1;
}
public c o(XmlPullParser xmlPullParser, b bVar) {
long j10;
ArrayList arrayList;
ArrayList arrayList2;
ArrayList arrayList3;
String str;
long j11;
long j12;
long j13;
String str2;
String str3;
ArrayList arrayList4;
String str4;
String str5;
ArrayList arrayList5;
String str6;
ArrayList arrayList6;
ArrayList arrayList7;
ArrayList arrayList8;
String str7;
XmlPullParser xmlPullParser2;
e eVar;
ArrayList arrayList9;
String str8;
String str9;
ArrayList arrayList10;
e eVar2;
String str10;
ArrayList arrayList11;
String str11;
String str12;
ArrayList arrayList12;
String str13;
String str14;
String str15;
ArrayList arrayList13;
ArrayList arrayList14;
ArrayList arrayList15;
ArrayList arrayList16;
long j14;
String str16;
String str17;
String str18;
String str19;
String str20;
int i10;
String str21;
String str22;
String str23;
String str24;
int i11;
ArrayList arrayList17;
ArrayList arrayList18;
ArrayList arrayList19;
int i12;
float f10;
ArrayList arrayList20;
int i13;
ArrayList arrayList21;
String str25;
long j15;
XmlPullParser xmlPullParser3;
e eVar3;
String str26;
ArrayList arrayList22;
int i14;
e eVar4;
String str27;
XmlPullParser xmlPullParser4;
String str28;
String str29;
String str30;
ArrayList arrayList23;
String str31;
ArrayList arrayList24;
String str32;
String str33;
ArrayList arrayList25;
String str34;
int i15;
XmlPullParser xmlPullParser5;
ArrayList arrayList26;
int i16;
String str35;
long j16;
String str36;
ArrayList arrayList27;
String str37;
ArrayList arrayList28;
String str38;
ArrayList arrayList29;
ArrayList arrayList30;
String str39;
int i17;
ArrayList arrayList31;
String str40;
String e10;
String j17;
int i18;
String str41;
int parseInt;
String str42;
String str43;
char c10;
int i19;
int i20;
String str44;
String str45;
m kVar;
String str46;
long j18;
boolean z10;
float f11;
float f12;
long j19;
long j20;
long j21;
String str47;
?? r32;
e eVar5 = this;
XmlPullParser xmlPullParser6 = xmlPullParser;
String str48 = null;
String attributeValue = xmlPullParser6.getAttributeValue(null, "availabilityStartTime");
long j22 = -9223372036854775807L;
long J = attributeValue == null ? -9223372036854775807L : n0.J(attributeValue);
long k10 = k(xmlPullParser6, "mediaPresentationDuration", -9223372036854775807L);
long k11 = k(xmlPullParser6, "minBufferTime", -9223372036854775807L);
boolean equals = "dynamic".equals(xmlPullParser6.getAttributeValue(null, "type"));
long k12 = equals ? k(xmlPullParser6, "minimumUpdatePeriod", -9223372036854775807L) : -9223372036854775807L;
long k13 = equals ? k(xmlPullParser6, "timeShiftBufferDepth", -9223372036854775807L) : -9223372036854775807L;
long k14 = equals ? k(xmlPullParser6, "suggestedPresentationDelay", -9223372036854775807L) : -9223372036854775807L;
String attributeValue2 = xmlPullParser6.getAttributeValue(null, "publishTime");
long J2 = attributeValue2 == null ? -9223372036854775807L : n0.J(attributeValue2);
long j23 = equals ? 0L : -9223372036854775807L;
ArrayList a10 = l0.a(bVar);
ArrayList arrayList32 = new ArrayList();
ArrayList arrayList33 = new ArrayList();
long j24 = j23;
i iVar = null;
v vVar = null;
Uri uri = null;
t tVar = null;
long j25 = equals ? -9223372036854775807L : 0L;
boolean z11 = false;
boolean z12 = false;
while (true) {
xmlPullParser.next();
String str49 = "BaseURL";
if (e6.h.i(xmlPullParser6, "BaseURL")) {
if (!z11) {
j24 = eVar5.f(xmlPullParser6, j24);
z11 = true;
}
arrayList33.addAll(eVar5.g(xmlPullParser6, a10));
arrayList = arrayList33;
arrayList2 = a10;
arrayList3 = arrayList32;
j11 = j22;
str47 = str48;
} else {
String str50 = "lang";
if (e6.h.i(xmlPullParser6, "ProgramInformation")) {
String attributeValue3 = xmlPullParser6.getAttributeValue(str48, "moreInformationURL");
String str51 = attributeValue3 == null ? str48 : attributeValue3;
String attributeValue4 = xmlPullParser6.getAttributeValue(str48, "lang");
String str52 = attributeValue4 == null ? str48 : attributeValue4;
String str53 = str48;
String str54 = str53;
String str55 = str54;
while (true) {
xmlPullParser.next();
if (e6.h.i(xmlPullParser6, "Title")) {
str53 = xmlPullParser.nextText();
} else if (e6.h.i(xmlPullParser6, "Source")) {
str54 = xmlPullParser.nextText();
} else if (e6.h.i(xmlPullParser6, "Copyright")) {
str55 = xmlPullParser.nextText();
} else {
d(xmlPullParser);
}
if (e6.h.g(xmlPullParser6, "ProgramInformation")) {
iVar = new i(str53, str54, str55, str51, str52);
}
}
} else {
String str56 = "schemeIdUri";
if (e6.h.i(xmlPullParser6, "UTCTiming")) {
vVar = new v(xmlPullParser6.getAttributeValue(str48, "schemeIdUri"), xmlPullParser6.getAttributeValue(str48, "value"));
} else if (e6.h.i(xmlPullParser6, "Location")) {
uri = Uri.parse(xmlPullParser.nextText());
} else if (e6.h.i(xmlPullParser6, "ServiceDescription")) {
float f13 = -3.4028235E38f;
float f14 = -3.4028235E38f;
long j26 = -9223372036854775807L;
long j27 = -9223372036854775807L;
long j28 = -9223372036854775807L;
while (true) {
xmlPullParser.next();
if (e6.h.i(xmlPullParser6, "Latency")) {
long n10 = n(xmlPullParser6, "target", -9223372036854775807L);
long n11 = n(xmlPullParser6, "min", -9223372036854775807L);
f11 = f13;
f12 = f14;
j21 = n(xmlPullParser6, "max", -9223372036854775807L);
j19 = n10;
j20 = n11;
} else {
if (e6.h.i(xmlPullParser6, "PlaybackRate")) {
String attributeValue5 = xmlPullParser6.getAttributeValue(str48, "min");
f13 = attributeValue5 == null ? -3.4028235E38f : Float.parseFloat(attributeValue5);
String attributeValue6 = xmlPullParser6.getAttributeValue(str48, "max");
if (attributeValue6 == null) {
f11 = f13;
j19 = j26;
j20 = j27;
j21 = j28;
f12 = -3.4028235E38f;
} else {
f14 = Float.parseFloat(attributeValue6);
}
}
f11 = f13;
f12 = f14;
j19 = j26;
j20 = j27;
j21 = j28;
}
if (e6.h.g(xmlPullParser6, "ServiceDescription")) {
tVar = new t(j19, j20, j21, f11, f12);
} else {
j26 = j19;
j27 = j20;
j28 = j21;
f13 = f11;
f14 = f12;
}
}
} else {
String str57 = "Period";
if (!e6.h.i(xmlPullParser6, "Period") || z12) {
j10 = j24;
arrayList = arrayList33;
arrayList2 = a10;
arrayList3 = arrayList32;
str = str48;
j11 = -9223372036854775807L;
d(xmlPullParser);
j25 = j25;
} else {
ArrayList arrayList34 = !arrayList33.isEmpty() ? arrayList33 : a10;
String str58 = "id";
String attributeValue7 = xmlPullParser6.getAttributeValue(str48, "id");
long k15 = k(xmlPullParser6, "start", j25);
String str59 = "value";
long j29 = J != -9223372036854775807L ? J + k15 : -9223372036854775807L;
long k16 = k(xmlPullParser6, "duration", -9223372036854775807L);
ArrayList arrayList35 = new ArrayList();
String str60 = "duration";
ArrayList arrayList36 = new ArrayList();
ArrayList arrayList37 = new ArrayList();
long j30 = j24;
long j31 = -9223372036854775807L;
boolean z13 = false;
s sVar = null;
f fVar = null;
e eVar6 = this;
long j32 = j30;
XmlPullParser xmlPullParser7 = xmlPullParser6;
while (true) {
xmlPullParser.next();
if (e6.h.i(xmlPullParser7, str49)) {
if (z13) {
j12 = j25;
} else {
j32 = eVar6.f(xmlPullParser7, j32);
j12 = j25;
z13 = true;
}
j13 = j32;
arrayList37.addAll(g(xmlPullParser6, arrayList34));
str2 = str59;
arrayList7 = arrayList35;
arrayList = arrayList33;
str3 = str49;
arrayList2 = a10;
arrayList4 = arrayList32;
str4 = str56;
str7 = str58;
str5 = str57;
arrayList5 = arrayList34;
str6 = str50;
eVar2 = this;
arrayList6 = arrayList37;
arrayList8 = arrayList36;
j10 = j30;
sVar = sVar;
} else {
j12 = j25;
j13 = j32;
String str61 = "SegmentTemplate";
String str62 = "AdaptationSet";
if (e6.h.i(xmlPullParser7, "AdaptationSet")) {
if (arrayList37.isEmpty()) {
arrayList6 = arrayList37;
arrayList37 = arrayList34;
} else {
arrayList6 = arrayList37;
}
int m10 = m(xmlPullParser7, str58, -1);
int i21 = i(xmlPullParser);
ArrayList arrayList38 = arrayList35;
String attributeValue8 = xmlPullParser7.getAttributeValue(null, "mimeType");
String str63 = str57;
String attributeValue9 = xmlPullParser7.getAttributeValue(null, "codecs");
e eVar7 = eVar6;
arrayList5 = arrayList34;
int m11 = m(xmlPullParser7, "width", -1);
String str64 = str56;
arrayList2 = a10;
int m12 = m(xmlPullParser7, "height", -1);
float l10 = l(xmlPullParser7, -1.0f);
ArrayList arrayList39 = arrayList32;
arrayList = arrayList33;
String str65 = "SegmentList";
int m13 = m(xmlPullParser7, "audioSamplingRate", -1);
String attributeValue10 = xmlPullParser7.getAttributeValue(null, str50);
String str66 = "SegmentBase";
String attributeValue11 = xmlPullParser7.getAttributeValue(null, "label");
ArrayList arrayList40 = new ArrayList();
ArrayList arrayList41 = new ArrayList();
ArrayList arrayList42 = new ArrayList();
XmlPullParser xmlPullParser8 = xmlPullParser7;
ArrayList arrayList43 = new ArrayList();
String str67 = "audioSamplingRate";
ArrayList arrayList44 = new ArrayList();
int i22 = m13;
ArrayList arrayList45 = new ArrayList();
float f15 = l10;
ArrayList arrayList46 = new ArrayList();
ArrayList arrayList47 = new ArrayList();
String str68 = "width";
String str69 = str58;
String str70 = "codecs";
int i23 = m11;
String str71 = "mimeType";
long j33 = j13;
long j34 = j31;
s sVar2 = sVar;
int i24 = i21;
String str72 = attributeValue10;
XmlPullParser xmlPullParser9 = xmlPullParser8;
XmlPullParser xmlPullParser10 = xmlPullParser9;
String str73 = null;
boolean z14 = false;
String str74 = "height";
e eVar8 = eVar7;
String str75 = attributeValue11;
int i25 = -1;
int i26 = m12;
e eVar9 = eVar8;
while (true) {
xmlPullParser.next();
if (e6.h.i(xmlPullParser9, str49)) {
if (!z14) {
j33 = eVar9.f(xmlPullParser9, j33);
z14 = true;
}
arrayList47.addAll(eVar8.g(xmlPullParser10, arrayList37));
} else if (e6.h.i(xmlPullParser9, "ContentProtection")) {
Pair h10 = h(xmlPullParser);
Object obj = h10.first;
if (obj != null) {
str73 = (String) obj;
}
Object obj2 = h10.second;
if (obj2 != null) {
arrayList40.add((l4.j) obj2);
}
} else if (e6.h.i(xmlPullParser9, "ContentComponent")) {
String attributeValue12 = xmlPullParser9.getAttributeValue(null, str50);
if (str72 == null) {
str72 = attributeValue12;
} else if (attributeValue12 != null) {
e6.a.d(str72.equals(attributeValue12));
}
i24 = b(i24, i(xmlPullParser));
} else {
if (e6.h.i(xmlPullParser9, "Role")) {
arrayList43.add(j(xmlPullParser9, "Role"));
arrayList13 = arrayList43;
} else {
String str76 = "AudioChannelConfiguration";
if (e6.h.i(xmlPullParser9, "AudioChannelConfiguration")) {
i25 = e(xmlPullParser);
} else {
arrayList13 = arrayList43;
if (e6.h.i(xmlPullParser9, "Accessibility")) {
arrayList42.add(j(xmlPullParser9, "Accessibility"));
} else if (e6.h.i(xmlPullParser9, "EssentialProperty")) {
arrayList44.add(j(xmlPullParser9, "EssentialProperty"));
} else {
arrayList14 = arrayList37;
if (e6.h.i(xmlPullParser9, "SupplementalProperty")) {
arrayList45.add(j(xmlPullParser9, "SupplementalProperty"));
str10 = str59;
arrayList15 = arrayList40;
eVar3 = eVar9;
arrayList16 = arrayList44;
j14 = j33;
str6 = str50;
str16 = str72;
arrayList18 = arrayList42;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str26 = str65;
str19 = str74;
str20 = str67;
i10 = i22;
str21 = str68;
str22 = str70;
str23 = str71;
str24 = str69;
i11 = i24;
j15 = j34;
arrayList17 = arrayList13;
xmlPullParser3 = xmlPullParser;
arrayList19 = arrayList45;
j10 = j30;
i12 = i26;
str25 = str66;
f10 = f15;
arrayList20 = arrayList46;
i13 = i23;
arrayList21 = arrayList47;
str3 = str49;
arrayList22 = arrayList41;
xmlPullParser4 = xmlPullParser9;
j34 = j15;
eVar9 = eVar3;
i14 = i11;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
ArrayList arrayList48 = new ArrayList(arrayList20.size());
int i27 = 0;
while (i27 < arrayList20.size()) {
ArrayList arrayList49 = arrayList20;
d dVar = (d) arrayList49.get(i27);
i0 a11 = dVar.f7478a.a();
if (str44 != null) {
a11.f4572b = str44;
}
String str77 = dVar.f7481d;
if (str77 == null) {
str77 = str73;
}
ArrayList arrayList50 = dVar.f7482e;
ArrayList arrayList51 = arrayList15;
arrayList50.addAll(arrayList51);
if (!arrayList50.isEmpty()) {
for (int size = arrayList50.size() - 1; size >= 0; size--) {
l4.j jVar = (l4.j) arrayList50.get(size);
if (!jVar.a()) {
int i28 = 0;
while (true) {
if (i28 < arrayList50.size()) {
l4.j jVar2 = (l4.j) arrayList50.get(i28);
if (jVar2.a() && !jVar.a() && jVar2.b(jVar.A)) {
arrayList50.remove(size);
} else {
i28++;
}
}
}
}
}
a11.f4584n = new l4.k(str77, false, (l4.j[]) arrayList50.toArray(new l4.j[0]));
}
ArrayList arrayList52 = dVar.f7483f;
arrayList52.addAll(arrayList22);
long j35 = dVar.f7484g;
j0 a12 = a11.a();
y yVar = dVar.f7479b;
s sVar3 = dVar.f7480c;
if (sVar3 instanceof r) {
kVar = new l(j35, a12, yVar, (r) sVar3, arrayList52, null, -1L);
} else if (!(sVar3 instanceof n)) {
throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase");
} else {
kVar = new k(j35, a12, yVar, (n) sVar3, arrayList52);
}
arrayList48.add(kVar);
i27++;
arrayList20 = arrayList49;
arrayList15 = arrayList51;
}
arrayList11.add(new a(m10, i24, arrayList48, arrayList18, arrayList16, arrayList19));
xmlPullParser7 = xmlPullParser3;
arrayList12 = arrayList36;
str12 = str24;
} else {
eVar8 = this;
arrayList41 = arrayList22;
str75 = str44;
xmlPullParser10 = xmlPullParser3;
arrayList42 = arrayList18;
f15 = f10;
str50 = str6;
str71 = str23;
i22 = i10;
str70 = str22;
i23 = i13;
i26 = i12;
str49 = str3;
arrayList47 = arrayList21;
arrayList45 = arrayList19;
arrayList46 = arrayList20;
arrayList43 = arrayList17;
str67 = str20;
arrayList44 = arrayList16;
str64 = str11;
str69 = str24;
str63 = str5;
str59 = str10;
str62 = str45;
arrayList39 = arrayList4;
str66 = str25;
str68 = str21;
j30 = j10;
arrayList38 = arrayList11;
arrayList40 = arrayList15;
str65 = str26;
str74 = str19;
arrayList37 = arrayList14;
}
} else {
ArrayList arrayList53 = arrayList42;
String str78 = "Representation";
if (e6.h.i(xmlPullParser9, "Representation")) {
j14 = j33;
if (arrayList47.isEmpty()) {
str28 = "SupplementalProperty";
str29 = "InbandEventStream";
str30 = str69;
arrayList23 = arrayList14;
str31 = null;
} else {
str28 = "SupplementalProperty";
str29 = "InbandEventStream";
str30 = str69;
str31 = null;
arrayList23 = arrayList47;
}
String attributeValue13 = xmlPullParser9.getAttributeValue(str31, str30);
ArrayList arrayList54 = arrayList47;
String str79 = str50;
int m14 = m(xmlPullParser9, "bandwidth", -1);
String str80 = str71;
String attributeValue14 = xmlPullParser9.getAttributeValue(str31, str80);
String str81 = attributeValue14 == null ? attributeValue8 : attributeValue14;
String str82 = str70;
String str83 = "ContentProtection";
String attributeValue15 = xmlPullParser9.getAttributeValue(str31, str82);
if (attributeValue15 == null) {
attributeValue15 = attributeValue9;
}
String str84 = str68;
int i29 = i23;
String str85 = str82;
int m15 = m(xmlPullParser9, str84, i29);
String str86 = str30;
String str87 = str74;
String str88 = str84;
int i30 = i26;
i13 = i29;
int i31 = i30;
int m16 = m(xmlPullParser9, str87, i31);
int i32 = m14;
float f16 = f15;
String str89 = str87;
String str90 = str67;
float l11 = l(xmlPullParser9, f16);
int i33 = i22;
int i34 = m15;
int m17 = m(xmlPullParser9, str90, i33);
int i35 = i33;
ArrayList arrayList55 = new ArrayList();
ArrayList arrayList56 = new ArrayList();
ArrayList arrayList57 = new ArrayList(arrayList44);
ArrayList arrayList58 = new ArrayList(arrayList45);
ArrayList arrayList59 = new ArrayList();
float f17 = f16;
String str91 = "EssentialProperty";
ArrayList arrayList60 = arrayList45;
ArrayList arrayList61 = arrayList55;
int i36 = i25;
long j36 = j34;
s sVar4 = sVar2;
long j37 = j14;
String str92 = null;
boolean z15 = false;
e eVar10 = eVar9;
XmlPullParser xmlPullParser11 = xmlPullParser9;
e eVar11 = eVar10;
while (true) {
xmlPullParser.next();
if (e6.h.i(xmlPullParser11, str49)) {
if (!z15) {
j37 = eVar11.f(xmlPullParser11, j37);
z15 = true;
}
arrayList59.addAll(eVar11.g(xmlPullParser11, arrayList23));
} else if (e6.h.i(xmlPullParser11, str76)) {
i36 = e(xmlPullParser);
} else {
arrayList24 = arrayList59;
str32 = str66;
if (e6.h.i(xmlPullParser11, str32)) {
arrayList31 = arrayList40;
sVar4 = eVar11.t(xmlPullParser11, (r) sVar4);
str10 = str59;
arrayList16 = arrayList44;
str33 = str76;
arrayList25 = arrayList23;
str34 = str72;
str36 = str29;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str18 = str65;
str21 = str88;
arrayList15 = arrayList31;
str22 = str85;
str35 = str83;
i15 = i24;
str38 = str28;
str6 = str79;
str24 = str86;
str19 = str89;
i10 = i35;
arrayList28 = arrayList56;
arrayList19 = arrayList60;
str37 = str91;
str3 = str49;
i12 = i31;
str23 = str80;
j16 = j37;
j10 = j30;
str39 = str78;
arrayList30 = arrayList58;
arrayList27 = arrayList61;
f10 = f17;
eVar4 = this;
str20 = str90;
str25 = str32;
arrayList29 = arrayList57;
xmlPullParser5 = xmlPullParser11;
i17 = i36;
ArrayList arrayList62 = arrayList54;
arrayList20 = arrayList46;
arrayList21 = arrayList62;
int i37 = i32;
arrayList26 = arrayList13;
i16 = i37;
if (e6.h.g(xmlPullParser5, str39)) {
if (u.k(str81)) {
j17 = u.b(attributeValue15);
} else if (u.m(str81)) {
j17 = u.j(attributeValue15);
} else {
if (u.l(str81)) {
str40 = str81;
if ("application/x-rawcc".equals(str40)) {
if (attributeValue15 != null) {
for (String str93 : n0.Q(attributeValue15)) {
e10 = u.e(str93);
if (e10 == null || !u.l(e10)) {
}
}
}
e10 = null;
} else {
e10 = str40;
}
String str94 = "ec+3";
if ("audio/eac3".equals(e10)) {
for (int i38 = 0; i38 < arrayList30.size(); i38++) {
f fVar2 = (f) arrayList30.get(i38);
String str95 = fVar2.f7486a;
if (("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str95) && "JOC".equals(fVar2.f7487b)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str95) && "ec+3".equals(fVar2.f7487b))) {
e10 = "audio/eac3-joc";
}
}
e10 = "audio/eac3";
}
str94 = attributeValue15;
i18 = 0;
int i39 = 0;
while (true) {
String str96 = "urn:mpeg:dash:role:2011";
if (i18 >= arrayList26.size()) {
ArrayList arrayList63 = arrayList26;
f fVar3 = (f) arrayList63.get(i18);
if (c6.i.a("urn:mpeg:dash:role:2011", fVar3.f7486a)) {
String str97 = fVar3.f7487b;
if (str97 != null) {
if (str97.equals("forced_subtitle")) {
i20 = 2;
} else if (str97.equals("main")) {
i20 = 1;
}
i39 |= i20;
}
i20 = 0;
i39 |= i20;
}
i18++;
arrayList26 = arrayList63;
} else {
ArrayList arrayList64 = arrayList26;
int i40 = 0;
for (int i41 = 0; i41 < arrayList64.size(); i41++) {
f fVar4 = (f) arrayList64.get(i41);
if (c6.i.a("urn:mpeg:dash:role:2011", fVar4.f7486a)) {
i40 |= eVar4.r(fVar4.f7487b);
}
}
int i42 = 0;
int i43 = 0;
while (i42 < arrayList53.size()) {
ArrayList arrayList65 = arrayList53;
ArrayList arrayList66 = arrayList64;
f fVar5 = (f) arrayList65.get(i42);
ArrayList arrayList67 = arrayList28;
if (c6.i.a(str96, fVar5.f7486a)) {
i43 |= eVar4.r(fVar5.f7487b);
str43 = str96;
} else {
str43 = str96;
if (c6.i.a("urn:tva:metadata:cs:AudioPurposeCS:2007", fVar5.f7486a)) {
String str98 = fVar5.f7487b;
if (str98 != null) {
switch (str98.hashCode()) {
case 49:
if (str98.equals("1")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case 50:
if (str98.equals("2")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case 51:
if (str98.equals("3")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case 52:
if (str98.equals("4")) {
c10 = 3;
break;
}
c10 = 65535;
break;
case 53:
default:
c10 = 65535;
break;
case 54:
if (str98.equals("6")) {
c10 = 4;
break;
}
c10 = 65535;
break;
}
if (c10 == 0) {
i19 = 512;
} else if (c10 == 1) {
i19 = 2048;
} else if (c10 == 2) {
i19 = 4;
} else if (c10 == 3) {
i19 = 8;
} else if (c10 == 4) {
i19 = 1;
}
i43 = i19 | i43;
i42++;
arrayList53 = arrayList65;
str96 = str43;
arrayList64 = arrayList66;
arrayList28 = arrayList67;
}
i19 = 0;
i43 = i19 | i43;
i42++;
arrayList53 = arrayList65;
str96 = str43;
arrayList64 = arrayList66;
arrayList28 = arrayList67;
}
}
i42++;
arrayList53 = arrayList65;
str96 = str43;
arrayList64 = arrayList66;
arrayList28 = arrayList67;
}
ArrayList arrayList68 = arrayList28;
arrayList17 = arrayList64;
ArrayList arrayList69 = arrayList53;
int s10 = i40 | i43 | eVar4.s(arrayList29) | eVar4.s(arrayList30);
i0 i0Var = new i0();
i0Var.f4571a = attributeValue13;
i0Var.f4580j = str40;
i0Var.f4581k = e10;
i0Var.f4578h = str94;
i0Var.f4577g = i16;
i0Var.f4574d = i39;
i0Var.f4575e = s10;
String str99 = str34;
i0Var.f4573c = str99;
if (u.m(e10)) {
i0Var.f4586p = i34;
i0Var.f4587q = m16;
i0Var.f4588r = l11;
} else if (u.k(e10)) {
i0Var.f4594x = i17;
i0Var.f4595y = m17;
} else if (u.l(e10)) {
if ("application/cea-608".equals(e10)) {
for (int i44 = 0; i44 < arrayList69.size(); i44++) {
f fVar6 = (f) arrayList69.get(i44);
if ("urn:scte:dash:cc:cea-608:2015".equals(fVar6.f7486a) && (str42 = fVar6.f7487b) != null) {
Matcher matcher = B.matcher(str42);
if (matcher.matches()) {
parseInt = Integer.parseInt(matcher.group(1));
i0Var.C = parseInt;
j0 a13 = i0Var.a();
d dVar2 = new d(a13, !arrayList24.isEmpty() ? arrayList24 : arrayList25, sVar4 != null ? sVar4 : new r(), str92, arrayList27, arrayList68, -1L);
int b10 = b(i15, u.i(a13.K));
arrayList20.add(dVar2);
xmlPullParser3 = xmlPullParser;
str16 = str99;
i14 = b10;
arrayList18 = arrayList69;
str27 = str61;
} else {
String valueOf = String.valueOf(fVar6.f7487b);
Log.w("MpdParser", valueOf.length() != 0 ? "Unable to parse CEA-608 channel number from: ".concat(valueOf) : new String("Unable to parse CEA-608 channel number from: "));
}
}
}
parseInt = -1;
i0Var.C = parseInt;
j0 a132 = i0Var.a();
if (sVar4 != null) {
}
d dVar22 = new d(a132, !arrayList24.isEmpty() ? arrayList24 : arrayList25, sVar4 != null ? sVar4 : new r(), str92, arrayList27, arrayList68, -1L);
int b102 = b(i15, u.i(a132.K));
arrayList20.add(dVar22);
xmlPullParser3 = xmlPullParser;
str16 = str99;
i14 = b102;
arrayList18 = arrayList69;
str27 = str61;
} else {
if ("application/cea-708".equals(e10)) {
for (int i45 = 0; i45 < arrayList69.size(); i45++) {
f fVar7 = (f) arrayList69.get(i45);
if ("urn:scte:dash:cc:cea-708:2015".equals(fVar7.f7486a) && (str41 = fVar7.f7487b) != null) {
Matcher matcher2 = C.matcher(str41);
if (matcher2.matches()) {
parseInt = Integer.parseInt(matcher2.group(1));
i0Var.C = parseInt;
j0 a1322 = i0Var.a();
if (sVar4 != null) {
}
d dVar222 = new d(a1322, !arrayList24.isEmpty() ? arrayList24 : arrayList25, sVar4 != null ? sVar4 : new r(), str92, arrayList27, arrayList68, -1L);
int b1022 = b(i15, u.i(a1322.K));
arrayList20.add(dVar222);
xmlPullParser3 = xmlPullParser;
str16 = str99;
i14 = b1022;
arrayList18 = arrayList69;
str27 = str61;
} else {
String valueOf2 = String.valueOf(fVar7.f7487b);
Log.w("MpdParser", valueOf2.length() != 0 ? "Unable to parse CEA-708 service block number from: ".concat(valueOf2) : new String("Unable to parse CEA-708 service block number from: "));
}
}
}
}
parseInt = -1;
i0Var.C = parseInt;
j0 a13222 = i0Var.a();
if (sVar4 != null) {
}
d dVar2222 = new d(a13222, !arrayList24.isEmpty() ? arrayList24 : arrayList25, sVar4 != null ? sVar4 : new r(), str92, arrayList27, arrayList68, -1L);
int b10222 = b(i15, u.i(a13222.K));
arrayList20.add(dVar2222);
xmlPullParser3 = xmlPullParser;
str16 = str99;
i14 = b10222;
arrayList18 = arrayList69;
str27 = str61;
}
}
j0 a132222 = i0Var.a();
if (sVar4 != null) {
}
d dVar22222 = new d(a132222, !arrayList24.isEmpty() ? arrayList24 : arrayList25, sVar4 != null ? sVar4 : new r(), str92, arrayList27, arrayList68, -1L);
int b102222 = b(i15, u.i(a132222.K));
arrayList20.add(dVar22222);
xmlPullParser3 = xmlPullParser;
str16 = str99;
i14 = b102222;
arrayList18 = arrayList69;
str27 = str61;
}
}
} else {
str40 = str81;
if ("application/mp4".equals(str40)) {
e10 = u.e(attributeValue15);
if ("text/vtt".equals(e10)) {
e10 = "application/x-mp4-vtt";
}
String str942 = "ec+3";
if ("audio/eac3".equals(e10)) {
}
str942 = attributeValue15;
i18 = 0;
int i392 = 0;
while (true) {
String str962 = "urn:mpeg:dash:role:2011";
if (i18 >= arrayList26.size()) {
}
i18++;
arrayList26 = arrayList63;
}
}
e10 = null;
String str9422 = "ec+3";
if ("audio/eac3".equals(e10)) {
}
str9422 = attributeValue15;
i18 = 0;
int i3922 = 0;
while (true) {
String str9622 = "urn:mpeg:dash:role:2011";
if (i18 >= arrayList26.size()) {
}
i18++;
arrayList26 = arrayList63;
}
}
xmlPullParser4 = xmlPullParser3;
arrayList22 = arrayList41;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
}
}
e10 = j17;
str40 = str81;
String str94222 = "ec+3";
if ("audio/eac3".equals(e10)) {
}
str94222 = attributeValue15;
i18 = 0;
int i39222 = 0;
while (true) {
String str96222 = "urn:mpeg:dash:role:2011";
if (i18 >= arrayList26.size()) {
}
i18++;
arrayList26 = arrayList63;
}
} else {
arrayList56 = arrayList28;
str83 = str35;
str29 = str36;
arrayList61 = arrayList27;
i36 = i17;
str91 = str37;
arrayList57 = arrayList29;
str28 = str38;
arrayList58 = arrayList30;
str78 = str39;
eVar11 = eVar4;
str76 = str33;
arrayList23 = arrayList25;
str79 = str6;
str80 = str23;
str85 = str22;
i31 = i12;
str49 = str3;
arrayList60 = arrayList19;
j37 = j16;
str90 = str20;
arrayList59 = arrayList24;
arrayList40 = arrayList15;
arrayList44 = arrayList16;
str64 = str11;
str86 = str24;
i24 = i15;
str63 = str5;
str59 = str10;
str62 = str17;
str72 = str34;
xmlPullParser11 = xmlPullParser;
str89 = str19;
arrayList39 = arrayList4;
f17 = f10;
str66 = str25;
i35 = i10;
j30 = j10;
str65 = str18;
str88 = str21;
arrayList38 = arrayList11;
i34 = i34;
l11 = l11;
ArrayList arrayList70 = arrayList20;
arrayList54 = arrayList21;
arrayList46 = arrayList70;
ArrayList arrayList71 = arrayList26;
i32 = i16;
arrayList13 = arrayList71;
}
} else {
ArrayList arrayList72 = arrayList40;
String str100 = str65;
if (e6.h.i(xmlPullParser11, str100)) {
long f18 = eVar11.f(xmlPullParser11, j36);
ArrayList arrayList73 = arrayList38;
str21 = str88;
arrayList11 = arrayList73;
j10 = j30;
f10 = f17;
str25 = str32;
int i46 = i32;
ArrayList arrayList74 = arrayList54;
arrayList20 = arrayList46;
arrayList21 = arrayList74;
arrayList26 = arrayList13;
i16 = i46;
arrayList15 = arrayList72;
str3 = str49;
arrayList16 = arrayList44;
str20 = str90;
ArrayList arrayList75 = arrayList39;
i12 = i31;
str33 = str76;
str11 = str64;
str24 = str86;
str19 = str89;
xmlPullParser5 = xmlPullParser11;
arrayList25 = arrayList23;
arrayList4 = arrayList75;
str5 = str63;
str22 = str85;
i15 = i24;
str10 = str59;
str34 = str72;
str17 = str62;
str6 = str79;
str23 = str80;
sVar4 = u(xmlPullParser, (o) sVar4, j29, k16, j37, f18, k13);
str36 = str29;
str37 = str91;
str38 = str28;
str39 = str78;
i10 = i35;
arrayList29 = arrayList57;
arrayList30 = arrayList58;
arrayList28 = arrayList56;
arrayList19 = arrayList60;
arrayList27 = arrayList61;
str18 = str100;
i17 = i36;
j36 = f18;
str35 = str83;
j16 = j37;
eVar4 = this;
} else {
str10 = str59;
arrayList16 = arrayList44;
str33 = str76;
arrayList25 = arrayList23;
str34 = str72;
String str101 = str61;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str21 = str88;
arrayList15 = arrayList72;
str22 = str85;
String str102 = str83;
i15 = i24;
str6 = str79;
str24 = str86;
str19 = str89;
String str103 = str91;
str3 = str49;
i12 = i31;
str23 = str80;
j10 = j30;
f10 = f17;
str20 = str90;
str25 = str32;
xmlPullParser5 = xmlPullParser11;
ArrayList arrayList76 = arrayList54;
arrayList20 = arrayList46;
arrayList21 = arrayList76;
int i47 = i32;
arrayList26 = arrayList13;
i16 = i47;
if (e6.h.i(xmlPullParser5, str101)) {
long f19 = eVar11.f(xmlPullParser5, j36);
str61 = str101;
i10 = i35;
arrayList19 = arrayList60;
str18 = str100;
j16 = j37;
eVar4 = this;
sVar4 = v(xmlPullParser, (p) sVar4, arrayList60, j29, k16, j37, f19, k13);
j36 = f19;
arrayList27 = arrayList61;
str35 = str102;
} else {
str61 = str101;
i10 = i35;
arrayList19 = arrayList60;
str18 = str100;
str35 = str102;
j16 = j37;
eVar4 = this;
if (e6.h.i(xmlPullParser5, str35)) {
Pair h11 = h(xmlPullParser);
Object obj3 = h11.first;
if (obj3 != null) {
str92 = (String) obj3;
}
Object obj4 = h11.second;
if (obj4 != null) {
arrayList27 = arrayList61;
arrayList27.add((l4.j) obj4);
} else {
arrayList27 = arrayList61;
}
} else {
str36 = str29;
arrayList27 = arrayList61;
if (e6.h.i(xmlPullParser5, str36)) {
arrayList28 = arrayList56;
arrayList28.add(j(xmlPullParser5, str36));
str37 = str103;
arrayList29 = arrayList57;
} else {
str37 = str103;
arrayList28 = arrayList56;
if (e6.h.i(xmlPullParser5, str37)) {
arrayList29 = arrayList57;
arrayList29.add(j(xmlPullParser5, str37));
} else {
str38 = str28;
arrayList29 = arrayList57;
if (e6.h.i(xmlPullParser5, str38)) {
arrayList30 = arrayList58;
arrayList30.add(j(xmlPullParser5, str38));
} else {
arrayList30 = arrayList58;
d(xmlPullParser);
}
str39 = str78;
i17 = i36;
}
}
str38 = str28;
arrayList30 = arrayList58;
str39 = str78;
i17 = i36;
}
}
str36 = str29;
str37 = str103;
arrayList29 = arrayList57;
arrayList28 = arrayList56;
str38 = str28;
arrayList30 = arrayList58;
str39 = str78;
i17 = i36;
}
if (e6.h.g(xmlPullParser5, str39)) {
}
}
}
arrayList24 = arrayList59;
str32 = str66;
arrayList31 = arrayList40;
str10 = str59;
arrayList16 = arrayList44;
str33 = str76;
arrayList25 = arrayList23;
str34 = str72;
str36 = str29;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str18 = str65;
str21 = str88;
arrayList15 = arrayList31;
str22 = str85;
str35 = str83;
i15 = i24;
str38 = str28;
str6 = str79;
str24 = str86;
str19 = str89;
i10 = i35;
arrayList28 = arrayList56;
arrayList19 = arrayList60;
str37 = str91;
str3 = str49;
i12 = i31;
str23 = str80;
j16 = j37;
j10 = j30;
str39 = str78;
arrayList30 = arrayList58;
arrayList27 = arrayList61;
f10 = f17;
eVar4 = this;
str20 = str90;
str25 = str32;
arrayList29 = arrayList57;
xmlPullParser5 = xmlPullParser11;
i17 = i36;
ArrayList arrayList622 = arrayList54;
arrayList20 = arrayList46;
arrayList21 = arrayList622;
int i372 = i32;
arrayList26 = arrayList13;
i16 = i372;
if (e6.h.g(xmlPullParser5, str39)) {
}
}
} else {
str10 = str59;
arrayList15 = arrayList40;
arrayList16 = arrayList44;
j14 = j33;
str6 = str50;
str16 = str72;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str18 = str65;
str19 = str74;
String str104 = str66;
str20 = str67;
i10 = i22;
str21 = str68;
str22 = str70;
str23 = str71;
str24 = str69;
i11 = i24;
arrayList17 = arrayList13;
arrayList18 = arrayList53;
str3 = str49;
arrayList19 = arrayList45;
j10 = j30;
i12 = i26;
f10 = f15;
arrayList20 = arrayList46;
i13 = i23;
arrayList21 = arrayList47;
String str105 = str61;
if (e6.h.i(xmlPullParser, str104)) {
sVar2 = eVar9.t(xmlPullParser, (r) sVar2);
str27 = str105;
eVar4 = eVar9;
str25 = str104;
xmlPullParser3 = xmlPullParser;
} else if (e6.h.i(xmlPullParser, str18)) {
j34 = eVar9.f(xmlPullParser, j34);
eVar4 = eVar9;
str18 = str18;
str25 = str104;
str27 = str105;
xmlPullParser3 = xmlPullParser;
sVar2 = u(xmlPullParser, (o) sVar2, j29, k16, j14, j34, k13);
} else {
e eVar12 = eVar9;
str25 = str104;
j15 = j34;
xmlPullParser3 = xmlPullParser;
if (e6.h.i(xmlPullParser3, str105)) {
j34 = eVar12.f(xmlPullParser3, j15);
str61 = str105;
str26 = str18;
sVar2 = v(xmlPullParser, (p) sVar2, arrayList19, j29, k16, j14, j34, k13);
eVar9 = eVar12;
i14 = i11;
xmlPullParser4 = xmlPullParser3;
arrayList22 = arrayList41;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
}
} else {
str61 = str105;
eVar3 = eVar12;
str26 = str18;
if (e6.h.i(xmlPullParser3, "InbandEventStream")) {
arrayList22 = arrayList41;
arrayList22.add(j(xmlPullParser3, "InbandEventStream"));
} else {
arrayList22 = arrayList41;
if (e6.h.i(xmlPullParser3, "Label")) {
str75 = x(xmlPullParser3, "Label");
} else if (e6.h.h(xmlPullParser)) {
d(xmlPullParser);
}
}
xmlPullParser9 = xmlPullParser3;
xmlPullParser4 = xmlPullParser9;
j34 = j15;
eVar9 = eVar3;
i14 = i11;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
}
}
}
i14 = i11;
}
str61 = str27;
eVar9 = eVar4;
str26 = str18;
xmlPullParser4 = xmlPullParser3;
arrayList22 = arrayList41;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
}
}
}
}
}
arrayList14 = arrayList37;
str10 = str59;
arrayList15 = arrayList40;
eVar3 = eVar9;
arrayList16 = arrayList44;
j14 = j33;
str6 = str50;
str16 = str72;
arrayList18 = arrayList42;
str17 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str26 = str65;
str19 = str74;
str20 = str67;
i10 = i22;
str21 = str68;
str22 = str70;
str23 = str71;
str24 = str69;
i11 = i24;
j15 = j34;
arrayList17 = arrayList13;
xmlPullParser3 = xmlPullParser;
arrayList19 = arrayList45;
j10 = j30;
i12 = i26;
str25 = str66;
f10 = f15;
arrayList20 = arrayList46;
i13 = i23;
arrayList21 = arrayList47;
str3 = str49;
arrayList22 = arrayList41;
xmlPullParser4 = xmlPullParser9;
j34 = j15;
eVar9 = eVar3;
i14 = i11;
xmlPullParser9 = xmlPullParser4;
i24 = i14;
str72 = str16;
str44 = str75;
j33 = j14;
str45 = str17;
if (e6.h.g(xmlPullParser9, str45)) {
}
}
str10 = str59;
arrayList17 = arrayList43;
arrayList15 = arrayList40;
arrayList16 = arrayList44;
str6 = str50;
arrayList14 = arrayList37;
arrayList18 = arrayList42;
str45 = str62;
arrayList11 = arrayList38;
str5 = str63;
str11 = str64;
arrayList4 = arrayList39;
str26 = str65;
str19 = str74;
str44 = str75;
str20 = str67;
i10 = i22;
str21 = str68;
str22 = str70;
str23 = str71;
str24 = str69;
xmlPullParser3 = xmlPullParser;
arrayList19 = arrayList45;
j10 = j30;
i12 = i26;
str25 = str66;
f10 = f15;
arrayList20 = arrayList46;
i13 = i23;
arrayList21 = arrayList47;
str3 = str49;
arrayList22 = arrayList41;
if (e6.h.g(xmlPullParser9, str45)) {
}
}
} else {
str2 = str59;
arrayList = arrayList33;
str3 = str49;
arrayList2 = a10;
arrayList4 = arrayList32;
str4 = str56;
String str106 = str58;
str5 = str57;
arrayList5 = arrayList34;
str6 = str50;
arrayList6 = arrayList37;
j10 = j30;
ArrayList arrayList77 = arrayList35;
if (e6.h.i(xmlPullParser7, "EventStream")) {
String str107 = str4;
String attributeValue16 = xmlPullParser7.getAttributeValue(null, str107);
String str108 = BuildConfig.FLAVOR;
if (attributeValue16 == null) {
attributeValue16 = BuildConfig.FLAVOR;
}
String str109 = str2;
String attributeValue17 = xmlPullParser7.getAttributeValue(null, str109);
if (attributeValue17 != null) {
str108 = attributeValue17;
}
long n12 = n(xmlPullParser7, "timescale", 1L);
ArrayList arrayList78 = new ArrayList();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
while (true) {
xmlPullParser.next();
String str110 = "Event";
if (e6.h.i(xmlPullParser7, "Event")) {
str10 = str109;
str12 = str106;
long n13 = n(xmlPullParser7, str12, 0L);
arrayList11 = arrayList77;
str11 = str107;
String str111 = str60;
long n14 = n(xmlPullParser7, str111, -9223372036854775807L);
long n15 = n(xmlPullParser7, "presentationTime", 0L);
long M = n0.M(n14, 1000L, n12);
long M2 = n0.M(n15, 1000000L, n12);
String attributeValue18 = xmlPullParser7.getAttributeValue(null, "messageData");
if (attributeValue18 == null) {
attributeValue18 = null;
}
byteArrayOutputStream.reset();
XmlSerializer newSerializer = Xml.newSerializer();
newSerializer.setOutput(byteArrayOutputStream, u8.f.f10629c.name());
xmlPullParser.nextToken();
while (!e6.h.g(xmlPullParser7, str110)) {
switch (xmlPullParser.getEventType()) {
case 0:
str13 = str110;
str14 = str111;
newSerializer.startDocument(null, Boolean.FALSE);
break;
case 1:
str13 = str110;
str14 = str111;
newSerializer.endDocument();
break;
case 2:
newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
int i48 = 0;
while (i48 < xmlPullParser.getAttributeCount()) {
newSerializer.attribute(xmlPullParser7.getAttributeNamespace(i48), xmlPullParser7.getAttributeName(i48), xmlPullParser7.getAttributeValue(i48));
i48++;
str110 = str110;
str111 = str111;
}
str13 = str110;
str14 = str111;
break;
case 3:
newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
str13 = str110;
str14 = str111;
break;
case 4:
newSerializer.text(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 5:
newSerializer.cdsect(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 6:
newSerializer.entityRef(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 7:
newSerializer.ignorableWhitespace(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 8:
newSerializer.processingInstruction(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 9:
newSerializer.comment(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
case 10:
newSerializer.docdecl(xmlPullParser.getText());
str13 = str110;
str14 = str111;
break;
default:
str13 = str110;
str14 = str111;
break;
}
xmlPullParser.nextToken();
str110 = str13;
str111 = str14;
}
str60 = str111;
newSerializer.flush();
byte[] byteArray = byteArrayOutputStream.toByteArray();
Long valueOf3 = Long.valueOf(M2);
if (attributeValue18 != null) {
byteArray = n0.B(attributeValue18);
}
arrayList78.add(Pair.create(valueOf3, new b5.a(attributeValue16, str108, M, n13, byteArray)));
} else {
str10 = str109;
arrayList11 = arrayList77;
str11 = str107;
str12 = str106;
d(xmlPullParser);
}
if (e6.h.g(xmlPullParser7, "EventStream")) {
long[] jArr = new long[arrayList78.size()];
b5.a[] aVarArr = new b5.a[arrayList78.size()];
for (int i49 = 0; i49 < arrayList78.size(); i49++) {
Pair pair = (Pair) arrayList78.get(i49);
jArr[i49] = ((Long) pair.first).longValue();
aVarArr[i49] = (b5.a) pair.second;
}
arrayList12 = arrayList36;
arrayList12.add(new g(attributeValue16, str108, n12, jArr, aVarArr));
} else {
str106 = str12;
arrayList77 = arrayList11;
str107 = str11;
str109 = str10;
}
}
} else {
arrayList7 = arrayList77;
arrayList8 = arrayList36;
str7 = str106;
if (e6.h.i(xmlPullParser7, "SegmentBase")) {
eVar2 = this;
eVar6 = eVar2;
sVar = eVar2.t(xmlPullParser7, null);
} else {
if (e6.h.i(xmlPullParser7, "SegmentList")) {
long f20 = f(xmlPullParser7, -9223372036854775807L);
xmlPullParser2 = xmlPullParser7;
str9 = str2;
eVar = this;
arrayList9 = arrayList7;
str8 = str4;
sVar = u(xmlPullParser, null, j29, k16, j13, f20, k13);
arrayList10 = arrayList8;
j31 = f20;
j11 = -9223372036854775807L;
} else {
xmlPullParser2 = xmlPullParser7;
eVar = this;
arrayList9 = arrayList7;
str8 = str4;
str9 = str2;
if (e6.h.i(xmlPullParser2, str61)) {
long f21 = eVar.f(xmlPullParser2, -9223372036854775807L);
v8.a aVar = y.A;
j11 = -9223372036854775807L;
arrayList10 = arrayList8;
sVar = v(xmlPullParser, null, x0.D, j29, k16, j13, f21, k13);
j31 = f21;
} else {
arrayList10 = arrayList8;
j11 = -9223372036854775807L;
if (e6.h.i(xmlPullParser2, "AssetIdentifier")) {
fVar = j(xmlPullParser2, "AssetIdentifier");
} else {
d(xmlPullParser);
}
}
}
xmlPullParser7 = xmlPullParser2;
eVar6 = eVar;
j32 = j13;
str15 = str5;
if (e6.h.g(xmlPullParser7, str15)) {
Pair create = Pair.create(new h(attributeValue7, k15, arrayList9, arrayList10, fVar), Long.valueOf(k16));
h hVar = (h) create.first;
if (hVar.f7494b != j11) {
str46 = null;
long longValue = ((Long) create.second).longValue();
if (longValue == j11) {
arrayList3 = arrayList4;
j18 = j11;
} else {
j18 = hVar.f7494b + longValue;
arrayList3 = arrayList4;
}
arrayList3.add(hVar);
j25 = j18;
z10 = z12;
} else if (!equals) {
int size2 = arrayList4.size();
StringBuilder sb2 = new StringBuilder(47);
sb2.append("Unable to determine start of period ");
sb2.append(size2);
throw b1.b(sb2.toString(), null);
} else {
arrayList3 = arrayList4;
j25 = j12;
str46 = null;
z10 = true;
}
z12 = z10;
str = str46;
} else {
xmlPullParser6 = xmlPullParser;
str57 = str15;
str58 = str7;
str59 = str9;
str56 = str8;
arrayList32 = arrayList4;
arrayList35 = arrayList9;
str50 = str6;
j25 = j12;
arrayList37 = arrayList6;
arrayList36 = arrayList10;
arrayList34 = arrayList5;
a10 = arrayList2;
arrayList33 = arrayList;
j30 = j10;
str49 = str3;
}
}
}
}
eVar = this;
arrayList10 = arrayList12;
str7 = str12;
arrayList9 = arrayList11;
str8 = str11;
str9 = str10;
j11 = -9223372036854775807L;
eVar6 = eVar;
j32 = j13;
str15 = str5;
if (e6.h.g(xmlPullParser7, str15)) {
}
}
arrayList10 = arrayList8;
j32 = j13;
arrayList9 = arrayList7;
str8 = str4;
str15 = str5;
str9 = str2;
j11 = -9223372036854775807L;
if (e6.h.g(xmlPullParser7, str15)) {
}
}
}
j24 = j10;
r32 = str;
if (!e6.h.g(xmlPullParser, "MPD")) {
if (k10 == j11) {
if (j25 != j11) {
k10 = j25;
} else if (!equals) {
throw b1.b("Unable to determine duration of static manifest.", r32);
}
}
if (arrayList3.isEmpty()) {
throw b1.b("No periods found.", r32);
}
return new c(J, k10, k11, equals, k12, k13, k14, J2, iVar, vVar, tVar, uri, arrayList3);
}
eVar5 = this;
str48 = r32;
arrayList32 = arrayList3;
xmlPullParser6 = xmlPullParser;
j22 = j11;
a10 = arrayList2;
arrayList33 = arrayList;
}
}
arrayList = arrayList33;
arrayList2 = a10;
arrayList3 = arrayList32;
str47 = str48;
j11 = -9223372036854775807L;
}
r32 = str47;
if (!e6.h.g(xmlPullParser, "MPD")) {
}
}
}
@Override
public Object p(Uri uri, InputStream inputStream) {
try {
XmlPullParser newPullParser = this.f7485z.newPullParser();
newPullParser.setInput(inputStream, null);
if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
return o(newPullParser, new b(uri.toString()));
}
throw b1.b("inputStream does not contain a valid media presentation description", null);
} catch (XmlPullParserException e10) {
throw b1.b(null, e10);
}
}
public j q(XmlPullParser xmlPullParser, String str, String str2) {
long j10;
long j11;
String attributeValue = xmlPullParser.getAttributeValue(null, str);
String attributeValue2 = xmlPullParser.getAttributeValue(null, str2);
if (attributeValue2 != null) {
String[] split = attributeValue2.split("-");
j10 = Long.parseLong(split[0]);
if (split.length == 2) {
j11 = (Long.parseLong(split[1]) - j10) + 1;
return new j(attributeValue, j10, j11);
}
} else {
j10 = 0;
}
j11 = -1;
return new j(attributeValue, j10, j11);
}
public int r(String str) {
if (str == null) {
return 0;
}
char c10 = 65535;
switch (str.hashCode()) {
case -2060497896:
if (str.equals("subtitle")) {
c10 = 0;
break;
}
break;
case -1724546052:
if (str.equals("description")) {
c10 = 1;
break;
}
break;
case -1580883024:
if (str.equals("enhanced-audio-intelligibility")) {
c10 = 2;
break;
}
break;
case -1574842690:
if (str.equals("forced_subtitle")) {
c10 = 3;
break;
}
break;
case -1408024454:
if (str.equals("alternate")) {
c10 = 4;
break;
}
break;
case 99825:
if (str.equals("dub")) {
c10 = 5;
break;
}
break;
case 3343801:
if (str.equals("main")) {
c10 = 6;
break;
}
break;
case 3530173:
if (str.equals("sign")) {
c10 = 7;
break;
}
break;
case 552573414:
if (str.equals("caption")) {
c10 = '\b';
break;
}
break;
case 899152809:
if (str.equals("commentary")) {
c10 = '\t';
break;
}
break;
case 1629013393:
if (str.equals("emergency")) {
c10 = '\n';
break;
}
break;
case 1855372047:
if (str.equals("supplementary")) {
c10 = 11;
break;
}
break;
}
switch (c10) {
case 0:
case 3:
return 128;
case 1:
return 512;
case 2:
return 2048;
case 4:
return 2;
case 5:
return 16;
case 6:
return 1;
case 7:
return 256;
case '\b':
return 64;
case '\t':
return 8;
case '\n':
return 32;
case 11:
return 4;
default:
return 0;
}
}
public int s(List list) {
int i10 = 0;
for (int i11 = 0; i11 < list.size(); i11++) {
if (c6.i.a("http://dashif.org/guidelines/trickmode", ((f) list.get(i11)).f7486a)) {
i10 |= 16384;
}
}
return i10;
}
public r t(XmlPullParser xmlPullParser, r rVar) {
long j10;
long j11;
long n10 = n(xmlPullParser, "timescale", rVar != null ? rVar.f7522b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", rVar != null ? rVar.f7523c : 0L);
long j12 = rVar != null ? rVar.f7519d : 0L;
long j13 = rVar != null ? rVar.f7520e : 0L;
String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
if (attributeValue != null) {
String[] split = attributeValue.split("-");
long parseLong = Long.parseLong(split[0]);
j10 = (Long.parseLong(split[1]) - parseLong) + 1;
j11 = parseLong;
} else {
j10 = j13;
j11 = j12;
}
j jVar = rVar != null ? rVar.f7521a : null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "Initialization")) {
jVar = q(xmlPullParser, "sourceURL", "range");
} else {
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, "SegmentBase"));
return new r(jVar, n10, n11, j11, j10);
}
public o u(XmlPullParser xmlPullParser, o oVar, long j10, long j11, long j12, long j13, long j14) {
j jVar;
ArrayList arrayList;
List list;
long n10 = n(xmlPullParser, "timescale", oVar != null ? oVar.f7522b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", oVar != null ? oVar.f7523c : 0L);
long n12 = n(xmlPullParser, "duration", oVar != null ? oVar.f7508e : -9223372036854775807L);
long n13 = n(xmlPullParser, "startNumber", oVar != null ? oVar.f7507d : 1L);
long c10 = c(j12, j13);
List list2 = null;
ArrayList arrayList2 = null;
j jVar2 = null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "Initialization")) {
jVar2 = q(xmlPullParser, "sourceURL", "range");
} else if (e6.h.i(xmlPullParser, "SegmentTimeline")) {
list2 = w(xmlPullParser, n10, j11);
} else if (e6.h.i(xmlPullParser, "SegmentURL")) {
if (arrayList2 == null) {
arrayList2 = new ArrayList();
}
ArrayList arrayList3 = arrayList2;
arrayList3.add(q(xmlPullParser, "media", "mediaRange"));
arrayList2 = arrayList3;
} else {
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, "SegmentList"));
if (oVar != null) {
if (jVar2 == null) {
jVar2 = oVar.f7521a;
}
if (list2 == null) {
list2 = oVar.f7509f;
}
if (arrayList2 == null) {
list = list2;
jVar = jVar2;
arrayList = oVar.f7513j;
return new o(jVar, n10, n11, n13, n12, list, c10, arrayList, g4.h.b(j14), g4.h.b(j10));
}
}
jVar = jVar2;
arrayList = arrayList2;
list = list2;
return new o(jVar, n10, n11, n13, n12, list, c10, arrayList, g4.h.b(j14), g4.h.b(j10));
}
public p v(XmlPullParser xmlPullParser, p pVar, List list, long j10, long j11, long j12, long j13, long j14) {
long j15;
long n10 = n(xmlPullParser, "timescale", pVar != null ? pVar.f7522b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", pVar != null ? pVar.f7523c : 0L);
long n12 = n(xmlPullParser, "duration", pVar != null ? pVar.f7508e : -9223372036854775807L);
long n13 = n(xmlPullParser, "startNumber", pVar != null ? pVar.f7507d : 1L);
int i10 = 0;
while (true) {
if (i10 >= list.size()) {
j15 = -1;
break;
}
f fVar = (f) list.get(i10);
if (c6.i.a("http://dashif.org/guidelines/last-segment-number", fVar.f7486a)) {
j15 = Long.parseLong(fVar.f7487b);
break;
}
i10++;
}
long j16 = j15;
long c10 = c(j12, j13);
List list2 = null;
w4.j0 y10 = y(xmlPullParser, "media", pVar != null ? pVar.f7515k : null);
w4.j0 y11 = y(xmlPullParser, "initialization", pVar != null ? pVar.f7514j : null);
j jVar = null;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "Initialization")) {
jVar = q(xmlPullParser, "sourceURL", "range");
} else if (e6.h.i(xmlPullParser, "SegmentTimeline")) {
list2 = w(xmlPullParser, n10, j11);
} else {
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, "SegmentTemplate"));
if (pVar != null) {
if (jVar == null) {
jVar = pVar.f7521a;
}
if (list2 == null) {
list2 = pVar.f7509f;
}
}
return new p(jVar, n10, n11, n13, j16, n12, list2, c10, y11, y10, g4.h.b(j14), g4.h.b(j10));
}
public List w(XmlPullParser xmlPullParser, long j10, long j11) {
ArrayList arrayList = new ArrayList();
long j12 = 0;
long j13 = -9223372036854775807L;
boolean z10 = false;
int i10 = 0;
do {
xmlPullParser.next();
if (e6.h.i(xmlPullParser, "S")) {
long n10 = n(xmlPullParser, "t", -9223372036854775807L);
if (z10) {
j12 = a(arrayList, j12, j13, i10, n10);
}
if (n10 == -9223372036854775807L) {
n10 = j12;
}
j13 = n(xmlPullParser, "d", -9223372036854775807L);
i10 = m(xmlPullParser, "r", 0);
j12 = n10;
z10 = true;
} else {
d(xmlPullParser);
}
} while (!e6.h.g(xmlPullParser, "SegmentTimeline"));
if (z10) {
a(arrayList, j12, j13, i10, n0.M(j11, j10, 1000L));
}
return arrayList;
}
public w4.j0 y(XmlPullParser xmlPullParser, String str, w4.j0 j0Var) {
String str2;
String attributeValue = xmlPullParser.getAttributeValue(null, str);
if (attributeValue != null) {
String[] strArr = new String[5];
int[] iArr = new int[4];
String[] strArr2 = new String[4];
strArr[0] = BuildConfig.FLAVOR;
int i10 = 0;
int i11 = 0;
while (i10 < attributeValue.length()) {
int indexOf = attributeValue.indexOf("$", i10);
char c10 = 65535;
if (indexOf == -1) {
String valueOf = String.valueOf(strArr[i11]);
String valueOf2 = String.valueOf(attributeValue.substring(i10));
strArr[i11] = valueOf2.length() != 0 ? valueOf.concat(valueOf2) : new String(valueOf);
i10 = attributeValue.length();
} else if (indexOf != i10) {
String valueOf3 = String.valueOf(strArr[i11]);
String valueOf4 = String.valueOf(attributeValue.substring(i10, indexOf));
strArr[i11] = valueOf4.length() != 0 ? valueOf3.concat(valueOf4) : new String(valueOf3);
i10 = indexOf;
} else if (attributeValue.startsWith("$$", i10)) {
strArr[i11] = String.valueOf(strArr[i11]).concat("$");
i10 += 2;
} else {
int i12 = i10 + 1;
int indexOf2 = attributeValue.indexOf("$", i12);
String substring = attributeValue.substring(i12, indexOf2);
if (substring.equals("RepresentationID")) {
iArr[i11] = 1;
} else {
int indexOf3 = substring.indexOf("%0");
if (indexOf3 != -1) {
str2 = substring.substring(indexOf3);
if (!str2.endsWith("d") && !str2.endsWith("x")) {
str2 = str2.concat("d");
}
substring = substring.substring(0, indexOf3);
} else {
str2 = "%01d";
}
Objects.requireNonNull(substring);
switch (substring.hashCode()) {
case -1950496919:
if (substring.equals("Number")) {
c10 = 0;
break;
}
break;
case 2606829:
if (substring.equals("Time")) {
c10 = 1;
break;
}
break;
case 38199441:
if (substring.equals("Bandwidth")) {
c10 = 2;
break;
}
break;
}
switch (c10) {
case 0:
iArr[i11] = 2;
break;
case 1:
iArr[i11] = 4;
break;
case 2:
iArr[i11] = 3;
break;
default:
throw new IllegalArgumentException(attributeValue.length() != 0 ? "Invalid template: ".concat(attributeValue) : new String("Invalid template: "));
}
strArr2[i11] = str2;
}
i11++;
strArr[i11] = BuildConfig.FLAVOR;
i10 = indexOf2 + 1;
}
}
return new w4.j0(strArr, iArr, strArr2, i11);
}
return j0Var;
}
}