그늘 v4.6.9版本的 MD5 值为:45bd3dac9e441bb87fea09c92b437adc
以下内容为反编译后的 c.java 源代码,内容仅作参考
package m1;
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 androidx.annotation.Nullable;
import androidx.exifinterface.media.ExifInterface;
import c2.z;
import com.bumptech.glide.load.Key;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.metadata.emsg.EventMessage;
import com.just.agentweb.AgentWebPermissions;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import e2.b0;
import e2.d0;
import e2.m;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import m1.i;
import m1.j;
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;
public final class c extends DefaultHandler implements z.a<b> {
public static final Pattern f10050b = Pattern.compile("(\\d+)(?:/(\\d+))?");
public static final Pattern f10051c = Pattern.compile("CC([1-4])=.*");
public static final Pattern f10052d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
public final XmlPullParserFactory f10053a;
public static final class a {
public final Format f10054a;
public final String f10055b;
public final j f10056c;
@Nullable
public final String f10057d;
public final ArrayList<DrmInitData.SchemeData> f10058e;
public final ArrayList<d> f10059f;
public final long f10060g = -1;
public a(Format format, String str, j jVar, @Nullable String str2, ArrayList arrayList, ArrayList arrayList2) {
this.f10054a = format;
this.f10055b = str;
this.f10056c = jVar;
this.f10057d = str2;
this.f10058e = arrayList;
this.f10059f = arrayList2;
}
}
public c() {
try {
this.f10053a = XmlPullParserFactory.newInstance();
} catch (XmlPullParserException e10) {
throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e10);
}
}
public static long b(ArrayList arrayList, long j10, long j11, int i, long j12) {
int i10;
if (i >= 0) {
i10 = i + 1;
} else {
int i11 = d0.f6754a;
i10 = (int) ((((j12 - j10) + j11) - 1) / j11);
}
for (int i12 = 0; i12 < i10; i12++) {
arrayList.add(new j.d(j10, j11));
j10 += j11;
}
return j10;
}
public static void c(XmlPullParser xmlPullParser) throws IOException, XmlPullParserException {
boolean z10;
if (!e2.a.j(xmlPullParser)) {
return;
}
int i = 1;
while (i != 0) {
xmlPullParser.next();
if (e2.a.j(xmlPullParser)) {
i++;
} else {
if (xmlPullParser.getEventType() == 3) {
z10 = true;
} else {
z10 = false;
}
if (z10) {
i--;
}
}
}
}
public static boolean d(@Nullable String str) {
if (!m.i(str) && !"application/ttml+xml".equals(str) && !"application/x-mp4-vtt".equals(str) && !"application/cea-708".equals(str) && !"application/cea-608".equals(str)) {
return false;
}
return true;
}
public static int e(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
String E;
char c4;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue == null) {
attributeValue = null;
}
int i = -1;
if ("urn:mpeg:dash:23003:3:audio_channel_configuration:2011".equals(attributeValue)) {
i = l(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)) && (E = d0.E(xmlPullParser.getAttributeValue(null, "value"))) != null) {
switch (E.hashCode()) {
case 1596796:
if (E.equals("4000")) {
c4 = 0;
break;
}
c4 = 65535;
break;
case 2937391:
if (E.equals("a000")) {
c4 = 1;
break;
}
c4 = 65535;
break;
case 3094035:
if (E.equals("f801")) {
c4 = 2;
break;
}
c4 = 65535;
break;
case 3133436:
if (E.equals("fa01")) {
c4 = 3;
break;
}
c4 = 65535;
break;
default:
c4 = 65535;
break;
}
if (c4 != 0) {
if (c4 != 1) {
if (c4 != 2) {
if (c4 == 3) {
i = 8;
}
} else {
i = 6;
}
} else {
i = 2;
}
} else {
i = 1;
}
}
do {
xmlPullParser.next();
} while (!e2.a.i(xmlPullParser, "AudioChannelConfiguration"));
return i;
}
public static Pair f(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
String str;
UUID uuid;
byte[] bArr;
String str2;
boolean z10;
UUID b10;
char c4;
UUID uuid2;
String str3;
DrmInitData.SchemeData schemeData = null;
String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
if (attributeValue != null) {
String E = d0.E(attributeValue);
E.getClass();
switch (E.hashCode()) {
case 489446379:
if (E.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) {
c4 = 0;
break;
}
c4 = 65535;
break;
case 755418770:
if (E.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) {
c4 = 1;
break;
}
c4 = 65535;
break;
case 1812765994:
if (E.equals("urn:mpeg:dash:mp4protection:2011")) {
c4 = 2;
break;
}
c4 = 65535;
break;
default:
c4 = 65535;
break;
}
switch (c4) {
case 0:
uuid2 = k0.e.f9059e;
uuid = uuid2;
str = null;
bArr = null;
str2 = null;
break;
case 1:
uuid2 = k0.e.f9058d;
uuid = uuid2;
str = null;
bArr = null;
str2 = null;
break;
case 2:
str = xmlPullParser.getAttributeValue(null, "value");
int attributeCount = xmlPullParser.getAttributeCount();
int i = 0;
while (true) {
if (i < attributeCount) {
String attributeName = xmlPullParser.getAttributeName(i);
int indexOf = attributeName.indexOf(58);
if (indexOf != -1) {
attributeName = attributeName.substring(indexOf + 1);
}
if (attributeName.equals("default_KID")) {
str3 = xmlPullParser.getAttributeValue(i);
} else {
i++;
}
} else {
str3 = null;
}
}
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 = k0.e.f9056b;
bArr = com.google.android.exoplayer2.extractor.mp4.g.a(uuid, uuidArr, null);
str2 = null;
break;
}
uuid = null;
bArr = null;
str2 = null;
break;
}
do {
xmlPullParser.next();
if (!e2.a.k(xmlPullParser, "ms:laurl")) {
str2 = xmlPullParser.getAttributeValue(null, "licenseUrl");
} else {
if (bArr == null) {
if (e2.a.j(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 = com.google.android.exoplayer2.extractor.mp4.g.b(decode);
if (b10 != null) {
Log.w("MpdParser", "Skipping malformed cenc:pssh data");
uuid = b10;
bArr = null;
} else {
bArr = decode;
uuid = b10;
}
}
}
}
z10 = false;
if (z10) {
byte[] decode2 = Base64.decode(xmlPullParser.getText(), 0);
b10 = com.google.android.exoplayer2.extractor.mp4.g.b(decode2);
if (b10 != null) {
}
}
}
if (bArr == null) {
UUID uuid3 = k0.e.f9059e;
if (uuid3.equals(uuid) && e2.a.k(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
bArr = com.google.android.exoplayer2.extractor.mp4.g.a(uuid3, null, Base64.decode(xmlPullParser.getText(), 0));
}
}
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser, "ContentProtection"));
if (uuid != null) {
schemeData = new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr);
}
return Pair.create(str, schemeData);
}
str = null;
uuid = null;
bArr = null;
str2 = null;
do {
xmlPullParser.next();
if (!e2.a.k(xmlPullParser, "ms:laurl")) {
}
} while (!e2.a.i(xmlPullParser, "ContentProtection"));
if (uuid != null) {
}
return Pair.create(str, schemeData);
}
public static int g(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 static int h(@Nullable String str) {
if (str == null) {
return 0;
}
char c4 = 65535;
switch (str.hashCode()) {
case -2060497896:
if (str.equals("subtitle")) {
c4 = 0;
break;
}
break;
case -1724546052:
if (str.equals("description")) {
c4 = 1;
break;
}
break;
case -1580883024:
if (str.equals("enhanced-audio-intelligibility")) {
c4 = 2;
break;
}
break;
case -1408024454:
if (str.equals("alternate")) {
c4 = 3;
break;
}
break;
case 99825:
if (str.equals("dub")) {
c4 = 4;
break;
}
break;
case 3343801:
if (str.equals("main")) {
c4 = 5;
break;
}
break;
case 3530173:
if (str.equals("sign")) {
c4 = 6;
break;
}
break;
case 552573414:
if (str.equals("caption")) {
c4 = 7;
break;
}
break;
case 899152809:
if (str.equals("commentary")) {
c4 = '\b';
break;
}
break;
case 1629013393:
if (str.equals("emergency")) {
c4 = '\t';
break;
}
break;
case 1855372047:
if (str.equals("supplementary")) {
c4 = '\n';
break;
}
break;
}
switch (c4) {
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 static d i(XmlPullParser xmlPullParser, String str) throws XmlPullParserException, IOException {
String str2 = null;
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");
if (attributeValue3 != null) {
str2 = attributeValue3;
}
do {
xmlPullParser.next();
} while (!e2.a.i(xmlPullParser, str));
return new d(attributeValue, attributeValue2, str2);
}
public static long j(XmlPullParser xmlPullParser, String str, long j10) {
double d7;
double d10;
double d11;
double d12;
double d13;
String attributeValue = xmlPullParser.getAttributeValue(null, str);
if (attributeValue == null) {
return j10;
}
Matcher matcher = d0.f6761h.matcher(attributeValue);
if (matcher.matches()) {
boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1));
String group = matcher.group(3);
double d14 = 0.0d;
if (group != null) {
d7 = Double.parseDouble(group) * 3.1556908E7d;
} else {
d7 = 0.0d;
}
String group2 = matcher.group(5);
if (group2 != null) {
d10 = Double.parseDouble(group2) * 2629739.0d;
} else {
d10 = 0.0d;
}
double d15 = d7 + d10;
String group3 = matcher.group(7);
if (group3 != null) {
d11 = Double.parseDouble(group3) * 86400.0d;
} else {
d11 = 0.0d;
}
double d16 = d15 + d11;
String group4 = matcher.group(10);
if (group4 != null) {
d12 = Double.parseDouble(group4) * 3600.0d;
} else {
d12 = 0.0d;
}
double d17 = d16 + d12;
String group5 = matcher.group(12);
if (group5 != null) {
d13 = Double.parseDouble(group5) * 60.0d;
} else {
d13 = 0.0d;
}
double d18 = d17 + d13;
String group6 = matcher.group(14);
if (group6 != null) {
d14 = Double.parseDouble(group6);
}
long j11 = (long) ((d18 + d14) * 1000.0d);
if (isEmpty) {
return -j11;
}
return j11;
}
return (long) (Double.parseDouble(attributeValue) * 3600.0d * 1000.0d);
}
public static float k(XmlPullParser xmlPullParser, float f10) {
String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate");
if (attributeValue != null) {
Matcher matcher = f10050b.matcher(attributeValue);
if (matcher.matches()) {
int parseInt = Integer.parseInt(matcher.group(1));
String group = matcher.group(2);
if (!TextUtils.isEmpty(group)) {
return parseInt / Integer.parseInt(group);
}
return parseInt;
}
return f10;
}
return f10;
}
public static int l(XmlPullParser xmlPullParser, String str, int i) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
if (attributeValue != null) {
return Integer.parseInt(attributeValue);
}
return i;
}
public static long m(XmlPullParser xmlPullParser, String str, long j10) {
String attributeValue = xmlPullParser.getAttributeValue(null, str);
if (attributeValue != null) {
return Long.parseLong(attributeValue);
}
return j10;
}
public static h o(String str, String str2, XmlPullParser xmlPullParser) {
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(j10, attributeValue, j11);
}
} else {
j10 = 0;
}
j11 = -1;
return new h(j10, attributeValue, j11);
}
public static j.e p(XmlPullParser xmlPullParser, @Nullable j.e eVar) throws XmlPullParserException, IOException {
long j10;
long j11;
long j12;
long j13;
long j14;
if (eVar != null) {
j10 = eVar.f10091b;
} else {
j10 = 1;
}
long m10 = m(xmlPullParser, "timescale", j10);
long j15 = 0;
if (eVar != null) {
j11 = eVar.f10092c;
} else {
j11 = 0;
}
long m11 = m(xmlPullParser, "presentationTimeOffset", j11);
if (eVar != null) {
j12 = eVar.f10101d;
} else {
j12 = 0;
}
if (eVar != null) {
j15 = eVar.f10102e;
}
h hVar = null;
String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
if (attributeValue != null) {
String[] split = attributeValue.split("-");
long parseLong = Long.parseLong(split[0]);
j13 = (Long.parseLong(split[1]) - parseLong) + 1;
j14 = parseLong;
} else {
j13 = j15;
j14 = j12;
}
if (eVar != null) {
hVar = eVar.f10090a;
}
do {
xmlPullParser.next();
if (e2.a.k(xmlPullParser, "Initialization")) {
hVar = o("sourceURL", "range", xmlPullParser);
} else {
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser, "SegmentBase"));
return new j.e(hVar, m10, m11, j14, j13);
}
public static j.b q(XmlPullParser xmlPullParser, @Nullable j.b bVar, long j10) throws XmlPullParserException, IOException {
long j11;
long j12;
long j13;
List list;
long j14 = 1;
if (bVar != null) {
j11 = bVar.f10091b;
} else {
j11 = 1;
}
long m10 = m(xmlPullParser, "timescale", j11);
if (bVar != null) {
j12 = bVar.f10092c;
} else {
j12 = 0;
}
long m11 = m(xmlPullParser, "presentationTimeOffset", j12);
if (bVar != null) {
j13 = bVar.f10094e;
} else {
j13 = -9223372036854775807L;
}
long m12 = m(xmlPullParser, "duration", j13);
if (bVar != null) {
j14 = bVar.f10093d;
}
long m13 = m(xmlPullParser, "startNumber", j14);
List list2 = null;
h hVar = null;
List list3 = null;
do {
xmlPullParser.next();
if (e2.a.k(xmlPullParser, "Initialization")) {
hVar = o("sourceURL", "range", xmlPullParser);
} else if (e2.a.k(xmlPullParser, "SegmentTimeline")) {
list3 = s(xmlPullParser, m10, j10);
} else if (e2.a.k(xmlPullParser, "SegmentURL")) {
if (list2 == null) {
list2 = new ArrayList();
}
list2.add(o("media", "mediaRange", xmlPullParser));
} else {
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser, "SegmentList"));
if (bVar != null) {
if (hVar == null) {
hVar = bVar.f10090a;
}
if (list3 == null) {
list3 = bVar.f10095f;
}
if (list2 == null) {
list = bVar.f10096g;
return new j.b(hVar, m10, m11, m13, m12, list3, list);
}
}
list = list2;
return new j.b(hVar, m10, m11, m13, m12, list3, list);
}
public static j.c r(XmlPullParser xmlPullParser, @Nullable j.c cVar, List list, long j10) throws XmlPullParserException, IOException {
long j11;
long j12;
long j13;
long j14;
k kVar;
k kVar2;
h hVar;
List list2;
long j15 = 1;
if (cVar != null) {
j11 = cVar.f10091b;
} else {
j11 = 1;
}
long m10 = m(xmlPullParser, "timescale", j11);
if (cVar != null) {
j12 = cVar.f10092c;
} else {
j12 = 0;
}
long m11 = m(xmlPullParser, "presentationTimeOffset", j12);
if (cVar != null) {
j13 = cVar.f10094e;
} else {
j13 = -9223372036854775807L;
}
long m12 = m(xmlPullParser, "duration", j13);
if (cVar != null) {
j15 = cVar.f10093d;
}
long m13 = m(xmlPullParser, "startNumber", j15);
int i = 0;
while (true) {
if (i < list.size()) {
d dVar = (d) list.get(i);
if ("http://dashif.org/guidelines/last-segment-number".equalsIgnoreCase(dVar.f10061a)) {
j14 = Long.parseLong(dVar.f10062b);
break;
}
i++;
} else {
j14 = -1;
break;
}
}
long j16 = j14;
h hVar2 = null;
if (cVar != null) {
kVar = cVar.f10098h;
} else {
kVar = null;
}
k t7 = t(xmlPullParser, "media", kVar);
if (cVar != null) {
kVar2 = cVar.f10097g;
} else {
kVar2 = null;
}
k t10 = t(xmlPullParser, "initialization", kVar2);
List list3 = null;
do {
xmlPullParser.next();
if (e2.a.k(xmlPullParser, "Initialization")) {
hVar2 = o("sourceURL", "range", xmlPullParser);
} else if (e2.a.k(xmlPullParser, "SegmentTimeline")) {
list3 = s(xmlPullParser, m10, j10);
} else {
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser, "SegmentTemplate"));
if (cVar != null) {
if (hVar2 == null) {
hVar2 = cVar.f10090a;
}
if (list3 == null) {
list2 = cVar.f10095f;
hVar = hVar2;
return new j.c(hVar, m10, m11, m13, j16, m12, list2, t10, t7);
}
}
hVar = hVar2;
list2 = list3;
return new j.c(hVar, m10, m11, m13, j16, m12, list2, t10, t7);
}
public static ArrayList s(XmlPullParser xmlPullParser, long j10, long j11) throws XmlPullParserException, IOException {
ArrayList arrayList = new ArrayList();
long j12 = 0;
long j13 = -9223372036854775807L;
boolean z10 = false;
int i = 0;
do {
xmlPullParser.next();
if (e2.a.k(xmlPullParser, ExifInterface.LATITUDE_SOUTH)) {
long m10 = m(xmlPullParser, "t", -9223372036854775807L);
if (z10) {
j12 = b(arrayList, j12, j13, i, m10);
}
if (m10 == -9223372036854775807L) {
m10 = j12;
}
j13 = m(xmlPullParser, "d", -9223372036854775807L);
i = l(xmlPullParser, "r", 0);
j12 = m10;
z10 = true;
} else {
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser, "SegmentTimeline"));
if (z10) {
b(arrayList, j12, j13, i, d0.A(j11, j10, 1000L));
}
return arrayList;
}
@Nullable
public static k t(XmlPullParser xmlPullParser, String str, @Nullable 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 i = 0;
int i10 = 0;
while (i < attributeValue.length()) {
int indexOf = attributeValue.indexOf("$", i);
if (indexOf == -1) {
strArr[i10] = strArr[i10] + attributeValue.substring(i);
i = attributeValue.length();
} else if (indexOf != i) {
strArr[i10] = strArr[i10] + attributeValue.substring(i, indexOf);
i = indexOf;
} else if (attributeValue.startsWith("$$", i)) {
strArr[i10] = androidx.appcompat.graphics.drawable.a.i(new StringBuilder(), strArr[i10], "$");
i += 2;
} else {
int i11 = i + 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 = str2.concat("d");
}
substring = substring.substring(0, indexOf3);
} else {
str2 = "%01d";
}
substring.getClass();
substring.hashCode();
char c4 = 65535;
switch (substring.hashCode()) {
case -1950496919:
if (substring.equals("Number")) {
c4 = 0;
break;
}
break;
case 2606829:
if (substring.equals("Time")) {
c4 = 1;
break;
}
break;
case 38199441:
if (substring.equals("Bandwidth")) {
c4 = 2;
break;
}
break;
}
switch (c4) {
case 0:
iArr[i10] = 2;
break;
case 1:
iArr[i10] = 4;
break;
case 2:
iArr[i10] = 3;
break;
default:
throw new IllegalArgumentException("Invalid template: ".concat(attributeValue));
}
strArr2[i10] = str2;
}
i10++;
strArr[i10] = "";
i = indexOf2 + 1;
}
}
return new k(strArr, iArr, strArr2, i10);
}
return kVar;
}
@Override
public final Object a(Uri uri, c2.k kVar) throws IOException {
try {
XmlPullParser newPullParser = this.f10053a.newPullParser();
newPullParser.setInput(kVar, null);
if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
return n(newPullParser, uri.toString());
}
throw new k0.z("inputStream does not contain a valid media presentation description");
} catch (XmlPullParserException e10) {
throw new k0.z(e10);
}
}
public final b n(XmlPullParser xmlPullParser, String str) throws XmlPullParserException, IOException {
long x10;
long j10;
long j11;
long j12;
long x11;
long j13;
boolean z10;
String str2;
long j14;
XmlPullParser xmlPullParser2;
long j15;
long j16;
long j17;
boolean z11;
ArrayList arrayList;
Object obj;
ArrayList arrayList2;
String str3;
String str4;
String str5;
String str6;
long j18;
String str7;
String str8;
String str9;
ArrayList arrayList3;
ArrayList arrayList4;
String str10;
XmlPullParser xmlPullParser3;
String str11;
String str12;
String str13;
String str14;
String str15;
String str16;
String str17;
String str18;
String str19;
ArrayList arrayList5;
ArrayList arrayList6;
ArrayList arrayList7;
String str20;
String str21;
String str22;
String str23;
long j19;
String str24;
String str25;
ArrayList arrayList8;
int i;
String str26;
ArrayList arrayList9;
int i10;
String str27;
int i11;
String str28;
int i12;
String str29;
String str30;
long j20;
ArrayList arrayList10;
ArrayList arrayList11;
String str31;
ArrayList arrayList12;
ArrayList arrayList13;
String str32;
String str33;
long j21;
String str34;
String str35;
j r10;
int e10;
String str36;
j jVar;
String str37;
String str38;
ArrayList arrayList14;
int i13;
Format y10;
j eVar;
String str39;
int i14;
boolean z12;
int i15;
String str40;
int parseInt;
String str41;
int i16;
char c4;
boolean z13;
long j22;
ArrayList arrayList15;
Object aVar;
boolean z14;
ArrayList arrayList16;
boolean z15;
boolean z16;
boolean z17;
XmlPullParser xmlPullParser4;
String str42;
String str43;
String str44;
String str45;
XmlPullParser xmlPullParser5 = xmlPullParser;
String attributeValue = xmlPullParser5.getAttributeValue(null, "availabilityStartTime");
if (attributeValue == null) {
x10 = -9223372036854775807L;
} else {
x10 = d0.x(attributeValue);
}
long j23 = j(xmlPullParser5, "mediaPresentationDuration", -9223372036854775807L);
long j24 = j(xmlPullParser5, "minBufferTime", -9223372036854775807L);
boolean equals = "dynamic".equals(xmlPullParser5.getAttributeValue(null, "type"));
if (equals) {
j10 = j(xmlPullParser5, "minimumUpdatePeriod", -9223372036854775807L);
} else {
j10 = -9223372036854775807L;
}
if (equals) {
j11 = j(xmlPullParser5, "timeShiftBufferDepth", -9223372036854775807L);
} else {
j11 = -9223372036854775807L;
}
if (equals) {
j12 = j(xmlPullParser5, "suggestedPresentationDelay", -9223372036854775807L);
} else {
j12 = -9223372036854775807L;
}
String attributeValue2 = xmlPullParser5.getAttributeValue(null, "publishTime");
if (attributeValue2 == null) {
x11 = -9223372036854775807L;
} else {
x11 = d0.x(attributeValue2);
}
ArrayList arrayList17 = new ArrayList();
if (equals) {
j13 = -9223372036854775807L;
} else {
j13 = 0;
}
String str46 = str;
XmlPullParser xmlPullParser6 = xmlPullParser5;
g gVar = null;
jl.e eVar2 = null;
Uri uri = null;
long j25 = j13;
boolean z18 = false;
boolean z19 = false;
while (true) {
xmlPullParser.next();
String str47 = "BaseURL";
String str48 = "";
long j26 = j10;
if (e2.a.k(xmlPullParser6, "BaseURL")) {
if (z18) {
xmlPullParser2 = xmlPullParser5;
z10 = z18;
j15 = j23;
str2 = str46;
j16 = x10;
j17 = j25;
j14 = j24;
z11 = equals;
arrayList = arrayList17;
obj = null;
str46 = str2;
z18 = z10;
j25 = j17;
} else {
while (true) {
xmlPullParser6.next();
if (xmlPullParser6.getEventType() == 4) {
str45 = xmlPullParser6.getText();
} else {
c(xmlPullParser6);
str45 = str48;
}
if (e2.a.i(xmlPullParser6, "BaseURL")) {
str46 = b0.c(str46, str45);
j14 = j24;
z18 = true;
xmlPullParser2 = xmlPullParser5;
j15 = j23;
j16 = x10;
z11 = equals;
arrayList = arrayList17;
obj = null;
} else {
str48 = str45;
}
}
}
} else {
z10 = z18;
String str49 = "lang";
if (e2.a.k(xmlPullParser6, "ProgramInformation")) {
str2 = str46;
String attributeValue3 = xmlPullParser6.getAttributeValue(null, "moreInformationURL");
if (attributeValue3 == null) {
str43 = null;
} else {
str43 = attributeValue3;
}
String attributeValue4 = xmlPullParser6.getAttributeValue(null, "lang");
if (attributeValue4 == null) {
str44 = null;
} else {
str44 = attributeValue4;
}
String str50 = null;
String str51 = null;
String str52 = null;
do {
xmlPullParser.next();
String str53 = str50;
if (e2.a.k(xmlPullParser6, "Title")) {
str50 = xmlPullParser.nextText();
} else {
if (e2.a.k(xmlPullParser6, "Source")) {
str51 = xmlPullParser.nextText();
} else if (e2.a.k(xmlPullParser6, ExifInterface.TAG_COPYRIGHT)) {
str52 = xmlPullParser.nextText();
} else {
c(xmlPullParser);
}
str50 = str53;
}
} while (!e2.a.i(xmlPullParser6, "ProgramInformation"));
gVar = new g(str50, str51, str52, str43, str44);
j14 = j24;
} else {
str2 = str46;
String str54 = "value";
j14 = j24;
String str55 = "schemeIdUri";
if (e2.a.k(xmlPullParser6, "UTCTiming")) {
eVar2 = new jl.e(xmlPullParser6.getAttributeValue(null, "schemeIdUri"), xmlPullParser6.getAttributeValue(null, "value"), 1);
} else if (e2.a.k(xmlPullParser6, AgentWebPermissions.ACTION_LOCATION)) {
uri = Uri.parse(xmlPullParser.nextText());
} else {
String str56 = "Period";
if (e2.a.k(xmlPullParser6, "Period") && !z19) {
String str57 = "id";
j16 = x10;
String attributeValue5 = xmlPullParser6.getAttributeValue(null, "id");
long j27 = j(xmlPullParser6, "start", j25);
String str58 = "duration";
j15 = j23;
long j28 = j25;
long j29 = j(xmlPullParser6, "duration", -9223372036854775807L);
ArrayList arrayList18 = new ArrayList();
ArrayList arrayList19 = new ArrayList();
XmlPullParser xmlPullParser7 = xmlPullParser6;
String str59 = str2;
j jVar2 = null;
boolean z20 = false;
while (true) {
xmlPullParser.next();
if (e2.a.k(xmlPullParser6, str47)) {
if (!z20) {
String str60 = "";
while (true) {
xmlPullParser6.next();
arrayList2 = arrayList17;
z11 = equals;
if (xmlPullParser6.getEventType() == 4) {
str60 = xmlPullParser6.getText();
} else {
c(xmlPullParser6);
}
String str61 = str60;
if (e2.a.i(xmlPullParser6, str47)) {
str59 = b0.c(str59, str61);
str5 = str47;
str6 = str49;
str42 = str56;
arrayList3 = arrayList18;
arrayList4 = arrayList19;
str8 = str55;
str9 = str54;
obj = null;
z20 = true;
xmlPullParser2 = xmlPullParser5;
str10 = str57;
xmlPullParser4 = xmlPullParser7;
if (!e2.a.i(xmlPullParser6, str42)) {
Pair create = Pair.create(new f(attributeValue5, j27, arrayList3, arrayList4), Long.valueOf(j29));
f fVar = (f) create.first;
if (fVar.f10069b == -9223372036854775807L) {
if (z11) {
j25 = j28;
arrayList = arrayList2;
z19 = true;
} else {
throw new k0.z("Unable to determine start of period " + arrayList2.size());
}
} else {
long longValue = ((Long) create.second).longValue();
if (longValue == -9223372036854775807L) {
arrayList = arrayList2;
j25 = -9223372036854775807L;
} else {
j25 = fVar.f10069b + longValue;
arrayList = arrayList2;
}
arrayList.add(fVar);
}
xmlPullParser6 = xmlPullParser4;
str46 = str2;
z18 = z10;
} else {
xmlPullParser7 = xmlPullParser4;
xmlPullParser5 = xmlPullParser2;
arrayList19 = arrayList4;
str57 = str10;
arrayList17 = arrayList2;
equals = z11;
str54 = str9;
str55 = str8;
arrayList18 = arrayList3;
str47 = str5;
str56 = str42;
str49 = str6;
}
} else {
str60 = str61;
arrayList17 = arrayList2;
equals = z11;
}
}
} else {
arrayList2 = arrayList17;
z11 = equals;
str5 = str47;
str6 = str49;
str4 = str56;
arrayList3 = arrayList18;
arrayList4 = arrayList19;
str8 = str55;
str9 = str54;
obj = null;
xmlPullParser2 = xmlPullParser5;
str10 = str57;
XmlPullParser xmlPullParser8 = xmlPullParser7;
str3 = str59;
xmlPullParser3 = xmlPullParser8;
}
} else {
arrayList2 = arrayList17;
z11 = equals;
str3 = str59;
str4 = str56;
ArrayList arrayList20 = arrayList19;
if (e2.a.k(xmlPullParser6, "AdaptationSet")) {
int l10 = l(xmlPullParser6, str57, -1);
int g10 = g(xmlPullParser);
String str62 = "mimeType";
str7 = str58;
String attributeValue6 = xmlPullParser6.getAttributeValue(null, "mimeType");
str9 = str54;
String str63 = "codecs";
String attributeValue7 = xmlPullParser6.getAttributeValue(null, "codecs");
String str64 = "width";
arrayList3 = arrayList18;
str8 = str55;
int l11 = l(xmlPullParser6, "width", -1);
String str65 = "AdaptationSet";
String str66 = "height";
int l12 = l(xmlPullParser6, "height", -1);
float k2 = k(xmlPullParser6, -1.0f);
String str67 = "SegmentTemplate";
long j30 = j29;
int l13 = l(xmlPullParser6, "audioSamplingRate", -1);
String attributeValue8 = xmlPullParser6.getAttributeValue(null, str49);
String str68 = "SegmentList";
String attributeValue9 = xmlPullParser6.getAttributeValue(null, "label");
ArrayList arrayList21 = new ArrayList();
ArrayList arrayList22 = new ArrayList();
String str69 = attributeValue9;
ArrayList arrayList23 = new ArrayList();
ArrayList arrayList24 = arrayList22;
ArrayList arrayList25 = new ArrayList();
String str70 = "SegmentBase";
ArrayList arrayList26 = new ArrayList();
int i17 = l13;
int i18 = l12;
ArrayList arrayList27 = new ArrayList();
String str71 = "audioSamplingRate";
j jVar3 = jVar2;
String str72 = str3;
int i19 = g10;
String str73 = attributeValue8;
int i20 = -1;
String str74 = null;
boolean z21 = false;
XmlPullParser xmlPullParser9 = xmlPullParser;
while (true) {
xmlPullParser.next();
if (e2.a.k(xmlPullParser9, str47)) {
if (!z21) {
String str75 = "";
while (true) {
xmlPullParser9.next();
str17 = str66;
str18 = str64;
if (xmlPullParser9.getEventType() == 4) {
str75 = xmlPullParser9.getText();
} else {
c(xmlPullParser9);
}
String str76 = str75;
if (e2.a.i(xmlPullParser9, str47)) {
str72 = b0.c(str72, str76);
z21 = true;
str6 = str49;
arrayList5 = arrayList21;
arrayList6 = arrayList25;
arrayList7 = arrayList26;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
j19 = j30;
str24 = str68;
str25 = str70;
arrayList8 = arrayList27;
i = i18;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
str27 = str67;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
str19 = str72;
i10 = i19;
str31 = str65;
str30 = str27;
arrayList11 = arrayList24;
str29 = str24;
arrayList10 = arrayList7;
j20 = j19;
} else {
str75 = str76;
str66 = str17;
str64 = str18;
}
}
} else {
str17 = str66;
str18 = str64;
str19 = str72;
str6 = str49;
arrayList5 = arrayList21;
arrayList6 = arrayList25;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
str30 = str67;
str29 = str68;
arrayList11 = arrayList24;
str25 = str70;
arrayList8 = arrayList27;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
i10 = i19;
arrayList10 = arrayList26;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
j20 = j30;
i = i18;
str31 = str65;
}
} else {
str17 = str66;
str18 = str64;
String str77 = "ContentProtection";
if (e2.a.k(xmlPullParser9, "ContentProtection")) {
Pair f10 = f(xmlPullParser);
Object obj2 = f10.first;
if (obj2 != null) {
str74 = (String) obj2;
}
Object obj3 = f10.second;
if (obj3 != null) {
arrayList21.add(obj3);
}
} else {
if (e2.a.k(xmlPullParser9, "ContentComponent")) {
String attributeValue10 = xmlPullParser9.getAttributeValue(null, str49);
if (str73 == null) {
str73 = attributeValue10;
} else if (attributeValue10 != null) {
e2.a.e(str73.equals(attributeValue10));
}
int g11 = g(xmlPullParser);
if (i19 == -1) {
i19 = g11;
} else if (g11 != -1) {
if (i19 == g11) {
z13 = true;
} else {
z13 = false;
}
e2.a.e(z13);
}
} else if (e2.a.k(xmlPullParser9, "Role")) {
arrayList25.add(i(xmlPullParser9, "Role"));
} else {
String str78 = "AudioChannelConfiguration";
if (e2.a.k(xmlPullParser9, "AudioChannelConfiguration")) {
i20 = e(xmlPullParser);
} else {
str19 = str72;
if (e2.a.k(xmlPullParser9, "Accessibility")) {
arrayList23.add(i(xmlPullParser9, "Accessibility"));
} else if (e2.a.k(xmlPullParser9, "SupplementalProperty")) {
arrayList26.add(i(xmlPullParser9, "SupplementalProperty"));
} else {
str6 = str49;
arrayList5 = arrayList21;
if (e2.a.k(xmlPullParser9, "Representation")) {
int i21 = i19;
String attributeValue11 = xmlPullParser9.getAttributeValue(null, str57);
str21 = str57;
str20 = str73;
int l14 = l(xmlPullParser9, "bandwidth", -1);
String attributeValue12 = xmlPullParser9.getAttributeValue(null, str62);
if (attributeValue12 == null) {
attributeValue12 = attributeValue6;
}
String attributeValue13 = xmlPullParser9.getAttributeValue(null, str63);
if (attributeValue13 == null) {
attributeValue13 = attributeValue7;
}
int l15 = l(xmlPullParser9, str18, l11);
str18 = str18;
i12 = l11;
int l16 = l(xmlPullParser9, str17, i18);
float k10 = k(xmlPullParser9, k2);
int i22 = i17;
str28 = str17;
String str79 = str71;
int l17 = l(xmlPullParser9, str79, i22);
i11 = i22;
ArrayList arrayList28 = new ArrayList();
str26 = str79;
ArrayList arrayList29 = new ArrayList();
XmlPullParser xmlPullParser10 = xmlPullParser9;
ArrayList arrayList30 = new ArrayList();
str22 = str62;
str23 = str63;
int i23 = i20;
XmlPullParser xmlPullParser11 = xmlPullParser10;
j jVar4 = jVar3;
String str80 = str19;
boolean z22 = false;
String str81 = null;
while (true) {
xmlPullParser.next();
if (e2.a.k(xmlPullParser11, str47)) {
if (!z22) {
String str82 = "";
while (true) {
xmlPullParser11.next();
arrayList12 = arrayList23;
arrayList13 = arrayList25;
if (xmlPullParser11.getEventType() == 4) {
str82 = xmlPullParser11.getText();
} else {
c(xmlPullParser11);
}
String str83 = str82;
if (e2.a.i(xmlPullParser11, str47)) {
str80 = b0.c(str80, str83);
z22 = true;
} else {
str82 = str83;
arrayList23 = arrayList12;
arrayList25 = arrayList13;
}
}
} else {
arrayList12 = arrayList23;
arrayList13 = arrayList25;
}
str32 = str70;
} else {
arrayList12 = arrayList23;
arrayList13 = arrayList25;
if (e2.a.k(xmlPullParser11, str78)) {
e10 = e(xmlPullParser);
str24 = str68;
str32 = str70;
str5 = str47;
str33 = str78;
j21 = j30;
i = i18;
str35 = str77;
str27 = str67;
str36 = str81;
jVar = jVar4;
if (!e2.a.i(xmlPullParser11, "Representation")) {
if (m.h(attributeValue12)) {
str37 = m.a(attributeValue13);
} else if (m.j(attributeValue12)) {
str37 = m.g(attributeValue13);
} else if (d(attributeValue12)) {
str37 = attributeValue12;
} else {
if ("application/mp4".equals(attributeValue12)) {
if (attributeValue13 != null) {
if (attributeValue13.startsWith("stpp")) {
str37 = "application/ttml+xml";
} else if (attributeValue13.startsWith("wvtt")) {
str37 = "application/x-mp4-vtt";
}
}
str37 = null;
} else {
if ("application/x-rawcc".equals(attributeValue12) && attributeValue13 != null) {
if (attributeValue13.contains("cea708")) {
str37 = "application/cea-708";
} else if (attributeValue13.contains("eia608") || attributeValue13.contains("cea608")) {
str37 = "application/cea-608";
}
}
str37 = null;
}
str19 = str72;
i10 = i19;
str31 = str65;
str30 = str27;
arrayList11 = arrayList24;
str29 = str24;
arrayList10 = arrayList7;
j20 = j19;
}
arrayList7 = arrayList26;
int i24 = 0;
while (true) {
j19 = j21;
str38 = "urn:mpeg:dash:role:2011";
if (i24 < arrayList13.size()) {
arrayList14 = arrayList13;
d dVar = (d) arrayList14.get(i24);
if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar.f10061a) && "main".equals(dVar.f10062b)) {
i13 = 1;
} else {
i24++;
arrayList13 = arrayList14;
j21 = j19;
}
} else {
arrayList14 = arrayList13;
i13 = 0;
}
}
int i25 = 0;
int i26 = 0;
while (i25 < arrayList14.size()) {
d dVar2 = (d) arrayList14.get(i25);
ArrayList arrayList31 = arrayList14;
if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar2.f10061a)) {
i26 |= h(dVar2.f10062b);
}
i25++;
arrayList14 = arrayList31;
}
arrayList6 = arrayList14;
int i27 = 0;
int i28 = 0;
while (true) {
String str84 = str32;
if (i27 < arrayList12.size()) {
ArrayList arrayList32 = arrayList12;
d dVar3 = (d) arrayList32.get(i27);
ArrayList arrayList33 = arrayList29;
boolean equalsIgnoreCase = str38.equalsIgnoreCase(dVar3.f10061a);
String str85 = str38;
String str86 = dVar3.f10062b;
if (equalsIgnoreCase) {
i16 = h(str86);
} else if ("urn:tva:metadata:cs:AudioPurposeCS:2007".equalsIgnoreCase(dVar3.f10061a)) {
if (str86 != null) {
switch (str86.hashCode()) {
case 49:
if (str86.equals(PushConstants.PUSH_TYPE_THROUGH_MESSAGE)) {
c4 = 0;
break;
}
c4 = 65535;
break;
case 50:
if (str86.equals("2")) {
c4 = 1;
break;
}
c4 = 65535;
break;
case 51:
if (str86.equals("3")) {
c4 = 2;
break;
}
c4 = 65535;
break;
case 52:
if (str86.equals(PushConstants.PUSH_TYPE_WITHDRAW_NOTIFICATION)) {
c4 = 3;
break;
}
c4 = 65535;
break;
case 53:
default:
c4 = 65535;
break;
case 54:
if (str86.equals("6")) {
c4 = 4;
break;
}
c4 = 65535;
break;
}
if (c4 != 0) {
if (c4 != 1) {
if (c4 != 2) {
if (c4 != 3) {
if (c4 == 4) {
i16 = 1;
}
} else {
i16 = 8;
}
} else {
i16 = 4;
}
} else {
i16 = 2048;
}
} else {
i16 = 512;
}
}
i16 = 0;
} else {
i27++;
arrayList12 = arrayList32;
str38 = str85;
str32 = str84;
arrayList29 = arrayList33;
}
i28 |= i16;
i27++;
arrayList12 = arrayList32;
str38 = str85;
str32 = str84;
arrayList29 = arrayList33;
} else {
ArrayList arrayList34 = arrayList29;
arrayList9 = arrayList12;
int i29 = i26 | i28;
if (str37 != null) {
if ("audio/eac3".equals(str37)) {
for (int i30 = 0; i30 < arrayList30.size(); i30++) {
d dVar4 = (d) arrayList30.get(i30);
String str87 = dVar4.f10061a;
boolean equals2 = "tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str87);
String str88 = dVar4.f10062b;
if ((equals2 && "JOC".equals(str88)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str87) && "ec+3".equals(str88))) {
str37 = "audio/eac3-joc";
}
}
str37 = "audio/eac3";
}
if (m.j(str37)) {
y10 = Format.F(attributeValue11, null, attributeValue12, str37, attributeValue13, null, l14, l15, l16, k10, null, i13, i29);
} else if (m.h(str37)) {
y10 = Format.u(attributeValue11, null, attributeValue12, str37, attributeValue13, null, l14, e10, l17, null, i13, i29, str20);
} else if (d(str37)) {
if ("application/cea-608".equals(str37)) {
for (int i31 = 0; i31 < arrayList9.size(); i31++) {
d dVar5 = (d) arrayList9.get(i31);
if ("urn:scte:dash:cc:cea-608:2015".equals(dVar5.f10061a) && (str41 = dVar5.f10062b) != null) {
Matcher matcher = f10051c.matcher(str41);
if (matcher.matches()) {
parseInt = Integer.parseInt(matcher.group(1));
i15 = parseInt;
y10 = Format.C(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20, i15);
} else {
Log.w("MpdParser", "Unable to parse CEA-608 channel number from: ".concat(str41));
}
}
}
parseInt = -1;
i15 = parseInt;
y10 = Format.C(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20, i15);
} else if ("application/cea-708".equals(str37)) {
for (int i32 = 0; i32 < arrayList9.size(); i32++) {
d dVar6 = (d) arrayList9.get(i32);
if ("urn:scte:dash:cc:cea-708:2015".equals(dVar6.f10061a) && (str40 = dVar6.f10062b) != null) {
Matcher matcher2 = f10052d.matcher(str40);
if (matcher2.matches()) {
parseInt = Integer.parseInt(matcher2.group(1));
i15 = parseInt;
y10 = Format.C(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20, i15);
} else {
Log.w("MpdParser", "Unable to parse CEA-708 service block number from: ".concat(str40));
}
}
}
parseInt = -1;
i15 = parseInt;
y10 = Format.C(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20, i15);
} else {
i15 = -1;
y10 = Format.C(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20, i15);
}
if (jVar != null) {
eVar = jVar;
} else {
eVar = new j.e();
}
a aVar2 = new a(y10, str80, eVar, str36, arrayList28, arrayList34);
str39 = y10.f1436m;
if (!TextUtils.isEmpty(str39)) {
if (m.j(str39)) {
i14 = 2;
} else if (m.h(str39)) {
i14 = 1;
} else if (d(str39)) {
i14 = 3;
}
if (i21 != -1) {
i19 = i14;
} else {
if (i14 != -1) {
if (i21 == i14) {
z12 = true;
} else {
z12 = false;
}
e2.a.e(z12);
}
i19 = i21;
}
arrayList8 = arrayList27;
arrayList8.add(aVar2);
xmlPullParser2 = xmlPullParser;
str25 = str84;
}
i14 = -1;
if (i21 != -1) {
}
arrayList8 = arrayList27;
arrayList8.add(aVar2);
xmlPullParser2 = xmlPullParser;
str25 = str84;
}
if (jVar != null) {
}
a aVar22 = new a(y10, str80, eVar, str36, arrayList28, arrayList34);
str39 = y10.f1436m;
if (!TextUtils.isEmpty(str39)) {
}
i14 = -1;
if (i21 != -1) {
}
arrayList8 = arrayList27;
arrayList8.add(aVar22);
xmlPullParser2 = xmlPullParser;
str25 = str84;
}
y10 = Format.y(attributeValue11, null, attributeValue12, str37, attributeValue13, l14, i13, i29, str20);
if (jVar != null) {
}
a aVar222 = new a(y10, str80, eVar, str36, arrayList28, arrayList34);
str39 = y10.f1436m;
if (!TextUtils.isEmpty(str39)) {
}
i14 = -1;
if (i21 != -1) {
}
arrayList8 = arrayList27;
arrayList8.add(aVar222);
xmlPullParser2 = xmlPullParser;
str25 = str84;
}
}
} else {
long j31 = j21;
xmlPullParser11 = xmlPullParser;
str81 = str36;
jVar4 = jVar;
str67 = str27;
str47 = str5;
str78 = str33;
str77 = str35;
i23 = e10;
arrayList25 = arrayList13;
str68 = str24;
str70 = str32;
i18 = i;
arrayList23 = arrayList12;
j30 = j31;
}
} else {
str32 = str70;
if (e2.a.k(xmlPullParser11, str32)) {
jVar4 = p(xmlPullParser11, (j.e) jVar4);
} else {
String str89 = str68;
if (e2.a.k(xmlPullParser11, str89)) {
str5 = str47;
str24 = str89;
str33 = str78;
j21 = j30;
str27 = str67;
i = i18;
str34 = str80;
r10 = q(xmlPullParser11, (j.b) jVar4, j21);
} else {
str5 = str47;
str24 = str89;
str33 = str78;
String str90 = str67;
j21 = j30;
if (e2.a.k(xmlPullParser11, str90)) {
str34 = str80;
str27 = str90;
i = i18;
r10 = r(xmlPullParser, (j.c) jVar4, arrayList26, j21);
} else {
str27 = str90;
str34 = str80;
i = i18;
if (e2.a.k(xmlPullParser11, str77)) {
Pair f11 = f(xmlPullParser);
str35 = str77;
Object obj4 = f11.first;
if (obj4 != null) {
str81 = (String) obj4;
}
Object obj5 = f11.second;
if (obj5 != null) {
arrayList28.add(obj5);
}
} else {
str35 = str77;
if (e2.a.k(xmlPullParser11, "InbandEventStream")) {
arrayList29.add(i(xmlPullParser11, "InbandEventStream"));
} else if (e2.a.k(xmlPullParser11, "SupplementalProperty")) {
arrayList30.add(i(xmlPullParser11, "SupplementalProperty"));
} else {
c(xmlPullParser);
}
}
str80 = str34;
str36 = str81;
jVar = jVar4;
e10 = i23;
if (!e2.a.i(xmlPullParser11, "Representation")) {
}
}
}
str35 = str77;
jVar4 = r10;
str80 = str34;
str36 = str81;
jVar = jVar4;
e10 = i23;
if (!e2.a.i(xmlPullParser11, "Representation")) {
}
}
}
}
str33 = str78;
j21 = j30;
str24 = str68;
i = i18;
str5 = str47;
str35 = str77;
str27 = str67;
str36 = str81;
jVar = jVar4;
e10 = i23;
if (!e2.a.i(xmlPullParser11, "Representation")) {
}
}
} else {
arrayList6 = arrayList25;
arrayList7 = arrayList26;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
j19 = j30;
str24 = str68;
str25 = str70;
arrayList8 = arrayList27;
i = i18;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
i10 = i19;
str27 = str67;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
if (e2.a.k(xmlPullParser2, str25)) {
jVar3 = p(xmlPullParser2, (j.e) jVar3);
i19 = i10;
} else {
str29 = str24;
if (e2.a.k(xmlPullParser2, str29)) {
j20 = j19;
jVar3 = q(xmlPullParser2, (j.b) jVar3, j20);
str30 = str27;
arrayList10 = arrayList7;
} else {
str30 = str27;
j20 = j19;
if (e2.a.k(xmlPullParser2, str30)) {
arrayList10 = arrayList7;
jVar3 = r(xmlPullParser2, (j.c) jVar3, arrayList10, j20);
} else {
arrayList10 = arrayList7;
if (e2.a.k(xmlPullParser2, "InbandEventStream")) {
arrayList11 = arrayList24;
arrayList11.add(i(xmlPullParser2, "InbandEventStream"));
} else {
arrayList11 = arrayList24;
if (e2.a.k(xmlPullParser2, "Label")) {
String str91 = "";
do {
xmlPullParser.next();
if (xmlPullParser.getEventType() == 4) {
str91 = xmlPullParser.getText();
} else {
c(xmlPullParser);
}
} while (!e2.a.i(xmlPullParser2, "Label"));
str69 = str91;
} else if (e2.a.j(xmlPullParser)) {
c(xmlPullParser);
}
}
xmlPullParser9 = xmlPullParser2;
str31 = str65;
}
}
xmlPullParser9 = xmlPullParser2;
str31 = str65;
arrayList11 = arrayList24;
}
}
xmlPullParser9 = xmlPullParser2;
str72 = str19;
str19 = str72;
i10 = i19;
str31 = str65;
str30 = str27;
arrayList11 = arrayList24;
str29 = str24;
arrayList10 = arrayList7;
j20 = j19;
}
str6 = str49;
arrayList5 = arrayList21;
arrayList6 = arrayList25;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
str30 = str67;
str29 = str68;
arrayList11 = arrayList24;
str25 = str70;
arrayList8 = arrayList27;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
i10 = i19;
arrayList10 = arrayList26;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
j20 = j30;
i = i18;
str31 = str65;
}
}
str19 = str72;
str6 = str49;
arrayList5 = arrayList21;
arrayList6 = arrayList25;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
str30 = str67;
str29 = str68;
arrayList11 = arrayList24;
str25 = str70;
arrayList8 = arrayList27;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
i10 = i19;
arrayList10 = arrayList26;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
j20 = j30;
i = i18;
str31 = str65;
}
str6 = str49;
arrayList5 = arrayList21;
arrayList6 = arrayList25;
arrayList7 = arrayList26;
str20 = str73;
str21 = str57;
str22 = str62;
str23 = str63;
j19 = j30;
str24 = str68;
str25 = str70;
arrayList8 = arrayList27;
i = i18;
str26 = str71;
str5 = str47;
arrayList9 = arrayList23;
str27 = str67;
i11 = i17;
str28 = str17;
xmlPullParser2 = xmlPullParser;
i12 = l11;
str19 = str72;
i10 = i19;
str31 = str65;
str30 = str27;
arrayList11 = arrayList24;
str29 = str24;
arrayList10 = arrayList7;
j20 = j19;
}
if (e2.a.i(xmlPullParser9, str31)) {
ArrayList arrayList35 = new ArrayList(arrayList8.size());
int i33 = 0;
while (i33 < arrayList8.size()) {
a aVar3 = (a) arrayList8.get(i33);
Format format = aVar3.f10054a;
if (str69 != null) {
j22 = j20;
format = new Format(format.f1428a, str69, format.f1430c, format.f1431d, format.f1432e, format.f1433f, format.f1434g, format.f1435h, format.f1436m, format.f1437n, format.f1438o, format.f1439p, format.q, format.f1440r, format.f1441s, format.f1442t, format.f1443u, format.f1444v, format.f1446x, format.f1445w, format.f1447y, format.f1448z, format.A, format.B, format.C, format.D, format.E, format.F, format.G);
} else {
j22 = j20;
}
String str92 = aVar3.f10057d;
if (str92 == null) {
str92 = str74;
}
ArrayList<DrmInitData.SchemeData> arrayList36 = aVar3.f10058e;
ArrayList arrayList37 = arrayList5;
arrayList36.addAll(arrayList37);
if (!arrayList36.isEmpty()) {
int size = arrayList36.size() - 1;
while (size >= 0) {
DrmInitData.SchemeData schemeData = arrayList36.get(size);
if (schemeData.f1457e != null) {
z14 = true;
} else {
z14 = false;
}
ArrayList arrayList38 = arrayList8;
if (!z14) {
int i34 = 0;
while (i34 < arrayList36.size()) {
DrmInitData.SchemeData schemeData2 = arrayList36.get(i34);
arrayList16 = arrayList37;
if (schemeData2.f1457e != null) {
z15 = true;
} else {
z15 = false;
}
if (z15) {
if (schemeData.f1457e != null) {
z17 = true;
} else {
z17 = false;
}
if (!z17 && schemeData2.a(schemeData.f1454b)) {
z16 = true;
if (!z16) {
arrayList36.remove(size);
size--;
arrayList8 = arrayList38;
arrayList37 = arrayList16;
} else {
i34++;
arrayList37 = arrayList16;
}
}
}
z16 = false;
if (!z16) {
}
}
}
arrayList16 = arrayList37;
size--;
arrayList8 = arrayList38;
arrayList37 = arrayList16;
}
arrayList15 = arrayList8;
arrayList5 = arrayList37;
format = format.a(new DrmInitData(str92, arrayList36), format.f1434g);
} else {
arrayList15 = arrayList8;
arrayList5 = arrayList37;
}
Format format2 = format;
ArrayList<d> arrayList39 = aVar3.f10059f;
arrayList39.addAll(arrayList11);
long j32 = aVar3.f10060g;
String str93 = aVar3.f10055b;
j jVar5 = aVar3.f10056c;
if (jVar5 instanceof j.e) {
aVar = new i.b(j32, format2, str93, (j.e) jVar5, arrayList39);
} else if (jVar5 instanceof j.a) {
aVar = new i.a(j32, format2, str93, (j.a) jVar5, arrayList39);
} else {
throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase");
}
arrayList35.add(aVar);
i33++;
j20 = j22;
arrayList8 = arrayList15;
}
j18 = j20;
arrayList3.add(new m1.a(l10, i10, arrayList35, arrayList9, arrayList10));
xmlPullParser6 = xmlPullParser2;
arrayList4 = arrayList20;
str10 = str21;
} else {
str70 = str25;
str67 = str30;
str65 = str31;
arrayList27 = arrayList8;
arrayList24 = arrayList11;
i18 = i;
str47 = str5;
str66 = str28;
i17 = i11;
str64 = str18;
str49 = str6;
arrayList21 = arrayList5;
str57 = str21;
str73 = str20;
str71 = str26;
str63 = str23;
arrayList25 = arrayList6;
str68 = str29;
j30 = j20;
l11 = i12;
str72 = str19;
arrayList26 = arrayList10;
i19 = i10;
arrayList23 = arrayList9;
str62 = str22;
}
}
} else {
str5 = str47;
str6 = str49;
j18 = j29;
str7 = str58;
str8 = str55;
String str94 = str57;
str9 = str54;
xmlPullParser2 = xmlPullParser5;
ArrayList arrayList40 = arrayList18;
if (e2.a.k(xmlPullParser6, "EventStream")) {
String str95 = str8;
String attributeValue14 = xmlPullParser6.getAttributeValue(null, str95);
if (attributeValue14 == null) {
str11 = "";
} else {
str11 = attributeValue14;
}
String str96 = str9;
String attributeValue15 = xmlPullParser6.getAttributeValue(null, str96);
if (attributeValue15 == null) {
str12 = "";
} else {
str12 = attributeValue15;
}
long m10 = m(xmlPullParser6, "timescale", 1L);
ArrayList arrayList41 = new ArrayList();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
while (true) {
xmlPullParser.next();
String str97 = "Event";
if (e2.a.k(xmlPullParser6, "Event")) {
arrayList3 = arrayList40;
str8 = str95;
str10 = str94;
long m11 = m(xmlPullParser6, str10, 0L);
String str98 = str7;
long m12 = m(xmlPullParser6, str98, -9223372036854775807L);
long m13 = m(xmlPullParser6, "presentationTime", 0L);
long A = d0.A(m12, 1000L, m10);
long A2 = d0.A(m13, 1000000L, m10);
String attributeValue16 = xmlPullParser6.getAttributeValue(null, "messageData");
if (attributeValue16 == null) {
str13 = null;
} else {
str13 = attributeValue16;
}
byteArrayOutputStream.reset();
XmlSerializer newSerializer = Xml.newSerializer();
newSerializer.setOutput(byteArrayOutputStream, Key.STRING_CHARSET_NAME);
xmlPullParser.nextToken();
while (!e2.a.i(xmlPullParser6, str97)) {
switch (xmlPullParser.getEventType()) {
case 0:
str14 = str97;
str15 = str98;
str16 = str96;
newSerializer.startDocument(null, Boolean.FALSE);
break;
case 1:
str14 = str97;
str15 = str98;
str16 = str96;
newSerializer.endDocument();
break;
case 2:
str14 = str97;
newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
int i35 = 0;
while (i35 < xmlPullParser.getAttributeCount()) {
newSerializer.attribute(xmlPullParser6.getAttributeNamespace(i35), xmlPullParser6.getAttributeName(i35), xmlPullParser6.getAttributeValue(i35));
i35++;
str98 = str98;
str96 = str96;
}
str15 = str98;
str16 = str96;
break;
case 3:
str14 = str97;
newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
str15 = str98;
str16 = str96;
break;
case 4:
newSerializer.text(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 5:
newSerializer.cdsect(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 6:
newSerializer.entityRef(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 7:
newSerializer.ignorableWhitespace(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 8:
newSerializer.processingInstruction(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 9:
newSerializer.comment(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
case 10:
newSerializer.docdecl(xmlPullParser.getText());
str14 = str97;
str15 = str98;
str16 = str96;
break;
default:
str14 = str97;
str15 = str98;
str16 = str96;
break;
}
xmlPullParser.nextToken();
str97 = str14;
str98 = str15;
str96 = str16;
}
str7 = str98;
str9 = str96;
newSerializer.flush();
byte[] byteArray = byteArrayOutputStream.toByteArray();
Long valueOf = Long.valueOf(A2);
if (str13 != null) {
byteArray = d0.q(str13);
}
arrayList41.add(Pair.create(valueOf, new EventMessage(str11, str12, A, m11, byteArray)));
} else {
arrayList3 = arrayList40;
str8 = str95;
str9 = str96;
str10 = str94;
c(xmlPullParser);
}
if (e2.a.i(xmlPullParser6, "EventStream")) {
long[] jArr = new long[arrayList41.size()];
EventMessage[] eventMessageArr = new EventMessage[arrayList41.size()];
for (int i36 = 0; i36 < arrayList41.size(); i36++) {
Pair pair = (Pair) arrayList41.get(i36);
jArr[i36] = ((Long) pair.first).longValue();
eventMessageArr[i36] = (EventMessage) pair.second;
}
arrayList4 = arrayList20;
arrayList4.add(new e(str11, str12, jArr, eventMessageArr));
} else {
str94 = str10;
str96 = str9;
str95 = str8;
arrayList40 = arrayList3;
}
}
} else {
arrayList3 = arrayList40;
arrayList4 = arrayList20;
str58 = str7;
str10 = str94;
if (e2.a.k(xmlPullParser6, "SegmentBase")) {
obj = null;
jVar2 = p(xmlPullParser6, null);
j29 = j18;
} else {
obj = null;
if (e2.a.k(xmlPullParser6, "SegmentList")) {
j29 = j18;
jVar2 = q(xmlPullParser6, null, j29);
} else {
j29 = j18;
if (e2.a.k(xmlPullParser6, "SegmentTemplate")) {
jVar2 = r(xmlPullParser2, null, Collections.emptyList(), j29);
} else {
c(xmlPullParser);
}
}
}
xmlPullParser3 = xmlPullParser2;
}
}
xmlPullParser3 = xmlPullParser2;
str58 = str7;
j29 = j18;
obj = null;
}
xmlPullParser4 = xmlPullParser3;
str59 = str3;
str42 = str4;
if (!e2.a.i(xmlPullParser6, str42)) {
}
}
} else {
xmlPullParser2 = xmlPullParser5;
j15 = j23;
j16 = x10;
j17 = j25;
z11 = equals;
arrayList = arrayList17;
obj = null;
c(xmlPullParser);
str46 = str2;
z18 = z10;
j25 = j17;
}
}
}
str46 = str2;
z18 = z10;
xmlPullParser2 = xmlPullParser5;
j15 = j23;
j16 = x10;
z11 = equals;
arrayList = arrayList17;
obj = null;
}
if (e2.a.i(xmlPullParser6, "MPD")) {
if (j15 == -9223372036854775807L) {
if (j25 == -9223372036854775807L) {
if (!z11) {
throw new k0.z("Unable to determine duration of static manifest.");
}
}
if (arrayList.isEmpty()) {
return new b(j16, j25, j14, z11, j26, j11, j12, x11, gVar, eVar2, uri, arrayList);
}
throw new k0.z("No periods found.");
}
j25 = j15;
if (arrayList.isEmpty()) {
}
} else {
xmlPullParser5 = xmlPullParser2;
arrayList17 = arrayList;
j10 = j26;
j24 = j14;
x10 = j16;
j23 = j15;
equals = z11;
}
}
}
}