涩里番 v4.2版本的 MD5 值为:b7af51031b798a68c7a3a9ba5a0dff66
以下内容为反编译后的 c.java 源代码,内容仅作参考
package b6;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
import android.util.Xml;
import b6.i;
import b6.j;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.metadata.emsg.EventMessage;
import com.google.android.material.shadow.ShadowDrawableWrapper;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import l.o;
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 r6.z;
import t6.u;
import t6.w;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
public final class c extends DefaultHandler implements z.a<b> {
public static final Pattern f3279b = Pattern.compile("(\\d+)(?:/(\\d+))?");
public static final Pattern f3280c = Pattern.compile("CC([1-4])=.*");
public static final Pattern f3281d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
public final XmlPullParserFactory f3282a;
public static final class a {
public final Format f3283a;
public final String f3284b;
public final j f3285c;
public final String f3286d;
public final ArrayList<DrmInitData.SchemeData> f3287e;
public final ArrayList<d> f3288f;
public final long f3289g = -1;
public a(Format format, String str, j jVar, String str2, ArrayList arrayList, ArrayList arrayList2) {
this.f3283a = format;
this.f3284b = str;
this.f3285c = jVar;
this.f3286d = str2;
this.f3287e = arrayList;
this.f3288f = arrayList2;
}
}
public c() {
try {
this.f3282a = XmlPullParserFactory.newInstance();
} catch (XmlPullParserException e10) {
throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e10);
}
}
public static void c(XmlPullParser xmlPullParser) {
if (t6.a.s(xmlPullParser)) {
int i2 = 1;
while (i2 != 0) {
xmlPullParser.next();
if (t6.a.s(xmlPullParser)) {
i2++;
} else {
if (xmlPullParser.getEventType() == 3) {
i2--;
}
}
}
}
}
public static boolean d(String str) {
return t6.j.i(str) || "application/ttml+xml".equals(str) || "application/x-mp4-vtt".equals(str) || "application/cea-708".equals(str) || "application/cea-608".equals(str);
}
public static d j(XmlPullParser xmlPullParser, String str) {
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue == null) {
attributeValue = "";
}
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 (!t6.a.q(xmlPullParser, str));
return new d(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 = w.f15220h.matcher(attributeValue);
if (matcher.matches()) {
boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1));
String group = matcher.group(3);
double d10 = ShadowDrawableWrapper.COS_45;
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);
if (group6 != null) {
d10 = Double.parseDouble(group6);
}
long j11 = (long) ((parseDouble5 + d10) * 1000.0d);
return isEmpty ? -j11 : j11;
}
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 = f3279b.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 i2) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
return attributeValue == null ? i2 : 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 u(XmlPullParser xmlPullParser, String str) {
String str2 = "";
do {
xmlPullParser.next();
if (xmlPullParser.getEventType() == 4) {
str2 = xmlPullParser.getText();
} else {
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, str));
return str2;
}
@Override
public final b a(Uri uri, InputStream inputStream) {
try {
XmlPullParser newPullParser = this.f3282a.newPullParser();
newPullParser.setInput(inputStream, null);
if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
return o(newPullParser, uri.toString());
}
throw new x4.z("inputStream does not contain a valid media presentation description");
} catch (XmlPullParserException e10) {
throw new x4.z(e10);
}
}
public final long b(List<j.d> list, long j10, long j11, int i2, long j12) {
int i10;
if (i2 >= 0) {
i10 = i2 + 1;
} else {
int i11 = w.f15213a;
i10 = (int) ((((j12 - j10) + j11) - 1) / j11);
}
for (int i12 = 0; i12 < i10; i12++) {
list.add(new j.d(j10, j11));
j10 += j11;
}
return j10;
}
public final int e(XmlPullParser xmlPullParser) {
String M;
char c10;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue == null) {
attributeValue = null;
}
int i2 = -1;
if ("urn:mpeg:dash:23003:3:audio_channel_configuration:2011".equals(attributeValue)) {
i2 = m(xmlPullParser, "value", -1);
} else if (("tag:dolby.com,2014:dash:audio_channel_configuration:2011".equals(attributeValue) || "urn:dolby:dash:audio_channel_configuration:2011".equals(attributeValue)) && (M = w.M(xmlPullParser.getAttributeValue(null, "value"))) != null) {
switch (M.hashCode()) {
case 1596796:
if (M.equals("4000")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case 2937391:
if (M.equals("a000")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case 3094035:
if (M.equals("f801")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case 3133436:
if (M.equals("fa01")) {
c10 = 3;
break;
}
c10 = 65535;
break;
default:
c10 = 65535;
break;
}
if (c10 == 0) {
i2 = 1;
} else if (c10 == 1) {
i2 = 2;
} else if (c10 == 2) {
i2 = 6;
} else if (c10 == 3) {
i2 = 8;
}
}
do {
xmlPullParser.next();
} while (!t6.a.q(xmlPullParser, "AudioChannelConfiguration"));
return i2;
}
public final String f(XmlPullParser xmlPullParser, String str) {
return u.c(str, u(xmlPullParser, "BaseURL"));
}
public final Pair<String, DrmInitData.SchemeData> g(XmlPullParser xmlPullParser) {
String str;
UUID uuid;
byte[] bArr;
String str2;
boolean z10;
UUID b10;
char c10;
UUID uuid2;
String str3;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue != null) {
String M = w.M(attributeValue);
Objects.requireNonNull(M);
int hashCode = M.hashCode();
if (hashCode == 489446379) {
if (M.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) {
c10 = 0;
if (c10 != 0) {
}
uuid = uuid2;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid2;
str = null;
} else if (hashCode != 755418770) {
if (hashCode == 1812765994 && M.equals("urn:mpeg:dash:mp4protection:2011")) {
c10 = 2;
if (c10 != 0) {
uuid2 = x4.f.f17188e;
} else if (c10 == 1) {
uuid2 = x4.f.f17187d;
} else if (c10 == 2) {
str = xmlPullParser.getAttributeValue(null, "value");
int attributeCount = xmlPullParser.getAttributeCount();
int i2 = 0;
while (true) {
if (i2 >= attributeCount) {
str3 = null;
break;
}
String attributeName = xmlPullParser.getAttributeName(i2);
int indexOf = attributeName.indexOf(58);
if (indexOf != -1) {
attributeName = attributeName.substring(indexOf + 1);
}
if (attributeName.equals("default_KID")) {
str3 = xmlPullParser.getAttributeValue(i2);
break;
}
i2++;
}
if (!TextUtils.isEmpty(str3) && !"00000000-0000-0000-0000-000000000000".equals(str3)) {
String[] split = str3.split("\\s+");
UUID[] uuidArr = new UUID[split.length];
for (int i10 = 0; i10 < split.length; i10++) {
uuidArr[i10] = UUID.fromString(split[i10]);
}
uuid = x4.f.f17185b;
bArr = k5.g.a(uuid, uuidArr, null);
str2 = null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "ms:laurl")) {
str2 = xmlPullParser.getAttributeValue(null, "licenseUrl");
} else {
if (bArr == null) {
if (t6.a.s(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);
b10 = k5.g.b(decode);
if (b10 != null) {
uuid = b10;
bArr = null;
} else {
bArr = decode;
uuid = b10;
}
}
}
}
z10 = false;
if (z10) {
byte[] decode2 = Base64.decode(xmlPullParser.getText(), 0);
b10 = k5.g.b(decode2);
if (b10 != null) {
}
}
}
if (bArr == null) {
UUID uuid3 = x4.f.f17188e;
if (uuid3.equals(uuid) && t6.a.t(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
bArr = k5.g.a(uuid3, null, Base64.decode(xmlPullParser.getText(), 0));
}
}
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
}
uuid = null;
}
uuid = uuid2;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid2;
str = null;
} else {
if (M.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) {
c10 = 1;
if (c10 != 0) {
}
uuid = uuid2;
str = null;
}
c10 = 65535;
if (c10 != 0) {
}
uuid = uuid2;
str = null;
}
bArr = null;
str2 = null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "ms:laurl")) {
}
} while (!t6.a.q(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
}
str = null;
uuid = null;
bArr = null;
str2 = null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "ms:laurl")) {
}
} while (!t6.a.q(xmlPullParser, "ContentProtection"));
return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
}
public final int h(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 final int i(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 -1408024454:
if (str.equals("alternate")) {
c10 = 3;
break;
}
break;
case 99825:
if (str.equals("dub")) {
c10 = 4;
break;
}
break;
case 3343801:
if (str.equals("main")) {
c10 = 5;
break;
}
break;
case 3530173:
if (str.equals("sign")) {
c10 = 6;
break;
}
break;
case 552573414:
if (str.equals("caption")) {
c10 = 7;
break;
}
break;
case 899152809:
if (str.equals("commentary")) {
c10 = '\b';
break;
}
break;
case 1629013393:
if (str.equals("emergency")) {
c10 = '\t';
break;
}
break;
case 1855372047:
if (str.equals("supplementary")) {
c10 = '\n';
break;
}
break;
}
switch (c10) {
case 0:
return 128;
case 1:
return 512;
case 2:
return 2048;
case 3:
return 2;
case 4:
return 16;
case 5:
return 1;
case 6:
return 256;
case 7:
return 64;
case '\b':
return 8;
case '\t':
return 32;
case '\n':
return 4;
default:
return 0;
}
}
public final b o(XmlPullParser xmlPullParser, String str) {
ArrayList arrayList;
long j10;
String str2;
long j11;
long j12;
long j13;
boolean z10;
String str3;
String str4;
String str5;
String str6;
long j14;
String str7;
String str8;
String str9;
ArrayList arrayList2;
long j15;
ArrayList arrayList3;
ArrayList arrayList4;
String str10;
String str11;
c cVar;
long j16;
XmlPullParser xmlPullParser2;
XmlPullParser xmlPullParser3;
long j17;
String str12;
ArrayList arrayList5;
String str13;
String str14;
ArrayList arrayList6;
int i2;
String str15;
String str16;
String str17;
ArrayList arrayList7;
ArrayList arrayList8;
int i10;
float f10;
String str18;
String str19;
ArrayList arrayList9;
String str20;
int i11;
XmlPullParser xmlPullParser4;
String str21;
int i12;
String str22;
String str23;
ArrayList arrayList10;
String str24;
String str25;
String str26;
ArrayList arrayList11;
XmlPullParser xmlPullParser5;
j s10;
String str27;
c cVar2;
String str28;
String str29;
String str30;
ArrayList arrayList12;
String str31;
String str32;
int i13;
String str33;
String str34;
ArrayList arrayList13;
j s11;
String str35;
int e10;
String str36;
String str37;
String str38;
String str39;
String str40;
int i14;
String str41;
ArrayList arrayList14;
ArrayList arrayList15;
int i15;
int i16;
int i17;
Format D;
String str42;
int i18;
int i19;
int i20;
int i21;
String str43;
int parseInt;
String str44;
String str45;
int i22;
char c10;
String str46;
ArrayList arrayList16;
i aVar;
ArrayList arrayList17;
String str47;
c cVar3;
Uri uri;
long j18;
c cVar4 = this;
XmlPullParser xmlPullParser6 = xmlPullParser;
String attributeValue = xmlPullParser6.getAttributeValue(null, "availabilityStartTime");
long E = attributeValue == null ? -9223372036854775807L : w.E(attributeValue);
long k10 = k(xmlPullParser6, "mediaPresentationDuration", -9223372036854775807L);
long k11 = k(xmlPullParser6, "minBufferTime", -9223372036854775807L);
boolean equals = "dynamic".equals(xmlPullParser6.getAttributeValue(null, IjkMediaMeta.IJKM_KEY_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 E2 = attributeValue2 == null ? -9223372036854775807L : w.E(attributeValue2);
ArrayList arrayList18 = new ArrayList();
long j19 = equals ? -9223372036854775807L : 0L;
String str48 = str;
Uri uri2 = null;
g gVar = null;
q2.a aVar2 = null;
XmlPullParser xmlPullParser7 = xmlPullParser6;
boolean z11 = false;
boolean z12 = false;
while (true) {
xmlPullParser.next();
String str49 = "BaseURL";
if (!t6.a.t(xmlPullParser7, "BaseURL")) {
arrayList = arrayList18;
j10 = k12;
String str50 = "lang";
if (t6.a.t(xmlPullParser7, "ProgramInformation")) {
str2 = str48;
String attributeValue3 = xmlPullParser7.getAttributeValue(null, "moreInformationURL");
String str51 = attributeValue3 == null ? null : attributeValue3;
String attributeValue4 = xmlPullParser7.getAttributeValue(null, "lang");
if (attributeValue4 == null) {
attributeValue4 = null;
}
String str52 = attributeValue4;
String str53 = null;
String str54 = null;
String str55 = null;
do {
xmlPullParser.next();
String str56 = str53;
if (t6.a.t(xmlPullParser7, "Title")) {
str53 = xmlPullParser.nextText();
} else {
if (t6.a.t(xmlPullParser7, "Source")) {
str54 = xmlPullParser.nextText();
} else if (t6.a.t(xmlPullParser7, "Copyright")) {
str55 = xmlPullParser.nextText();
} else {
c(xmlPullParser);
}
str53 = str56;
}
} while (!t6.a.q(xmlPullParser7, "ProgramInformation"));
gVar = new g(str53, str54, str55, str51, str52);
j11 = k11;
} else {
str2 = str48;
j11 = k11;
String str57 = "schemeIdUri";
if (t6.a.t(xmlPullParser7, "UTCTiming")) {
aVar2 = new q2.a(xmlPullParser7.getAttributeValue(null, "schemeIdUri"), xmlPullParser7.getAttributeValue(null, "value"), 1);
} else if (t6.a.t(xmlPullParser7, "Location")) {
uri2 = Uri.parse(xmlPullParser.nextText());
} else {
String str58 = "Period";
if (t6.a.t(xmlPullParser7, "Period") && !z12) {
String str59 = "id";
String str60 = "value";
String attributeValue5 = xmlPullParser7.getAttributeValue(null, "id");
long k15 = k(xmlPullParser7, "start", j19);
String str61 = "duration";
long j20 = j19;
long k16 = k(xmlPullParser7, "duration", -9223372036854775807L);
j12 = E;
ArrayList arrayList19 = new ArrayList();
ArrayList arrayList20 = new ArrayList();
j13 = k10;
z10 = equals;
String str62 = str2;
j jVar = null;
boolean z13 = false;
XmlPullParser xmlPullParser8 = xmlPullParser7;
c cVar5 = cVar4;
c cVar6 = cVar5;
while (true) {
xmlPullParser.next();
if (!t6.a.t(xmlPullParser7, str49)) {
str3 = str62;
c cVar7 = cVar5;
str4 = str58;
c cVar8 = cVar6;
if (t6.a.t(xmlPullParser7, "AdaptationSet")) {
String str63 = str61;
int m2 = m(xmlPullParser7, str59, -1);
int h10 = h(xmlPullParser);
ArrayList arrayList21 = arrayList20;
String str64 = "mimeType";
String attributeValue6 = xmlPullParser7.getAttributeValue(null, "mimeType");
String str65 = str57;
String str66 = "codecs";
String attributeValue7 = xmlPullParser7.getAttributeValue(null, "codecs");
String str67 = "width";
ArrayList arrayList22 = arrayList19;
String str68 = "AdaptationSet";
int m10 = m(xmlPullParser7, "width", -1);
int m11 = m(xmlPullParser7, "height", -1);
String str69 = "SegmentTemplate";
float l10 = l(xmlPullParser7, -1.0f);
long j21 = k16;
int m12 = m(xmlPullParser7, "audioSamplingRate", -1);
String str70 = "SegmentList";
String attributeValue8 = xmlPullParser7.getAttributeValue(null, str50);
String str71 = "SegmentBase";
String attributeValue9 = xmlPullParser7.getAttributeValue(null, "label");
ArrayList arrayList23 = new ArrayList();
ArrayList arrayList24 = new ArrayList();
ArrayList arrayList25 = new ArrayList();
String str72 = attributeValue9;
ArrayList arrayList26 = new ArrayList();
ArrayList arrayList27 = new ArrayList();
String str73 = "audioSamplingRate";
String str74 = "height";
int i23 = m11;
String str75 = str3;
j jVar2 = jVar;
String str76 = null;
boolean z14 = false;
int i24 = -1;
XmlPullParser xmlPullParser9 = xmlPullParser;
ArrayList arrayList28 = new ArrayList();
int i25 = h10;
int i26 = m12;
c cVar9 = cVar7;
float f11 = l10;
String str77 = attributeValue8;
while (true) {
xmlPullParser.next();
if (!t6.a.t(xmlPullParser9, str49)) {
if (t6.a.t(xmlPullParser9, "ContentProtection")) {
Pair<String, DrmInitData.SchemeData> g8 = g(xmlPullParser);
str14 = str75;
Object obj = g8.first;
if (obj != null) {
str76 = (String) obj;
}
Object obj2 = g8.second;
if (obj2 != null) {
arrayList23.add(obj2);
}
} else {
str14 = str75;
if (t6.a.t(xmlPullParser9, "ContentComponent")) {
String attributeValue10 = xmlPullParser9.getAttributeValue(null, str50);
if (str77 == null) {
str77 = attributeValue10;
} else if (attributeValue10 != null) {
t6.a.i(str77.equals(attributeValue10));
}
int h11 = h(xmlPullParser);
if (i25 == -1) {
i25 = h11;
} else if (h11 != -1) {
t6.a.i(i25 == h11);
}
} else if (t6.a.t(xmlPullParser9, "Role")) {
arrayList26.add(j(xmlPullParser9, "Role"));
arrayList6 = arrayList26;
str5 = str60;
str6 = str49;
str7 = str59;
arrayList9 = arrayList27;
xmlPullParser5 = xmlPullParser9;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
str25 = str69;
j14 = j21;
str24 = str70;
f10 = f11;
arrayList11 = arrayList24;
str19 = str73;
arrayList10 = arrayList6;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
i2 = i25;
str21 = str67;
i12 = m10;
str26 = str71;
i25 = i2;
str27 = str68;
xmlPullParser9 = xmlPullParser5;
if (t6.a.q(xmlPullParser9, str27)) {
}
} else {
String str78 = "AudioChannelConfiguration";
if (t6.a.t(xmlPullParser9, "AudioChannelConfiguration")) {
i24 = e(xmlPullParser);
} else {
arrayList6 = arrayList26;
if (t6.a.t(xmlPullParser9, "Accessibility")) {
arrayList25.add(j(xmlPullParser9, "Accessibility"));
} else if (t6.a.t(xmlPullParser9, "SupplementalProperty")) {
arrayList27.add(j(xmlPullParser9, "SupplementalProperty"));
} else {
ArrayList arrayList29 = arrayList27;
str9 = str50;
if (t6.a.t(xmlPullParser9, "Representation")) {
String str79 = "SupplementalProperty";
String attributeValue11 = xmlPullParser9.getAttributeValue(null, str59);
int i27 = i25;
int m13 = m(xmlPullParser9, "bandwidth", -1);
String attributeValue12 = xmlPullParser9.getAttributeValue(null, str64);
if (attributeValue12 == null) {
attributeValue12 = attributeValue6;
}
String attributeValue13 = xmlPullParser9.getAttributeValue(null, str66);
if (attributeValue13 == null) {
attributeValue13 = attributeValue7;
}
int m14 = m(xmlPullParser9, str67, m10);
str15 = str64;
String str80 = str74;
i12 = m10;
int i28 = i23;
int m15 = m(xmlPullParser9, str80, i28);
float f12 = f11;
float l11 = l(xmlPullParser9, f12);
String str81 = attributeValue12;
String str82 = str73;
int i29 = i26;
String str83 = "ContentProtection";
int i30 = i29;
int m16 = m(xmlPullParser9, str82, i30);
XmlPullParser xmlPullParser10 = xmlPullParser9;
ArrayList arrayList30 = new ArrayList();
f10 = f12;
ArrayList arrayList31 = new ArrayList();
i11 = i28;
ArrayList arrayList32 = new ArrayList();
boolean z15 = false;
String str84 = null;
str17 = str66;
arrayList7 = arrayList23;
XmlPullParser xmlPullParser11 = xmlPullParser10;
int i31 = i24;
j jVar3 = jVar2;
String str85 = str14;
while (true) {
xmlPullParser.next();
if (t6.a.t(xmlPullParser11, str49)) {
if (z15) {
str16 = str77;
arrayList9 = arrayList29;
cVar2 = this;
} else {
str16 = str77;
arrayList9 = arrayList29;
cVar2 = this;
str85 = cVar2.f(xmlPullParser11, str85);
z15 = true;
}
str28 = str78;
str29 = str71;
str35 = attributeValue13;
} else {
str16 = str77;
arrayList9 = arrayList29;
cVar2 = this;
if (t6.a.t(xmlPullParser11, str78)) {
str5 = str60;
str31 = attributeValue13;
str6 = str49;
str7 = str59;
str28 = str78;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
str34 = str83;
j14 = j21;
str33 = str71;
e10 = e(xmlPullParser);
i13 = i27;
str36 = str84;
str19 = str82;
str21 = str67;
str30 = str85;
str22 = str69;
str23 = str70;
arrayList13 = arrayList6;
str32 = str79;
arrayList12 = arrayList28;
i10 = i30;
if (t6.a.q(xmlPullParser11, "Representation")) {
xmlPullParser11 = xmlPullParser;
str84 = str36;
i31 = e10;
str83 = str34;
str79 = str32;
str67 = str21;
str82 = str19;
i30 = i10;
arrayList28 = arrayList12;
str85 = str30;
str69 = str22;
arrayList6 = arrayList13;
str70 = str23;
str78 = str28;
attributeValue13 = str31;
str77 = str16;
arrayList29 = arrayList9;
str49 = str6;
j21 = j14;
i27 = i13;
arrayList = arrayList2;
str60 = str5;
str59 = str7;
str63 = str8;
str71 = str33;
j20 = j15;
} else {
if (t6.j.h(str81)) {
str40 = t6.j.a(str31);
} else if (t6.j.j(str81)) {
str40 = t6.j.g(str31);
} else if (d(str81)) {
str40 = str81;
} else {
str37 = str81;
if (!"application/mp4".equals(str37)) {
str38 = str31;
if ("application/x-rawcc".equals(str37) && str38 != null) {
if (str38.contains("cea708")) {
str39 = "application/cea-708";
} else if (str38.contains("eia608") || str38.contains("cea608")) {
str39 = "application/cea-608";
}
i14 = 0;
while (true) {
str41 = "urn:mpeg:dash:role:2011";
if (i14 < arrayList13.size()) {
}
i14++;
arrayList31 = arrayList14;
arrayList13 = arrayList15;
}
i16 = 0;
int i32 = 0;
while (i16 < arrayList15.size()) {
}
arrayList10 = arrayList15;
i17 = 0;
int i33 = 0;
while (i17 < arrayList25.size()) {
}
ArrayList arrayList33 = arrayList30;
int i34 = i32 | i33;
if (str39 != null) {
}
D = Format.D(attributeValue11, null, str37, str39, str38, m13, i15, i34, str16);
a aVar3 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList33, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar3);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
str39 = null;
i14 = 0;
while (true) {
str41 = "urn:mpeg:dash:role:2011";
if (i14 < arrayList13.size()) {
}
i14++;
arrayList31 = arrayList14;
arrayList13 = arrayList15;
}
i16 = 0;
int i322 = 0;
while (i16 < arrayList15.size()) {
}
arrayList10 = arrayList15;
i17 = 0;
int i332 = 0;
while (i17 < arrayList25.size()) {
}
ArrayList arrayList332 = arrayList30;
int i342 = i322 | i332;
if (str39 != null) {
}
D = Format.D(attributeValue11, null, str37, str39, str38, m13, i15, i342, str16);
a aVar32 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList332, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar32);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
} else {
str38 = str31;
if (str38 != null) {
if (str38.startsWith("stpp")) {
str39 = "application/ttml+xml";
} else if (str38.startsWith("wvtt")) {
str39 = "application/x-mp4-vtt";
}
i14 = 0;
while (true) {
str41 = "urn:mpeg:dash:role:2011";
if (i14 < arrayList13.size()) {
arrayList15 = arrayList13;
d dVar = (d) arrayList15.get(i14);
arrayList14 = arrayList31;
if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar.f3290a) && "main".equals(dVar.f3291b)) {
i15 = 1;
} else {
i14++;
arrayList31 = arrayList14;
arrayList13 = arrayList15;
}
} else {
arrayList14 = arrayList31;
arrayList15 = arrayList13;
i15 = 0;
}
}
i16 = 0;
int i3222 = 0;
while (i16 < arrayList15.size()) {
d dVar2 = (d) arrayList15.get(i16);
ArrayList arrayList34 = arrayList15;
if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar2.f3290a)) {
i3222 |= cVar2.i(dVar2.f3291b);
}
i16++;
arrayList15 = arrayList34;
}
arrayList10 = arrayList15;
i17 = 0;
int i3322 = 0;
while (i17 < arrayList25.size()) {
d dVar3 = (d) arrayList25.get(i17);
ArrayList arrayList35 = arrayList30;
if (str41.equalsIgnoreCase(dVar3.f3290a)) {
i3322 = cVar2.i(dVar3.f3291b) | i3322;
str45 = str41;
} else {
str45 = str41;
if ("urn:tva:metadata:cs:AudioPurposeCS:2007".equalsIgnoreCase(dVar3.f3290a)) {
String str86 = dVar3.f3291b;
if (str86 != null) {
switch (str86.hashCode()) {
case 49:
if (str86.equals("1")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case 50:
if (str86.equals("2")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case 51:
if (str86.equals("3")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case 52:
if (str86.equals("4")) {
c10 = 3;
break;
}
c10 = 65535;
break;
case 53:
default:
c10 = 65535;
break;
case 54:
if (str86.equals("6")) {
c10 = 4;
break;
}
c10 = 65535;
break;
}
if (c10 == 0) {
i22 = 512;
} else if (c10 == 1) {
i22 = 2048;
} else if (c10 == 2) {
i22 = 4;
} else if (c10 == 3) {
i22 = 8;
} else if (c10 == 4) {
i22 = 1;
}
i3322 = i22 | i3322;
}
i22 = 0;
i3322 = i22 | i3322;
}
}
i17++;
arrayList30 = arrayList35;
str41 = str45;
}
ArrayList arrayList3322 = arrayList30;
int i3422 = i3222 | i3322;
if (str39 != null) {
String str87 = "audio/eac3";
if ("audio/eac3".equals(str39)) {
for (int i35 = 0; i35 < arrayList32.size(); i35++) {
d dVar4 = (d) arrayList32.get(i35);
String str88 = dVar4.f3290a;
if (("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str88) && "JOC".equals(dVar4.f3291b)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str88) && "ec+3".equals(dVar4.f3291b))) {
str87 = "audio/eac3-joc";
str39 = str87;
}
}
str39 = str87;
}
if (t6.j.j(str39)) {
D = Format.K(attributeValue11, null, str37, str39, str38, null, m13, m14, m15, l11, null, i15, i3422);
} else if (t6.j.h(str39)) {
D = Format.z(attributeValue11, null, str37, str39, str38, null, m13, e10, m16, null, i15, i3422, str16);
} else if (d(str39)) {
if ("application/cea-608".equals(str39)) {
for (int i36 = 0; i36 < arrayList25.size(); i36++) {
d dVar5 = (d) arrayList25.get(i36);
if ("urn:scte:dash:cc:cea-608:2015".equals(dVar5.f3290a) && (str44 = dVar5.f3291b) != null) {
Matcher matcher = f3280c.matcher(str44);
if (matcher.matches()) {
parseInt = Integer.parseInt(matcher.group(1));
i21 = parseInt;
D = Format.H(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16, i21);
}
}
}
parseInt = -1;
i21 = parseInt;
D = Format.H(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16, i21);
} else if ("application/cea-708".equals(str39)) {
for (int i37 = 0; i37 < arrayList25.size(); i37++) {
d dVar6 = (d) arrayList25.get(i37);
if ("urn:scte:dash:cc:cea-708:2015".equals(dVar6.f3290a) && (str43 = dVar6.f3291b) != null) {
Matcher matcher2 = f3281d.matcher(str43);
if (matcher2.matches()) {
parseInt = Integer.parseInt(matcher2.group(1));
i21 = parseInt;
D = Format.H(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16, i21);
}
}
}
parseInt = -1;
i21 = parseInt;
D = Format.H(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16, i21);
} else {
i21 = -1;
D = Format.H(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16, i21);
}
}
a aVar322 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList3322, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
if (t6.j.j(str42)) {
i18 = -1;
i19 = 2;
} else if (t6.j.h(str42)) {
i18 = -1;
i19 = 1;
} else if (d(str42)) {
i18 = -1;
i19 = 3;
}
i20 = i13;
if (i20 != i18) {
if (i19 != i18) {
t6.a.i(i20 == i19);
}
i19 = i20;
}
arrayList8 = arrayList12;
arrayList8.add(aVar322);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar322);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
D = Format.D(attributeValue11, null, str37, str39, str38, m13, i15, i3422, str16);
a aVar3222 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList3322, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar3222);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
str39 = null;
i14 = 0;
while (true) {
str41 = "urn:mpeg:dash:role:2011";
if (i14 < arrayList13.size()) {
}
i14++;
arrayList31 = arrayList14;
arrayList13 = arrayList15;
}
i16 = 0;
int i32222 = 0;
while (i16 < arrayList15.size()) {
}
arrayList10 = arrayList15;
i17 = 0;
int i33222 = 0;
while (i17 < arrayList25.size()) {
}
ArrayList arrayList33222 = arrayList30;
int i34222 = i32222 | i33222;
if (str39 != null) {
}
D = Format.D(attributeValue11, null, str37, str39, str38, m13, i15, i34222, str16);
a aVar32222 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList33222, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar32222);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
if (t6.a.q(xmlPullParser9, str27)) {
}
}
str39 = str40;
str37 = str81;
str38 = str31;
i14 = 0;
while (true) {
str41 = "urn:mpeg:dash:role:2011";
if (i14 < arrayList13.size()) {
}
i14++;
arrayList31 = arrayList14;
arrayList13 = arrayList15;
}
i16 = 0;
int i322222 = 0;
while (i16 < arrayList15.size()) {
}
arrayList10 = arrayList15;
i17 = 0;
int i332222 = 0;
while (i17 < arrayList25.size()) {
}
ArrayList arrayList332222 = arrayList30;
int i342222 = i322222 | i332222;
if (str39 != null) {
}
D = Format.D(attributeValue11, null, str37, str39, str38, m13, i15, i342222, str16);
a aVar322222 = new a(D, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList332222, arrayList14);
str42 = D.f4483q;
if (!TextUtils.isEmpty(str42)) {
}
i18 = -1;
i19 = -1;
i20 = i13;
if (i20 != i18) {
}
arrayList8 = arrayList12;
arrayList8.add(aVar322222);
xmlPullParser4 = xmlPullParser;
i25 = i19;
str18 = str33;
str20 = str80;
}
} else {
str28 = str78;
str29 = str71;
if (t6.a.t(xmlPullParser11, str29)) {
str35 = attributeValue13;
jVar3 = cVar2.q(xmlPullParser11, (j.e) jVar3);
} else {
String str89 = attributeValue13;
String str90 = str70;
if (t6.a.t(xmlPullParser11, str90)) {
String str91 = str82;
long j22 = j21;
s11 = cVar2.r(xmlPullParser11, (j.b) jVar3, j22);
str5 = str60;
str6 = str49;
j14 = j22;
str7 = str59;
str30 = str85;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
str22 = str69;
str31 = str89;
str19 = str91;
str32 = str79;
i13 = i27;
str21 = str67;
str33 = str29;
arrayList12 = arrayList28;
str34 = str83;
str23 = str90;
arrayList13 = arrayList6;
i10 = i30;
} else {
String str92 = str82;
int i38 = i30;
String str93 = str69;
long j23 = j21;
if (t6.a.t(xmlPullParser11, str93)) {
str22 = str93;
str30 = str85;
str31 = str89;
str32 = str79;
str23 = str90;
arrayList13 = arrayList6;
str6 = str49;
j14 = j23;
j15 = j20;
str19 = str92;
str33 = str29;
i13 = i27;
arrayList12 = arrayList28;
str34 = str83;
i10 = i38;
str5 = str60;
str7 = str59;
arrayList2 = arrayList;
str8 = str63;
str21 = str67;
s11 = s(xmlPullParser, (j.c) jVar3, arrayList9, j14);
} else {
str5 = str60;
str22 = str93;
str6 = str49;
j14 = j23;
str7 = str59;
str30 = str85;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList12 = arrayList28;
str31 = str89;
str19 = str92;
str32 = str79;
i13 = i27;
i10 = i38;
str21 = str67;
str33 = str29;
str34 = str83;
str23 = str90;
arrayList13 = arrayList6;
if (t6.a.t(xmlPullParser11, str34)) {
Pair<String, DrmInitData.SchemeData> g10 = g(xmlPullParser);
Object obj3 = g10.first;
if (obj3 != null) {
str84 = (String) obj3;
}
Object obj4 = g10.second;
if (obj4 != null) {
arrayList30.add(obj4);
}
} else if (t6.a.t(xmlPullParser11, "InbandEventStream")) {
arrayList31.add(j(xmlPullParser11, "InbandEventStream"));
} else if (t6.a.t(xmlPullParser11, str32)) {
arrayList32.add(j(xmlPullParser11, str32));
} else {
c(xmlPullParser);
}
str36 = str84;
e10 = i31;
if (t6.a.q(xmlPullParser11, "Representation")) {
}
}
}
jVar3 = s11;
str36 = str84;
e10 = i31;
if (t6.a.q(xmlPullParser11, "Representation")) {
}
}
}
}
str5 = str60;
str6 = str49;
str7 = str59;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
j14 = j21;
str31 = str35;
i13 = i27;
str19 = str82;
str21 = str67;
str33 = str29;
str30 = str85;
str34 = str83;
str22 = str69;
str23 = str70;
arrayList13 = arrayList6;
str32 = str79;
arrayList12 = arrayList28;
i10 = i30;
str36 = str84;
e10 = i31;
if (t6.a.q(xmlPullParser11, "Representation")) {
}
}
} else {
str5 = str60;
str6 = str49;
i2 = i25;
str7 = str59;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
j14 = j21;
f10 = f11;
str18 = str71;
str19 = str73;
arrayList9 = arrayList29;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
str21 = str67;
i12 = m10;
str22 = str69;
str23 = str70;
arrayList10 = arrayList6;
if (t6.a.t(xmlPullParser4, str18)) {
jVar2 = q(xmlPullParser4, (j.e) jVar2);
i25 = i2;
} else {
str24 = str23;
if (t6.a.t(xmlPullParser4, str24)) {
s10 = r(xmlPullParser4, (j.b) jVar2, j14);
str26 = str18;
str25 = str22;
} else {
str25 = str22;
if (t6.a.t(xmlPullParser4, str25)) {
j14 = j14;
str26 = str18;
s10 = s(xmlPullParser, (j.c) jVar2, arrayList9, j14);
} else {
j14 = j14;
str26 = str18;
if (t6.a.t(xmlPullParser4, "InbandEventStream")) {
arrayList11 = arrayList24;
arrayList11.add(j(xmlPullParser4, "InbandEventStream"));
} else {
arrayList11 = arrayList24;
if (t6.a.t(xmlPullParser4, "Label")) {
str72 = u(xmlPullParser4, "Label");
} else if (t6.a.s(xmlPullParser)) {
c(xmlPullParser);
}
}
xmlPullParser5 = xmlPullParser4;
i25 = i2;
str27 = str68;
xmlPullParser9 = xmlPullParser5;
if (t6.a.q(xmlPullParser9, str27)) {
}
}
}
jVar2 = s10;
xmlPullParser5 = xmlPullParser4;
arrayList11 = arrayList24;
i25 = i2;
str27 = str68;
xmlPullParser9 = xmlPullParser5;
if (t6.a.q(xmlPullParser9, str27)) {
}
}
}
str26 = str18;
xmlPullParser9 = xmlPullParser4;
str27 = str68;
str25 = str22;
str24 = str23;
arrayList11 = arrayList24;
if (t6.a.q(xmlPullParser9, str27)) {
}
}
str5 = str60;
str6 = str49;
str7 = str59;
arrayList9 = arrayList27;
xmlPullParser5 = xmlPullParser9;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
str25 = str69;
j14 = j21;
str24 = str70;
f10 = f11;
arrayList11 = arrayList24;
str19 = str73;
arrayList10 = arrayList6;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
i2 = i25;
str21 = str67;
i12 = m10;
str26 = str71;
i25 = i2;
str27 = str68;
xmlPullParser9 = xmlPullParser5;
if (t6.a.q(xmlPullParser9, str27)) {
}
}
}
}
str46 = str14;
str5 = str60;
str6 = str49;
str7 = str59;
arrayList9 = arrayList27;
str14 = str46;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
str27 = str68;
str25 = str69;
j14 = j21;
str24 = str70;
f10 = f11;
arrayList11 = arrayList24;
str19 = str73;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
arrayList10 = arrayList26;
str21 = str67;
i12 = m10;
str26 = str71;
if (t6.a.q(xmlPullParser9, str27)) {
}
} else if (!z14) {
str46 = cVar9.f(xmlPullParser9, str75);
z14 = true;
str5 = str60;
str6 = str49;
str7 = str59;
arrayList9 = arrayList27;
str14 = str46;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
str27 = str68;
str25 = str69;
j14 = j21;
str24 = str70;
f10 = f11;
arrayList11 = arrayList24;
str19 = str73;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
arrayList10 = arrayList26;
str21 = str67;
i12 = m10;
str26 = str71;
if (t6.a.q(xmlPullParser9, str27)) {
ArrayList arrayList36 = new ArrayList(arrayList8.size());
int i39 = 0;
while (i39 < arrayList8.size()) {
a aVar4 = (a) arrayList8.get(i39);
Format format = aVar4.f3283a;
if (str72 != null) {
format = new Format(format.f4475i, str72, format.f4477k, format.f4478l, format.f4479m, format.f4480n, format.f4481o, format.f4482p, format.f4483q, format.r, format.f4484s, format.f4485t, format.f4486u, format.f4487v, format.f4488w, format.f4489x, format.f4490y, format.f4491z, format.B, format.A, format.C, format.D, format.E, format.F, format.G, format.H, format.I, format.J, format.K);
}
String str94 = aVar4.f3286d;
if (str94 == null) {
str94 = str76;
}
ArrayList<DrmInitData.SchemeData> arrayList37 = aVar4.f3287e;
ArrayList arrayList38 = arrayList7;
arrayList37.addAll(arrayList38);
if (arrayList37.isEmpty()) {
arrayList16 = arrayList8;
} else {
int size = arrayList37.size() - 1;
while (size >= 0) {
DrmInitData.SchemeData schemeData = arrayList37.get(size);
if (schemeData.a()) {
arrayList17 = arrayList8;
} else {
int i40 = 0;
arrayList17 = arrayList8;
while (true) {
if (i40 < arrayList37.size()) {
DrmInitData.SchemeData schemeData2 = arrayList37.get(i40);
if (schemeData2.a() && !schemeData.a() && schemeData2.c(schemeData.f4497j)) {
arrayList37.remove(size);
} else {
i40++;
}
}
}
}
size--;
arrayList8 = arrayList17;
}
arrayList16 = arrayList8;
format = format.c(new DrmInitData(str94, false, (DrmInitData.SchemeData[]) arrayList37.toArray(new DrmInitData.SchemeData[0])));
}
Format format2 = format;
ArrayList<d> arrayList39 = aVar4.f3288f;
arrayList39.addAll(arrayList11);
long j24 = aVar4.f3289g;
String str95 = aVar4.f3284b;
j jVar4 = aVar4.f3285c;
if (jVar4 instanceof j.e) {
aVar = new i.b(j24, format2, str95, (j.e) jVar4, arrayList39);
} else if (jVar4 instanceof j.a) {
aVar = new i.a(j24, format2, str95, (j.a) jVar4, arrayList39);
} else {
throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase");
}
arrayList36.add(aVar);
i39++;
arrayList7 = arrayList38;
arrayList8 = arrayList16;
}
arrayList22.add(new b6.a(m2, i25, arrayList36, arrayList25, arrayList9));
cVar6 = this;
arrayList3 = arrayList22;
xmlPullParser7 = xmlPullParser4;
arrayList4 = arrayList21;
str10 = str65;
} else {
arrayList24 = arrayList11;
str68 = str27;
str69 = str25;
str71 = str26;
str67 = str21;
str73 = str19;
i26 = i10;
arrayList26 = arrayList10;
m10 = i12;
str75 = str14;
str50 = str9;
f11 = f10;
i23 = i11;
str66 = str17;
arrayList23 = arrayList7;
str77 = str16;
str49 = str6;
j21 = j14;
arrayList = arrayList2;
str60 = str5;
str59 = str7;
str63 = str8;
cVar9 = this;
str70 = str24;
arrayList28 = arrayList8;
str74 = str20;
str64 = str15;
arrayList27 = arrayList9;
j20 = j15;
}
} else {
str14 = str75;
arrayList6 = arrayList26;
str5 = str60;
str6 = str49;
str7 = str59;
arrayList9 = arrayList27;
xmlPullParser5 = xmlPullParser9;
str15 = str64;
str16 = str77;
str17 = str66;
arrayList7 = arrayList23;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str8 = str63;
arrayList8 = arrayList28;
i10 = i26;
str25 = str69;
j14 = j21;
str24 = str70;
f10 = f11;
arrayList11 = arrayList24;
str19 = str73;
arrayList10 = arrayList6;
str20 = str74;
i11 = i23;
xmlPullParser4 = xmlPullParser;
i2 = i25;
str21 = str67;
i12 = m10;
str26 = str71;
i25 = i2;
str27 = str68;
xmlPullParser9 = xmlPullParser5;
if (t6.a.q(xmlPullParser9, str27)) {
}
}
}
} else {
str5 = str60;
str6 = str49;
j14 = k16;
str7 = str59;
str8 = str61;
ArrayList arrayList40 = arrayList20;
String str96 = str57;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
ArrayList arrayList41 = arrayList19;
if (t6.a.t(xmlPullParser7, "EventStream")) {
String str97 = str96;
String attributeValue14 = xmlPullParser7.getAttributeValue(null, str97);
if (attributeValue14 == null) {
attributeValue14 = "";
}
String str98 = str5;
String attributeValue15 = xmlPullParser7.getAttributeValue(null, str98);
String str99 = attributeValue15 != null ? attributeValue15 : "";
long n10 = n(xmlPullParser7, "timescale", 1L);
ArrayList arrayList42 = new ArrayList();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
while (true) {
xmlPullParser.next();
String str100 = "Event";
if (t6.a.t(xmlPullParser7, "Event")) {
String str101 = str97;
long n11 = n(xmlPullParser7, str7, 0L);
str5 = str98;
long n12 = n(xmlPullParser7, str8, -9223372036854775807L);
long n13 = n(xmlPullParser7, "presentationTime", 0L);
long j25 = n10;
long H = w.H(n12, 1000L, j25);
long H2 = w.H(n13, 1000000L, j25);
j17 = n10;
String attributeValue16 = xmlPullParser7.getAttributeValue(null, "messageData");
if (attributeValue16 == null) {
attributeValue16 = null;
}
byteArrayOutputStream.reset();
XmlSerializer newSerializer = Xml.newSerializer();
newSerializer.setOutput(byteArrayOutputStream, "UTF-8");
xmlPullParser.nextToken();
while (!t6.a.q(xmlPullParser7, str100)) {
switch (xmlPullParser.getEventType()) {
case 0:
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
newSerializer.startDocument(null, Boolean.FALSE);
break;
case 1:
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
newSerializer.endDocument();
break;
case 2:
str12 = str100;
newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
int i41 = 0;
while (i41 < xmlPullParser.getAttributeCount()) {
newSerializer.attribute(xmlPullParser7.getAttributeNamespace(i41), xmlPullParser7.getAttributeName(i41), xmlPullParser7.getAttributeValue(i41));
i41++;
str101 = str101;
arrayList41 = arrayList41;
}
arrayList5 = arrayList41;
str13 = str101;
break;
case 3:
str12 = str100;
newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
arrayList5 = arrayList41;
str13 = str101;
break;
case 4:
newSerializer.text(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 5:
newSerializer.cdsect(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 6:
newSerializer.entityRef(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 7:
newSerializer.ignorableWhitespace(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 8:
newSerializer.processingInstruction(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 9:
newSerializer.comment(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
case 10:
newSerializer.docdecl(xmlPullParser.getText());
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
default:
str12 = str100;
arrayList5 = arrayList41;
str13 = str101;
break;
}
xmlPullParser.nextToken();
str100 = str12;
str101 = str13;
arrayList41 = arrayList5;
}
arrayList3 = arrayList41;
str10 = str101;
newSerializer.flush();
byte[] byteArray = byteArrayOutputStream.toByteArray();
Long valueOf = Long.valueOf(H2);
if (attributeValue16 != null) {
byteArray = w.v(attributeValue16);
}
arrayList42.add(Pair.create(valueOf, new EventMessage(attributeValue14, str99, H, n11, byteArray)));
} else {
str10 = str97;
arrayList3 = arrayList41;
str5 = str98;
j17 = n10;
c(xmlPullParser);
}
if (t6.a.q(xmlPullParser7, "EventStream")) {
long[] jArr = new long[arrayList42.size()];
EventMessage[] eventMessageArr = new EventMessage[arrayList42.size()];
for (int i42 = 0; i42 < arrayList42.size(); i42++) {
Pair pair = (Pair) arrayList42.get(i42);
jArr[i42] = ((Long) pair.first).longValue();
eventMessageArr[i42] = (EventMessage) pair.second;
}
arrayList4 = arrayList40;
arrayList4.add(new e(attributeValue14, str99, jArr, eventMessageArr));
cVar6 = cVar8;
} else {
str97 = str10;
n10 = j17;
arrayList41 = arrayList3;
str98 = str5;
}
}
} else {
arrayList3 = arrayList41;
arrayList4 = arrayList40;
str10 = str96;
str11 = str7;
if (t6.a.t(xmlPullParser7, "SegmentBase")) {
cVar = cVar8;
jVar = cVar.q(xmlPullParser7, null);
xmlPullParser3 = xmlPullParser;
cVar6 = cVar;
j16 = j14;
} else {
cVar = cVar8;
if (t6.a.t(xmlPullParser7, "SegmentList")) {
j16 = j14;
jVar = cVar.r(xmlPullParser7, null, j16);
xmlPullParser2 = xmlPullParser7;
} else {
j16 = j14;
if (t6.a.t(xmlPullParser7, "SegmentTemplate")) {
xmlPullParser2 = xmlPullParser7;
jVar = s(xmlPullParser, null, Collections.emptyList(), j16);
} else {
xmlPullParser2 = xmlPullParser7;
c(xmlPullParser);
}
}
xmlPullParser3 = xmlPullParser;
xmlPullParser7 = xmlPullParser2;
cVar6 = cVar;
}
}
}
xmlPullParser3 = xmlPullParser;
cVar = cVar6;
j16 = j14;
str11 = str7;
} else if (z13) {
str5 = str60;
str6 = str49;
str8 = str61;
arrayList3 = arrayList19;
arrayList4 = arrayList20;
str4 = str58;
str9 = str50;
arrayList2 = arrayList;
xmlPullParser3 = xmlPullParser8;
j15 = j20;
str11 = str59;
str3 = str62;
cVar = cVar5;
str10 = str57;
j16 = k16;
} else {
str62 = cVar5.f(xmlPullParser7, str62);
z13 = true;
str5 = str60;
str6 = str49;
str8 = str61;
arrayList3 = arrayList19;
arrayList4 = arrayList20;
cVar3 = cVar5;
str9 = str50;
arrayList2 = arrayList;
j15 = j20;
str11 = str59;
str10 = str57;
j16 = k16;
str47 = str58;
if (t6.a.q(xmlPullParser7, str47)) {
str58 = str47;
str59 = str11;
k16 = j16;
str57 = str10;
arrayList19 = arrayList3;
str50 = str9;
j20 = j15;
arrayList = arrayList2;
str60 = str5;
str61 = str8;
cVar5 = cVar3;
arrayList20 = arrayList4;
str49 = str6;
xmlPullParser6 = xmlPullParser;
} else {
Pair create = Pair.create(new f(attributeValue5, k15, arrayList3, arrayList4), Long.valueOf(j16));
f fVar = (f) create.first;
if (fVar.f3298b != -9223372036854775807L) {
long longValue = ((Long) create.second).longValue();
j19 = longValue == -9223372036854775807L ? -9223372036854775807L : longValue + fVar.f3298b;
arrayList18 = arrayList2;
arrayList18.add(fVar);
} else if (!z10) {
StringBuilder r = af.j.r("Unable to determine start of period ");
r.append(arrayList2.size());
throw new x4.z(r.toString());
} else {
j19 = j15;
arrayList18 = arrayList2;
z12 = true;
}
xmlPullParser7 = xmlPullParser8;
}
}
str47 = str4;
String str102 = str3;
xmlPullParser8 = xmlPullParser3;
cVar3 = cVar;
str62 = str102;
if (t6.a.q(xmlPullParser7, str47)) {
}
}
} else {
j12 = E;
j13 = k10;
z10 = equals;
arrayList18 = arrayList;
c(xmlPullParser);
j19 = j19;
}
str48 = str2;
uri = uri2;
}
}
str48 = str2;
j12 = E;
j13 = k10;
z10 = equals;
uri = uri2;
arrayList18 = arrayList;
} else if (z11) {
j12 = E;
j13 = k10;
j11 = k11;
z10 = equals;
j10 = k12;
str2 = str48;
str48 = str2;
uri = uri2;
} else {
str48 = cVar4.f(xmlPullParser7, str48);
z11 = true;
arrayList = arrayList18;
j11 = k11;
j10 = k12;
j12 = E;
j13 = k10;
z10 = equals;
uri = uri2;
arrayList18 = arrayList;
}
if (t6.a.q(xmlPullParser7, "MPD")) {
if (j13 == -9223372036854775807L) {
if (j19 != -9223372036854775807L) {
j18 = j19;
if (arrayList18.isEmpty()) {
return new b(j12, j18, j11, z10, j10, k13, k14, E2, gVar, aVar2, uri, arrayList18);
}
throw new x4.z("No periods found.");
} else if (!z10) {
throw new x4.z("Unable to determine duration of static manifest.");
}
}
j18 = j13;
if (arrayList18.isEmpty()) {
}
} else {
cVar4 = this;
xmlPullParser6 = xmlPullParser;
uri2 = uri;
k12 = j10;
k11 = j11;
E = j12;
k10 = j13;
equals = z10;
}
}
}
public final h p(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 h(attributeValue, j10, j11);
}
} else {
j10 = 0;
}
j11 = -1;
return new h(attributeValue, j10, j11);
}
public final j.e q(XmlPullParser xmlPullParser, j.e eVar) {
long j10;
long j11;
long n10 = n(xmlPullParser, "timescale", eVar != null ? eVar.f3320b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.f3321c : 0L);
long j12 = eVar != null ? eVar.f3331d : 0L;
long j13 = eVar != null ? eVar.f3332e : 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;
}
h hVar = eVar != null ? eVar.f3319a : null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "Initialization")) {
hVar = p(xmlPullParser, "sourceURL", "range");
} else {
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, "SegmentBase"));
return new j.e(hVar, n10, n11, j11, j10);
}
public final j.b r(XmlPullParser xmlPullParser, j.b bVar, long j10) {
h hVar;
List list;
List<j.d> list2;
long n10 = n(xmlPullParser, "timescale", bVar != null ? bVar.f3320b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.f3321c : 0L);
long n12 = n(xmlPullParser, "duration", bVar != null ? bVar.f3323e : -9223372036854775807L);
long n13 = n(xmlPullParser, "startNumber", bVar != null ? bVar.f3322d : 1L);
List<j.d> list3 = null;
List list4 = null;
h hVar2 = null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "Initialization")) {
hVar2 = p(xmlPullParser, "sourceURL", "range");
} else if (t6.a.t(xmlPullParser, "SegmentTimeline")) {
list3 = t(xmlPullParser, n10, j10);
} else if (t6.a.t(xmlPullParser, "SegmentURL")) {
if (list4 == null) {
list4 = new ArrayList();
}
List list5 = list4;
list5.add(p(xmlPullParser, "media", "mediaRange"));
list4 = list5;
} else {
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, "SegmentList"));
if (bVar != null) {
if (hVar2 == null) {
hVar2 = bVar.f3319a;
}
if (list3 == null) {
list3 = bVar.f3324f;
}
if (list4 == null) {
list2 = list3;
hVar = hVar2;
list = bVar.f3325g;
return new j.b(hVar, n10, n11, n13, n12, list2, list);
}
}
hVar = hVar2;
list = list4;
list2 = list3;
return new j.b(hVar, n10, n11, n13, n12, list2, list);
}
public final j.c s(XmlPullParser xmlPullParser, j.c cVar, List<d> list, long j10) {
long j11;
long n10 = n(xmlPullParser, "timescale", cVar != null ? cVar.f3320b : 1L);
long n11 = n(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.f3321c : 0L);
long n12 = n(xmlPullParser, "duration", cVar != null ? cVar.f3323e : -9223372036854775807L);
long n13 = n(xmlPullParser, "startNumber", cVar != null ? cVar.f3322d : 1L);
int i2 = 0;
while (true) {
if (i2 >= list.size()) {
j11 = -1;
break;
}
d dVar = list.get(i2);
if ("http://dashif.org/guidelines/last-segment-number".equalsIgnoreCase(dVar.f3290a)) {
j11 = Long.parseLong(dVar.f3291b);
break;
}
i2++;
}
long j12 = j11;
List<j.d> list2 = null;
k v10 = v(xmlPullParser, "media", cVar != null ? cVar.f3327h : null);
k v11 = v(xmlPullParser, "initialization", cVar != null ? cVar.f3326g : null);
h hVar = null;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "Initialization")) {
hVar = p(xmlPullParser, "sourceURL", "range");
} else if (t6.a.t(xmlPullParser, "SegmentTimeline")) {
list2 = t(xmlPullParser, n10, j10);
} else {
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, "SegmentTemplate"));
if (cVar != null) {
if (hVar == null) {
hVar = cVar.f3319a;
}
if (list2 == null) {
list2 = cVar.f3324f;
}
}
return new j.c(hVar, n10, n11, n13, j12, n12, list2, v11, v10);
}
public final List<j.d> t(XmlPullParser xmlPullParser, long j10, long j11) {
ArrayList arrayList = new ArrayList();
long j12 = 0;
long j13 = -9223372036854775807L;
boolean z10 = false;
int i2 = 0;
do {
xmlPullParser.next();
if (t6.a.t(xmlPullParser, "S")) {
long n10 = n(xmlPullParser, "t", -9223372036854775807L);
if (z10) {
j12 = b(arrayList, j12, j13, i2, n10);
}
if (n10 == -9223372036854775807L) {
n10 = j12;
}
j13 = n(xmlPullParser, "d", -9223372036854775807L);
i2 = m(xmlPullParser, "r", 0);
j12 = n10;
z10 = true;
} else {
c(xmlPullParser);
}
} while (!t6.a.q(xmlPullParser, "SegmentTimeline"));
if (z10) {
b(arrayList, j12, j13, i2, w.H(j11, j10, 1000L));
}
return arrayList;
}
public final k v(XmlPullParser xmlPullParser, String str, k kVar) {
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] = "";
int i2 = 0;
int i10 = 0;
while (i2 < attributeValue.length()) {
int indexOf = attributeValue.indexOf("$", i2);
if (indexOf == -1) {
strArr[i10] = strArr[i10] + attributeValue.substring(i2);
i2 = attributeValue.length();
} else if (indexOf != i2) {
strArr[i10] = strArr[i10] + attributeValue.substring(i2, indexOf);
i2 = indexOf;
} else if (attributeValue.startsWith("$$", i2)) {
strArr[i10] = o.d(new StringBuilder(), strArr[i10], "$");
i2 += 2;
} else {
int i11 = i2 + 1;
int indexOf2 = attributeValue.indexOf("$", i11);
String substring = attributeValue.substring(i11, indexOf2);
if (substring.equals("RepresentationID")) {
iArr[i10] = 1;
} else {
int indexOf3 = substring.indexOf("%0");
if (indexOf3 != -1) {
str2 = substring.substring(indexOf3);
if (!str2.endsWith("d") && !str2.endsWith("x")) {
str2 = af.j.n(str2, "d");
}
substring = substring.substring(0, indexOf3);
} else {
str2 = "%01d";
}
Objects.requireNonNull(substring);
substring.hashCode();
char c10 = 65535;
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[i10] = 2;
break;
case 1:
iArr[i10] = 4;
break;
case 2:
iArr[i10] = 3;
break;
default:
throw new IllegalArgumentException(af.j.n("Invalid template: ", attributeValue));
}
strArr2[i10] = str2;
}
i10++;
strArr[i10] = "";
i2 = indexOf2 + 1;
}
}
return new k(strArr, iArr, strArr2, i10);
}
return kVar;
}
}