MD5 校验值:61e58c10a11e4adec8760ee3854e996a
C1812d.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。
package h2; import I1.AbstractC0008g; import I1.w; import T5.C; import android.net.Uri; import android.text.TextUtils; import android.util.Base64; import android.util.Log; import android.util.Pair; import android.util.Xml; import com.google.android.gms.internal.ads.C1691zb; 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 org.apache.http.HttpHeaders; import org.apache.http.protocol.HTTP; import org.mozilla.javascript.ES6Iterator; import org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper; import org.schabi.newpipe.extractor.services.youtube.dashmanifestcreators.YoutubeDashManifestCreatorsUtils; 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 x2.y; public final class C1812d extends DefaultHandler implements y { public static final Pattern e = Pattern.compile("(\\d+)(?:/(\\d+))?"); public static final Pattern f15661f = Pattern.compile("CC([1-4])=.*"); public static final Pattern f15662j = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*"); public final XmlPullParserFactory f15663b; public C1812d() { try { this.f15663b = XmlPullParserFactory.newInstance(); } catch (XmlPullParserException e7) { throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e7); } } public static long a(ArrayList arrayList, long j5, long j6, int i5, long j7) { int i6; if (i5 >= 0) { i6 = i5 + 1; } else { int i7 = z2.q.f19694a; i6 = (int) ((((j7 - j5) + j6) - 1) / j6); } for (int i8 = 0; i8 < i6; i8++) { arrayList.add(new p(j5, j6)); j5 += j6; } return j5; } public static void b(XmlPullParser xmlPullParser) { if (!z2.b.n(xmlPullParser)) { return; } int i5 = 1; while (i5 != 0) { xmlPullParser.next(); if (z2.b.n(xmlPullParser)) { i5++; } else if (xmlPullParser.getEventType() == 3) { i5--; } } } public static boolean c(String str) { if (!"text".equals(z2.h.e(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 d(XmlPullParser xmlPullParser) { String B6; char c7; String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri"); if (attributeValue == null) { attributeValue = null; } int i5 = -1; if ("urn:mpeg:dash:23003:3:audio_channel_configuration:2011".equals(attributeValue)) { i5 = k(xmlPullParser, ES6Iterator.VALUE_PROPERTY, -1); } else if (("tag:dolby.com,2014:dash:audio_channel_configuration:2011".equals(attributeValue) || "urn:dolby:dash:audio_channel_configuration:2011".equals(attributeValue)) && (B6 = z2.q.B(xmlPullParser.getAttributeValue(null, ES6Iterator.VALUE_PROPERTY))) != null) { switch (B6.hashCode()) { case 1596796: if (B6.equals("4000")) { c7 = 0; break; } c7 = 65535; break; case 2937391: if (B6.equals("a000")) { c7 = 1; break; } c7 = 65535; break; case 3094035: if (B6.equals("f801")) { c7 = 2; break; } c7 = 65535; break; case 3133436: if (B6.equals("fa01")) { c7 = 3; break; } c7 = 65535; break; default: c7 = 65535; break; } switch (c7) { case 0: i5 = 1; break; case 1: i5 = 2; break; case 2: i5 = 6; break; case 3: i5 = 8; break; } } do { xmlPullParser.next(); } while (!z2.b.m(xmlPullParser, YoutubeDashManifestCreatorsUtils.AUDIO_CHANNEL_CONFIGURATION)); return i5; } public static Pair e(XmlPullParser xmlPullParser) { String str; ?? r5; String str2; String str3; ?? r6; char c7; String str4; M1.b bVar = null; String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri"); if (attributeValue != null) { String B6 = z2.q.B(attributeValue); B6.getClass(); switch (B6.hashCode()) { case 489446379: if (B6.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) { c7 = 0; break; } c7 = 65535; break; case 755418770: if (B6.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) { c7 = 1; break; } c7 = 65535; break; case 1812765994: if (B6.equals("urn:mpeg:dash:mp4protection:2011")) { c7 = 2; break; } c7 = 65535; break; default: c7 = 65535; break; } switch (c7) { case 0: r5 = AbstractC0008g.d; str = null; str2 = null; str3 = str2; r6 = str2; break; case 1: r5 = AbstractC0008g.f967c; str = null; str2 = null; str3 = str2; r6 = str2; break; case 2: str = xmlPullParser.getAttributeValue(null, ES6Iterator.VALUE_PROPERTY); int attributeCount = xmlPullParser.getAttributeCount(); int i5 = 0; while (true) { if (i5 < attributeCount) { String attributeName = xmlPullParser.getAttributeName(i5); int indexOf = attributeName.indexOf(58); if (indexOf != -1) { attributeName = attributeName.substring(indexOf + 1); } if (attributeName.equals("default_KID")) { str4 = xmlPullParser.getAttributeValue(i5); } else { i5++; } } else { str4 = null; } } if (!TextUtils.isEmpty(str4) && !"00000000-0000-0000-0000-000000000000".equals(str4)) { String[] split = str4.split("\\s+"); UUID[] uuidArr = new UUID[split.length]; for (int i6 = 0; i6 < split.length; i6++) { uuidArr[i6] = UUID.fromString(split[i6]); } r5 = AbstractC0008g.f966b; str3 = null; r6 = S1.m.a(r5, uuidArr, null); break; } else { r5 = null; str2 = r5; str3 = str2; r6 = str2; break; } break; } do { xmlPullParser.next(); if (!z2.b.o(xmlPullParser, "ms:laurl")) { str3 = xmlPullParser.getAttributeValue(null, "licenseUrl"); r6 = r6; } else { if (r6 == 0 && z2.b.n(xmlPullParser)) { String name = xmlPullParser.getName(); int indexOf2 = name.indexOf(58); if (indexOf2 != -1) { name = name.substring(indexOf2 + 1); } if (name.equals("pssh") && xmlPullParser.next() == 4) { byte[] decode = Base64.decode(xmlPullParser.getText(), 0); UUID h6 = S1.m.h(decode); if (h6 == null) { Log.w("MpdParser", "Skipping malformed cenc:pssh data"); r5 = h6; r6 = 0; } else { r6 = decode; r5 = h6; } } } if (r6 == 0) { ?? r9 = AbstractC0008g.d; if (r9.equals(r5) && z2.b.o(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) { r6 = S1.m.a(r9, null, Base64.decode(xmlPullParser.getText(), 0)); } } b(xmlPullParser); r6 = r6; } } while (!z2.b.m(xmlPullParser, "ContentProtection")); if (r5 != null) { bVar = new M1.b(r5, str3, "video/mp4", r6); } return Pair.create(str, bVar); } str = null; r5 = null; str2 = r5; str3 = str2; r6 = str2; do { xmlPullParser.next(); if (!z2.b.o(xmlPullParser, "ms:laurl")) { } } while (!z2.b.m(xmlPullParser, "ContentProtection")); if (r5 != null) { } return Pair.create(str, bVar); } public static int f(XmlPullParser xmlPullParser) { String attributeValue = xmlPullParser.getAttributeValue(null, "contentType"); if (TextUtils.isEmpty(attributeValue)) { return -1; } if ("audio".equals(attributeValue)) { return 1; } if ("video".equals(attributeValue)) { return 2; } if (!"text".equals(attributeValue)) { return -1; } return 3; } public static int g(String str) { if (str == null) { return 0; } char c7 = 65535; switch (str.hashCode()) { case -2060497896: if (str.equals("subtitle")) { c7 = 0; break; } break; case -1724546052: if (str.equals("description")) { c7 = 1; break; } break; case -1580883024: if (str.equals("enhanced-audio-intelligibility")) { c7 = 2; break; } break; case -1408024454: if (str.equals("alternate")) { c7 = 3; break; } break; case 99825: if (str.equals("dub")) { c7 = 4; break; } break; case 3343801: if (str.equals("main")) { c7 = 5; break; } break; case 3530173: if (str.equals("sign")) { c7 = 6; break; } break; case 552573414: if (str.equals("caption")) { c7 = 7; break; } break; case 899152809: if (str.equals("commentary")) { c7 = '\b'; break; } break; case 1629013393: if (str.equals("emergency")) { c7 = '\t'; break; } break; case 1855372047: if (str.equals("supplementary")) { c7 = '\n'; break; } break; } switch (c7) { 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 C1813e h(XmlPullParser xmlPullParser, String str) { String str2 = null; String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri"); if (attributeValue == null) { attributeValue = ""; } String attributeValue2 = xmlPullParser.getAttributeValue(null, ES6Iterator.VALUE_PROPERTY); if (attributeValue2 == null) { attributeValue2 = null; } String attributeValue3 = xmlPullParser.getAttributeValue(null, "id"); if (attributeValue3 != null) { str2 = attributeValue3; } do { xmlPullParser.next(); } while (!z2.b.m(xmlPullParser, str)); return new C1813e(attributeValue, attributeValue2, str2); } public static long i(XmlPullParser xmlPullParser, String str, long j5) { double d; double d4; double d6; double d7; double d8; String attributeValue = xmlPullParser.getAttributeValue(null, str); if (attributeValue == null) { return j5; } Matcher matcher = z2.q.f19699h.matcher(attributeValue); if (matcher.matches()) { boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1)); String group = matcher.group(3); double d9 = 0.0d; if (group != null) { d = Double.parseDouble(group) * 3.1556908E7d; } else { d = 0.0d; } String group2 = matcher.group(5); if (group2 != null) { d4 = Double.parseDouble(group2) * 2629739.0d; } else { d4 = 0.0d; } double d10 = d + d4; String group3 = matcher.group(7); if (group3 != null) { d6 = Double.parseDouble(group3) * 86400.0d; } else { d6 = 0.0d; } double d11 = d10 + d6; String group4 = matcher.group(10); if (group4 != null) { d7 = Double.parseDouble(group4) * 3600.0d; } else { d7 = 0.0d; } double d12 = d11 + d7; String group5 = matcher.group(12); if (group5 != null) { d8 = Double.parseDouble(group5) * 60.0d; } else { d8 = 0.0d; } double d13 = d12 + d8; String group6 = matcher.group(14); if (group6 != null) { d9 = Double.parseDouble(group6); } long j6 = (long) ((d13 + d9) * 1000.0d); if (isEmpty) { return -j6; } return j6; } return (long) (Double.parseDouble(attributeValue) * 3600.0d * 1000.0d); } public static float j(XmlPullParser xmlPullParser, float f7) { String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate"); if (attributeValue != null) { Matcher matcher = e.matcher(attributeValue); if (matcher.matches()) { int parseInt = Integer.parseInt(matcher.group(1)); float f8 = parseInt; if (!TextUtils.isEmpty(matcher.group(2))) { return f8 / Integer.parseInt(r2); } return f8; } return f7; } return f7; } public static int k(XmlPullParser xmlPullParser, String str, int i5) { String attributeValue = xmlPullParser.getAttributeValue(null, str); if (attributeValue != null) { return Integer.parseInt(attributeValue); } return i5; } public static long l(XmlPullParser xmlPullParser, String str, long j5) { String attributeValue = xmlPullParser.getAttributeValue(null, str); if (attributeValue != null) { return Long.parseLong(attributeValue); } return j5; } public static C1810b m(XmlPullParser xmlPullParser, String str) { long v6; long j5; long j6; long j7; long v7; long j8; String str2; long j9; ArrayList arrayList; long j10; long j11; long j12; long j13; boolean z6; XmlPullParser xmlPullParser2; Object obj; String str3; ArrayList arrayList2; String str4; String str5; String str6; ArrayList arrayList3; ArrayList arrayList4; String str7; String str8; String str9; String str10; long j14; r r5; String str11; String str12; String str13; ByteArrayOutputStream byteArrayOutputStream; String str14; String str15; String str16; String str17; ArrayList arrayList5; ArrayList arrayList6; String str18; ArrayList arrayList7; String str19; ArrayList arrayList8; String str20; String str21; int i5; String str22; long j15; String str23; String str24; int i6; String str25; ArrayList arrayList9; int i7; String str26; int i8; String str27; String str28; long j16; ArrayList arrayList10; ArrayList arrayList11; String str29; String str30; String str31; String str32; String str33; String str34; String str35; String str36; long j17; String str37; String str38; int d; String str39; String str40; String str41; r rVar; String str42; String str43; int i9; String str44; int i10; int i11; int i12; String str45; w l6; r qVar; String str46; int i13; int i14; int i15; boolean z7; int i16; String str47; int parseInt; String str48; int i17; boolean z8; ArrayList arrayList12; long j18; AbstractC1820l c1818j; long j19; String str49; String str50; XmlPullParser xmlPullParser3 = xmlPullParser; String attributeValue = xmlPullParser3.getAttributeValue(null, "availabilityStartTime"); if (attributeValue == null) { v6 = -9223372036854775807L; } else { v6 = z2.q.v(attributeValue); } long i18 = i(xmlPullParser3, "mediaPresentationDuration", -9223372036854775807L); long i19 = i(xmlPullParser3, "minBufferTime", -9223372036854775807L); boolean equals = "dynamic".equals(xmlPullParser3.getAttributeValue(null, "type")); if (equals) { j5 = i(xmlPullParser3, "minimumUpdatePeriod", -9223372036854775807L); } else { j5 = -9223372036854775807L; } if (equals) { j6 = i(xmlPullParser3, "timeShiftBufferDepth", -9223372036854775807L); } else { j6 = -9223372036854775807L; } if (equals) { j7 = i(xmlPullParser3, "suggestedPresentationDelay", -9223372036854775807L); } else { j7 = -9223372036854775807L; } String attributeValue2 = xmlPullParser3.getAttributeValue(null, "publishTime"); if (attributeValue2 == null) { v7 = -9223372036854775807L; } else { v7 = z2.q.v(attributeValue2); } ArrayList arrayList13 = new ArrayList(); if (equals) { j8 = -9223372036854775807L; } else { j8 = 0; } String str51 = str; C1816h c1816h = null; C c7 = null; Uri uri = null; long j20 = j8; boolean z9 = false; boolean z10 = false; while (true) { xmlPullParser.next(); String str52 = YoutubeDashManifestCreatorsUtils.BASE_URL; if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.BASE_URL)) { if (!z9) { str51 = z2.b.s(str51, t(xmlPullParser3, YoutubeDashManifestCreatorsUtils.BASE_URL)); j10 = i18; j11 = v6; j13 = i19; z6 = equals; j9 = j5; z9 = true; arrayList = arrayList13; xmlPullParser2 = xmlPullParser3; obj = null; if (z2.b.m(xmlPullParser2, YoutubeDashManifestCreatorsUtils.MPD)) { if (j10 == -9223372036854775807L) { if (j20 == -9223372036854775807L) { if (!z6) { throw new IOException("Unable to determine duration of static manifest."); } } if (arrayList.isEmpty()) { return new C1810b(j11, j20, j13, z6, j9, j6, j7, v7, c1816h, c7, uri, arrayList); } throw new IOException("No periods found."); } j20 = j10; if (arrayList.isEmpty()) { } } else { xmlPullParser3 = xmlPullParser2; arrayList13 = arrayList; j5 = j9; i19 = j13; v6 = j11; i18 = j10; equals = z6; } } else { j10 = i18; str2 = str51; j11 = v6; j12 = j20; j13 = i19; z6 = equals; j9 = j5; arrayList = arrayList13; xmlPullParser2 = xmlPullParser3; obj = null; str51 = str2; j20 = j12; if (z2.b.m(xmlPullParser2, YoutubeDashManifestCreatorsUtils.MPD)) { } } } else { String str53 = "lang"; if (z2.b.o(xmlPullParser3, "ProgramInformation")) { String str54 = str51; String attributeValue3 = xmlPullParser3.getAttributeValue(null, "moreInformationURL"); if (attributeValue3 == null) { str49 = null; } else { str49 = attributeValue3; } String attributeValue4 = xmlPullParser3.getAttributeValue(null, "lang"); if (attributeValue4 == null) { str50 = null; } else { str50 = attributeValue4; } String str55 = null; String str56 = null; String str57 = null; do { xmlPullParser.next(); String str58 = str55; if (z2.b.o(xmlPullParser3, "Title")) { str55 = xmlPullParser.nextText(); } else { if (z2.b.o(xmlPullParser3, "Source")) { str56 = xmlPullParser.nextText(); } else if (z2.b.o(xmlPullParser3, "Copyright")) { str57 = xmlPullParser.nextText(); } else { b(xmlPullParser); } str55 = str58; } } while (!z2.b.m(xmlPullParser3, "ProgramInformation")); c1816h = new C1816h(str55, str56, str57, str49, str50); j10 = i18; j11 = v6; j13 = i19; z6 = equals; j9 = j5; str51 = str54; arrayList = arrayList13; xmlPullParser2 = xmlPullParser3; obj = null; if (z2.b.m(xmlPullParser2, YoutubeDashManifestCreatorsUtils.MPD)) { } } else { str2 = str51; boolean o5 = z2.b.o(xmlPullParser3, "UTCTiming"); String str59 = ES6Iterator.VALUE_PROPERTY; j9 = j5; String str60 = "schemeIdUri"; if (o5) { arrayList = arrayList13; c7 = new C(xmlPullParser3.getAttributeValue(null, "schemeIdUri"), xmlPullParser3.getAttributeValue(null, ES6Iterator.VALUE_PROPERTY), 2); } else if (z2.b.o(xmlPullParser3, HttpHeaders.LOCATION)) { arrayList = arrayList13; uri = Uri.parse(xmlPullParser.nextText()); } else { String str61 = YoutubeDashManifestCreatorsUtils.PERIOD; if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.PERIOD) && !z10) { j13 = i19; String str62 = "id"; String attributeValue5 = xmlPullParser3.getAttributeValue(null, "id"); long i20 = i(xmlPullParser3, PeertubeParsingHelper.START_KEY, j20); String str63 = "duration"; j11 = v6; long j21 = j20; long i21 = i(xmlPullParser3, "duration", -9223372036854775807L); ArrayList arrayList14 = new ArrayList(); ArrayList arrayList15 = new ArrayList(); j10 = i18; String str64 = str2; r rVar2 = null; boolean z11 = false; while (true) { xmlPullParser.next(); if (z2.b.o(xmlPullParser3, str52)) { if (!z11) { arrayList2 = arrayList13; str4 = str53; str5 = str52; str3 = z2.b.s(str64, t(xmlPullParser3, str52)); j14 = i21; arrayList3 = arrayList14; arrayList4 = arrayList15; str10 = str62; str7 = str63; z6 = equals; str9 = str60; z11 = true; xmlPullParser2 = xmlPullParser3; str8 = str59; obj = null; } else { arrayList2 = arrayList13; str4 = str53; str5 = str52; str6 = str61; str3 = str64; j14 = i21; arrayList3 = arrayList14; arrayList4 = arrayList15; str10 = str62; str7 = str63; z6 = equals; str9 = str60; xmlPullParser2 = xmlPullParser3; str8 = str59; obj = null; str61 = str6; } } else { str3 = str64; arrayList2 = arrayList13; z6 = equals; if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.ADAPTATION_SET)) { str6 = str61; int k6 = k(xmlPullParser3, str62, -1); int f7 = f(xmlPullParser); String str65 = "mimeType"; ArrayList arrayList16 = arrayList15; String attributeValue6 = xmlPullParser3.getAttributeValue(null, "mimeType"); String str66 = str63; String str67 = "codecs"; String attributeValue7 = xmlPullParser3.getAttributeValue(null, "codecs"); String str68 = "width"; String str69 = str59; String str70 = str60; int k7 = k(xmlPullParser3, "width", -1); ArrayList arrayList17 = arrayList14; String str71 = "height"; String str72 = YoutubeDashManifestCreatorsUtils.ADAPTATION_SET; int k8 = k(xmlPullParser3, "height", -1); float j22 = j(xmlPullParser3, -1.0f); String str73 = YoutubeDashManifestCreatorsUtils.SEGMENT_TEMPLATE; long j23 = i21; int k9 = k(xmlPullParser3, "audioSamplingRate", -1); String attributeValue8 = xmlPullParser3.getAttributeValue(null, str53); String str74 = "SegmentList"; String attributeValue9 = xmlPullParser3.getAttributeValue(null, "label"); ArrayList arrayList18 = new ArrayList(); String str75 = attributeValue9; ArrayList arrayList19 = new ArrayList(); ArrayList arrayList20 = new ArrayList(); String str76 = YoutubeDashManifestCreatorsUtils.SEGMENT_BASE; ArrayList arrayList21 = new ArrayList(); int i22 = k9; ArrayList arrayList22 = new ArrayList(); String str77 = "audioSamplingRate"; int i23 = k8; ArrayList arrayList23 = new ArrayList(); r rVar3 = rVar2; String str78 = str3; int i24 = f7; String str79 = attributeValue8; int i25 = -1; String str80 = null; boolean z12 = false; while (true) { xmlPullParser.next(); if (z2.b.o(xmlPullParser3, str52)) { if (!z12) { str16 = str71; str78 = z2.b.s(str78, t(xmlPullParser3, str52)); str4 = str53; str18 = str65; arrayList7 = arrayList21; str19 = str79; arrayList5 = arrayList18; str20 = str62; str21 = str67; i5 = k7; str28 = str73; str27 = str74; arrayList11 = arrayList19; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; z12 = true; arrayList6 = arrayList20; str5 = str52; str26 = str68; str29 = str72; xmlPullParser2 = xmlPullParser3; arrayList10 = arrayList22; j16 = j23; if (z2.b.m(xmlPullParser2, str29)) { ArrayList arrayList24 = new ArrayList(arrayList9.size()); int i26 = 0; while (i26 < arrayList9.size()) { C1811c c1811c = (C1811c) arrayList9.get(i26); w wVar = c1811c.f15657a; if (str75 != null) { arrayList12 = arrayList9; wVar = new w(wVar.f1076b, str75, wVar.f1077f, wVar.f1078j, wVar.f1079k, wVar.f1080l, wVar.f1081m, wVar.f1082n, wVar.f1083o, wVar.f1084p, wVar.f1085q, wVar.f1086r, wVar.f1087s, wVar.f1088t, wVar.f1089u, wVar.f1090v, wVar.f1091w, wVar.f1092x, wVar.f1094z, wVar.f1093y, wVar.f1067A, wVar.f1068B, wVar.f1069C, wVar.f1070D, wVar.f1071E, wVar.f1072F, wVar.G, wVar.f1073H, wVar.f1074I); } else { arrayList12 = arrayList9; } String str81 = c1811c.d; if (str81 == null) { str81 = str80; } ArrayList arrayList25 = c1811c.e; ArrayList arrayList26 = arrayList5; arrayList25.addAll(arrayList26); if (!arrayList25.isEmpty()) { int size = arrayList25.size() - 1; while (size >= 0) { M1.b bVar = (M1.b) arrayList25.get(size); ArrayList arrayList27 = arrayList26; if (bVar.f1973k != null) { j19 = j16; } else { j19 = j16; for (int i27 = 0; i27 < arrayList25.size(); i27++) { M1.b bVar2 = (M1.b) arrayList25.get(i27); if (bVar2.f1973k != null && bVar.f1973k == null) { UUID uuid = AbstractC0008g.f965a; UUID uuid2 = bVar2.e; if (uuid.equals(uuid2) || bVar.e.equals(uuid2)) { arrayList25.remove(size); } } } } size--; j16 = j19; arrayList26 = arrayList27; } j18 = j16; arrayList5 = arrayList26; wVar = wVar.a(new M1.c(str81, arrayList25), wVar.f1081m); } else { j18 = j16; arrayList5 = arrayList26; } ArrayList arrayList28 = c1811c.f15660f; arrayList28.addAll(arrayList11); r rVar4 = c1811c.f15659c; boolean z13 = rVar4 instanceof q; String str82 = c1811c.f15658b; if (z13) { c1818j = new C1819k(wVar, str82, (q) rVar4, arrayList28); } else if (rVar4 instanceof AbstractC1821m) { c1818j = new C1818j(wVar, str82, (AbstractC1821m) rVar4, arrayList28); } else { throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase"); } arrayList24.add(c1818j); i26++; j16 = j18; arrayList9 = arrayList12; } arrayList3 = arrayList17; arrayList3.add(new C1809a(k6, i24, arrayList24, arrayList6, arrayList10)); arrayList4 = arrayList16; str7 = str66; str8 = str69; str9 = str70; j14 = j16; str10 = str20; obj = null; } else { xmlPullParser3 = xmlPullParser2; str74 = str27; str72 = str29; str73 = str28; arrayList23 = arrayList9; arrayList20 = arrayList6; j23 = j16; arrayList22 = arrayList10; arrayList19 = arrayList11; str52 = str5; str68 = str26; str71 = str16; str53 = str4; arrayList18 = arrayList5; str62 = str20; str65 = str18; str77 = str25; str67 = str21; k7 = i5; arrayList21 = arrayList7; str76 = str24; i23 = i7; str79 = str19; i22 = i6; } } else { str4 = str53; str18 = str65; arrayList7 = arrayList21; str17 = str78; str19 = str79; arrayList5 = arrayList18; str16 = str71; str20 = str62; str21 = str67; i5 = k7; str28 = str73; str27 = str74; arrayList11 = arrayList19; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; arrayList6 = arrayList20; str5 = str52; str26 = str68; i8 = i24; xmlPullParser2 = xmlPullParser3; arrayList10 = arrayList22; j16 = j23; i24 = i8; str29 = str72; str78 = str17; if (z2.b.m(xmlPullParser2, str29)) { } } } else { str16 = str71; String str83 = "ContentProtection"; if (z2.b.o(xmlPullParser3, "ContentProtection")) { Pair e7 = e(xmlPullParser); str17 = str78; Object obj2 = e7.first; if (obj2 != null) { str80 = (String) obj2; } Object obj3 = e7.second; if (obj3 != null) { arrayList18.add(obj3); } } else { str17 = str78; if (z2.b.o(xmlPullParser3, "ContentComponent")) { String attributeValue10 = xmlPullParser3.getAttributeValue(null, str53); if (str79 == null) { str79 = attributeValue10; } else if (attributeValue10 != null) { z2.b.f(str79.equals(attributeValue10)); } int f8 = f(xmlPullParser); if (i24 == -1) { i24 = f8; } else if (f8 != -1) { if (i24 == f8) { z8 = true; } else { z8 = false; } z2.b.f(z8); } } else { if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.ROLE)) { arrayList21.add(h(xmlPullParser3, YoutubeDashManifestCreatorsUtils.ROLE)); str4 = str53; } else { String str84 = YoutubeDashManifestCreatorsUtils.AUDIO_CHANNEL_CONFIGURATION; if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.AUDIO_CHANNEL_CONFIGURATION)) { str4 = str53; str18 = str65; arrayList7 = arrayList21; i25 = d(xmlPullParser); str19 = str79; arrayList5 = arrayList18; str20 = str62; str21 = str67; i5 = k7; str28 = str73; str27 = str74; arrayList11 = arrayList19; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; str78 = str17; arrayList6 = arrayList20; str5 = str52; str26 = str68; str29 = str72; xmlPullParser2 = xmlPullParser3; arrayList10 = arrayList22; j16 = j23; if (z2.b.m(xmlPullParser2, str29)) { } } else { str4 = str53; if (z2.b.o(xmlPullParser3, "Accessibility")) { arrayList20.add(h(xmlPullParser3, "Accessibility")); } else { String str85 = "SupplementalProperty"; if (z2.b.o(xmlPullParser3, "SupplementalProperty")) { arrayList22.add(h(xmlPullParser3, "SupplementalProperty")); } else { arrayList5 = arrayList18; String str86 = YoutubeDashManifestCreatorsUtils.REPRESENTATION; int i28 = i24; if (z2.b.o(xmlPullParser3, YoutubeDashManifestCreatorsUtils.REPRESENTATION)) { str19 = str79; String attributeValue11 = xmlPullParser3.getAttributeValue(null, str62); str20 = str62; int k10 = k(xmlPullParser3, "bandwidth", -1); String attributeValue12 = xmlPullParser3.getAttributeValue(null, str65); if (attributeValue12 == null) { attributeValue12 = attributeValue6; } String attributeValue13 = xmlPullParser3.getAttributeValue(null, str67); if (attributeValue13 == null) { str30 = attributeValue7; } else { str30 = attributeValue13; } int k11 = k(xmlPullParser3, str68, k7); str18 = str65; int i29 = i23; str26 = str68; int k12 = k(xmlPullParser3, str16, i29); float j24 = j(xmlPullParser3, j22); String str87 = str77; int i30 = i22; i7 = i29; int k13 = k(xmlPullParser3, str87, i30); str25 = str87; ArrayList arrayList29 = new ArrayList(); i6 = i30; ArrayList arrayList30 = new ArrayList(); str21 = str67; ArrayList arrayList31 = new ArrayList(); i5 = k7; int i31 = i25; r rVar5 = rVar3; String str88 = str17; boolean z14 = false; String str89 = null; while (true) { xmlPullParser.next(); ArrayList arrayList32 = arrayList20; if (z2.b.o(xmlPullParser3, str52)) { if (!z14) { str88 = z2.b.s(str88, t(xmlPullParser3, str52)); str34 = str30; str31 = str76; z14 = true; str5 = str52; str32 = str74; str33 = str84; str36 = str73; rVar = rVar5; String str90 = str89; str40 = str85; str41 = str86; j17 = j23; d = i31; str38 = str83; str39 = str90; if (!z2.b.m(xmlPullParser3, str41)) { arrayList8 = arrayList22; if (z2.h.h(attributeValue12)) { str43 = z2.h.a(str34); } else if (z2.h.i(attributeValue12)) { str43 = z2.h.g(str34); } else if (c(attributeValue12)) { str22 = str36; str43 = attributeValue12; str42 = str34; j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { C1813e c1813e = (C1813e) arrayList21.get(i9); if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(c1813e.f15664a) && "main".equals(c1813e.f15665b)) { i10 = 1; } else { i9++; str32 = str23; } } else { i10 = 0; } } i11 = 0; int i32 = 0; while (i11 < arrayList21.size()) { C1813e c1813e2 = (C1813e) arrayList21.get(i11); ArrayList arrayList33 = arrayList21; if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(c1813e2.f15664a)) { i32 |= g(c1813e2.f15665b); } i11++; arrayList21 = arrayList33; } arrayList7 = arrayList21; i12 = 0; int i33 = 0; while (true) { char c8 = 3; if (i12 >= arrayList32.size()) { ArrayList arrayList34 = arrayList32; String str91 = str31; C1813e c1813e3 = (C1813e) arrayList34.get(i12); ArrayList arrayList35 = arrayList30; boolean equalsIgnoreCase = str44.equalsIgnoreCase(c1813e3.f15664a); String str92 = str44; String str93 = c1813e3.f15665b; if (equalsIgnoreCase) { i17 = g(str93); } else if ("urn:tva:metadata:cs:AudioPurposeCS:2007".equalsIgnoreCase(c1813e3.f15664a)) { if (str93 != null) { switch (str93.hashCode()) { case 49: if (str93.equals("1")) { c8 = 0; break; } break; case 50: if (str93.equals("2")) { c8 = 1; break; } break; case 51: if (str93.equals("3")) { c8 = 2; break; } break; case 54: if (str93.equals("6")) { c8 = 4; break; } break; } c8 = 65535; switch (c8) { case 0: i17 = 512; break; case 1: i17 = 2048; break; case 2: i17 = 4; break; case 3: i17 = 8; break; case 4: i17 = 1; break; } } i17 = 0; } else { i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } i33 |= i17; i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } else { ArrayList arrayList36 = arrayList30; arrayList6 = arrayList32; String str94 = str31; int i34 = i32 | i33; if (str43 != null) { String str95 = "audio/eac3"; if ("audio/eac3".equals(str43)) { for (int i35 = 0; i35 < arrayList31.size(); i35++) { C1813e c1813e4 = (C1813e) arrayList31.get(i35); String str96 = c1813e4.f15664a; boolean equals2 = "tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str96); String str97 = c1813e4.f15665b; if ((equals2 && "JOC".equals(str97)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str96) && "ec+3".equals(str97))) { str95 = "audio/eac3-joc"; } } } else { str95 = str43; } if (z2.h.i(str95)) { l6 = w.r(attributeValue11, null, attributeValue12, str95, str42, null, k10, k11, k12, j24, null, i10, i34); } else if (z2.h.h(str95)) { l6 = w.j(attributeValue11, null, attributeValue12, str95, str42, null, k10, d, k13, null, i10, i34, str19); } else if (c(str95)) { if ("application/cea-608".equals(str95)) { for (int i36 = 0; i36 < arrayList6.size(); i36++) { C1813e c1813e5 = (C1813e) arrayList6.get(i36); if ("urn:scte:dash:cc:cea-608:2015".equals(c1813e5.f15664a) && (str48 = c1813e5.f15665b) != null) { Matcher matcher = f15661f.matcher(str48); if (matcher.matches()) { parseInt = Integer.parseInt(matcher.group(1)); i16 = parseInt; l6 = w.p(attributeValue11, null, attributeValue12, str95, str42, k10, i10, i34, str19, i16); } else { Log.w("MpdParser", "Unable to parse CEA-608 channel number from: ".concat(str48)); } } } parseInt = -1; i16 = parseInt; l6 = w.p(attributeValue11, null, attributeValue12, str95, str42, k10, i10, i34, str19, i16); } else if ("application/cea-708".equals(str95)) { for (int i37 = 0; i37 < arrayList6.size(); i37++) { C1813e c1813e6 = (C1813e) arrayList6.get(i37); if ("urn:scte:dash:cc:cea-708:2015".equals(c1813e6.f15664a) && (str47 = c1813e6.f15665b) != null) { Matcher matcher2 = f15662j.matcher(str47); if (matcher2.matches()) { parseInt = Integer.parseInt(matcher2.group(1)); i16 = parseInt; l6 = w.p(attributeValue11, null, attributeValue12, str95, str42, k10, i10, i34, str19, i16); } else { Log.w("MpdParser", "Unable to parse CEA-708 service block number from: ".concat(str47)); } } } parseInt = -1; i16 = parseInt; l6 = w.p(attributeValue11, null, attributeValue12, str95, str42, k10, i10, i34, str19, i16); } else { i16 = -1; l6 = w.p(attributeValue11, null, attributeValue12, str95, str42, k10, i10, i34, str19, i16); } } else { str45 = str95; } if (rVar == null) { qVar = rVar; } else { qVar = new q(null, 1L, 0L, 0L, 0L); } C1811c c1811c2 = new C1811c(l6, str88, qVar, str39, arrayList29, arrayList36); str46 = l6.f1083o; if (!TextUtils.isEmpty(str46)) { if (z2.h.i(str46)) { i13 = 2; } else if (z2.h.h(str46)) { i14 = i28; i15 = -1; i13 = 1; if (i14 != i15) { i24 = i13; } else { if (i13 != i15) { if (i14 == i13) { z7 = true; } else { z7 = false; } z2.b.f(z7); } i24 = i14; } arrayList9 = arrayList23; arrayList9.add(c1811c2); xmlPullParser2 = xmlPullParser; str29 = str72; arrayList11 = arrayList19; str78 = str17; str24 = str94; } else if (c(str46)) { i13 = 3; } i14 = i28; i15 = -1; if (i14 != i15) { } arrayList9 = arrayList23; arrayList9.add(c1811c2); xmlPullParser2 = xmlPullParser; str29 = str72; arrayList11 = arrayList19; str78 = str17; str24 = str94; } i14 = i28; i15 = -1; i13 = -1; if (i14 != i15) { } arrayList9 = arrayList23; arrayList9.add(c1811c2); xmlPullParser2 = xmlPullParser; str29 = str72; arrayList11 = arrayList19; str78 = str17; str24 = str94; } else { str45 = str43; } l6 = w.l(attributeValue11, null, attributeValue12, str45, str42, k10, i10, i34, str19); if (rVar == null) { } C1811c c1811c22 = new C1811c(l6, str88, qVar, str39, arrayList29, arrayList36); str46 = l6.f1083o; if (!TextUtils.isEmpty(str46)) { } i14 = i28; i15 = -1; i13 = -1; if (i14 != i15) { } arrayList9 = arrayList23; arrayList9.add(c1811c22); xmlPullParser2 = xmlPullParser; str29 = str72; arrayList11 = arrayList19; str78 = str17; str24 = str94; } } } else if ("application/mp4".equals(attributeValue12)) { if (str34 != null) { str22 = str36; str42 = str34; if (str42.startsWith("stpp")) { str43 = "application/ttml+xml"; } else if (str42.startsWith("wvtt")) { str43 = "application/x-mp4-vtt"; } j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { } i9++; str32 = str23; } i11 = 0; int i322 = 0; while (i11 < arrayList21.size()) { } arrayList7 = arrayList21; i12 = 0; int i332 = 0; while (true) { char c82 = 3; if (i12 >= arrayList32.size()) { } i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } } else { str22 = str36; str42 = str34; } str43 = null; j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { } i9++; str32 = str23; } i11 = 0; int i3222 = 0; while (i11 < arrayList21.size()) { } arrayList7 = arrayList21; i12 = 0; int i3322 = 0; while (true) { char c822 = 3; if (i12 >= arrayList32.size()) { } i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } } else { str22 = str36; str42 = str34; if ("application/x-rawcc".equals(attributeValue12) && str42 != null) { if (str42.contains("cea708")) { str43 = "application/cea-708"; } else if (str42.contains("eia608") || str42.contains("cea608")) { str43 = "application/cea-608"; } j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { } i9++; str32 = str23; } i11 = 0; int i32222 = 0; while (i11 < arrayList21.size()) { } arrayList7 = arrayList21; i12 = 0; int i33222 = 0; while (true) { char c8222 = 3; if (i12 >= arrayList32.size()) { } i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } } str43 = null; j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { } i9++; str32 = str23; } i11 = 0; int i322222 = 0; while (i11 < arrayList21.size()) { } arrayList7 = arrayList21; i12 = 0; int i332222 = 0; while (true) { char c82222 = 3; if (i12 >= arrayList32.size()) { } i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } } str22 = str36; str42 = str34; j15 = j17; i9 = 0; while (true) { str23 = str32; str44 = "urn:mpeg:dash:role:2011"; if (i9 >= arrayList21.size()) { } i9++; str32 = str23; } i11 = 0; int i3222222 = 0; while (i11 < arrayList21.size()) { } arrayList7 = arrayList21; i12 = 0; int i3322222 = 0; while (true) { char c822222 = 3; if (i12 >= arrayList32.size()) { } i12++; str44 = str92; arrayList30 = arrayList35; str31 = str91; arrayList32 = arrayList34; } } else { long j25 = j17; xmlPullParser3 = xmlPullParser; rVar5 = rVar; i31 = d; str30 = str34; str73 = str36; str84 = str33; str74 = str32; str52 = str5; str76 = str31; arrayList20 = arrayList32; str86 = str41; str85 = str40; str89 = str39; str83 = str38; j23 = j25; } } else { str34 = str30; str35 = str86; j17 = j23; str31 = str76; str5 = str52; str38 = str83; str32 = str74; str33 = str84; str36 = str73; str37 = str88; str88 = str37; str39 = str89; rVar = rVar5; d = i31; str40 = str85; str41 = str35; if (!z2.b.m(xmlPullParser3, str41)) { } } } else if (z2.b.o(xmlPullParser3, str84)) { str34 = str30; long j26 = j23; d = d(xmlPullParser); str38 = str83; str31 = str76; str39 = str89; str40 = str85; str5 = str52; str41 = str86; j17 = j26; str32 = str74; str33 = str84; str36 = str73; rVar = rVar5; if (!z2.b.m(xmlPullParser3, str41)) { } } else { str31 = str76; if (z2.b.o(xmlPullParser3, str31)) { str5 = str52; rVar5 = o(xmlPullParser3, (q) rVar5); str34 = str30; str32 = str74; str33 = str84; str36 = str73; rVar = rVar5; String str902 = str89; str40 = str85; str41 = str86; j17 = j23; d = i31; str38 = str83; str39 = str902; if (!z2.b.m(xmlPullParser3, str41)) { } } else { str5 = str52; str32 = str74; if (z2.b.o(xmlPullParser3, str32)) { str33 = str84; str34 = str30; str35 = str86; j17 = j23; rVar5 = p(xmlPullParser3, (C1822n) rVar5, j17); str38 = str83; str36 = str73; str39 = str89; rVar = rVar5; d = i31; str40 = str85; str41 = str35; if (!z2.b.m(xmlPullParser3, str41)) { } } else { str33 = str84; str34 = str30; str35 = str86; str36 = str73; j17 = j23; if (z2.b.o(xmlPullParser3, str36)) { str37 = str88; rVar5 = r(xmlPullParser3, (o) rVar5, arrayList22, j17); str38 = str83; } else { str37 = str88; if (z2.b.o(xmlPullParser3, str83)) { Pair e8 = e(xmlPullParser); str38 = str83; Object obj4 = e8.first; if (obj4 != null) { str89 = (String) obj4; } Object obj5 = e8.second; if (obj5 != null) { arrayList29.add(obj5); } } else { str38 = str83; if (z2.b.o(xmlPullParser3, "InbandEventStream")) { arrayList30.add(h(xmlPullParser3, "InbandEventStream")); } else if (z2.b.o(xmlPullParser3, str85)) { arrayList31.add(h(xmlPullParser3, str85)); } else { b(xmlPullParser); } } } str88 = str37; str39 = str89; rVar = rVar5; d = i31; str40 = str85; str41 = str35; if (!z2.b.m(xmlPullParser3, str41)) { } } } } if (z2.b.m(xmlPullParser2, str29)) { } } } else { arrayList6 = arrayList20; str18 = str65; arrayList7 = arrayList21; str19 = str79; arrayList8 = arrayList22; str20 = str62; str21 = str67; i5 = k7; str22 = str73; j15 = j23; str23 = str74; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; xmlPullParser2 = xmlPullParser3; str5 = str52; str26 = str68; i8 = i28; if (z2.b.o(xmlPullParser2, str24)) { rVar3 = o(xmlPullParser2, (q) rVar3); i24 = i8; str29 = str72; arrayList11 = arrayList19; str78 = str17; } else { str27 = str23; if (z2.b.o(xmlPullParser2, str27)) { j16 = j15; rVar3 = p(xmlPullParser2, (C1822n) rVar3, j16); i24 = i8; str29 = str72; arrayList11 = arrayList19; str78 = str17; arrayList10 = arrayList8; str28 = str22; if (z2.b.m(xmlPullParser2, str29)) { } } else { str28 = str22; j16 = j15; if (z2.b.o(xmlPullParser2, str28)) { arrayList10 = arrayList8; rVar3 = r(xmlPullParser2, (o) rVar3, arrayList10, j16); i24 = i8; str29 = str72; arrayList11 = arrayList19; str78 = str17; if (z2.b.m(xmlPullParser2, str29)) { } } else { arrayList10 = arrayList8; if (z2.b.o(xmlPullParser2, "InbandEventStream")) { arrayList11 = arrayList19; arrayList11.add(h(xmlPullParser2, "InbandEventStream")); } else { arrayList11 = arrayList19; if (z2.b.o(xmlPullParser2, "Label")) { i24 = i8; str75 = t(xmlPullParser2, "Label"); str29 = str72; str78 = str17; if (z2.b.m(xmlPullParser2, str29)) { } } else if (z2.b.n(xmlPullParser)) { b(xmlPullParser); } } i24 = i8; str29 = str72; str78 = str17; if (z2.b.m(xmlPullParser2, str29)) { } } } } } arrayList10 = arrayList8; str28 = str22; j16 = j15; str27 = str23; if (z2.b.m(xmlPullParser2, str29)) { } } } } } str18 = str65; arrayList7 = arrayList21; str19 = str79; arrayList5 = arrayList18; str20 = str62; str21 = str67; i5 = k7; str28 = str73; str27 = str74; arrayList11 = arrayList19; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; arrayList6 = arrayList20; str5 = str52; str26 = str68; i8 = i24; xmlPullParser2 = xmlPullParser3; arrayList10 = arrayList22; j16 = j23; i24 = i8; str29 = str72; str78 = str17; if (z2.b.m(xmlPullParser2, str29)) { } } } str4 = str53; str18 = str65; arrayList7 = arrayList21; str19 = str79; arrayList5 = arrayList18; str20 = str62; str21 = str67; i5 = k7; str28 = str73; str27 = str74; arrayList11 = arrayList19; str24 = str76; i6 = i22; str25 = str77; arrayList9 = arrayList23; i7 = i23; str78 = str17; arrayList6 = arrayList20; str5 = str52; str26 = str68; str29 = str72; xmlPullParser2 = xmlPullParser3; arrayList10 = arrayList22; j16 = j23; if (z2.b.m(xmlPullParser2, str29)) { } } } } else { str4 = str53; str5 = str52; str6 = str61; String str98 = str59; long j27 = i21; ArrayList arrayList37 = arrayList15; String str99 = str62; String str100 = str63; String str101 = str60; arrayList3 = arrayList14; xmlPullParser2 = xmlPullParser3; if (z2.b.o(xmlPullParser2, "EventStream")) { String str102 = str101; String attributeValue14 = xmlPullParser2.getAttributeValue(null, str102); if (attributeValue14 == null) { str11 = ""; } else { str11 = attributeValue14; } String str103 = str98; String attributeValue15 = xmlPullParser2.getAttributeValue(null, str103); if (attributeValue15 == null) { str12 = ""; } else { str12 = attributeValue15; } long l7 = l(xmlPullParser2, "timescale", 1L); ArrayList arrayList38 = new ArrayList(); ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(512); while (true) { xmlPullParser.next(); if (z2.b.o(xmlPullParser2, "Event")) { String str104 = str99; long l8 = l(xmlPullParser2, str104, 0L); String str105 = str100; long l9 = l(xmlPullParser2, str105, -9223372036854775807L); long l10 = l(xmlPullParser2, "presentationTime", 0L); str10 = str104; str7 = str105; long y6 = z2.q.y(l9, 1000L, l7); long y7 = z2.q.y(l10, 1000000L, l7); String attributeValue16 = xmlPullParser2.getAttributeValue(null, "messageData"); if (attributeValue16 == null) { attributeValue16 = null; } byteArrayOutputStream2.reset(); XmlSerializer newSerializer = Xml.newSerializer(); newSerializer.setOutput(byteArrayOutputStream2, HTTP.UTF_8); xmlPullParser.nextToken(); while (!z2.b.m(xmlPullParser2, "Event")) { switch (xmlPullParser.getEventType()) { case 0: str14 = str103; str15 = str102; newSerializer.startDocument(null, Boolean.FALSE); break; case 1: str14 = str103; str15 = str102; newSerializer.endDocument(); break; case 2: newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName()); int i38 = 0; while (i38 < xmlPullParser.getAttributeCount()) { newSerializer.attribute(xmlPullParser2.getAttributeNamespace(i38), xmlPullParser2.getAttributeName(i38), xmlPullParser2.getAttributeValue(i38)); i38++; str103 = str103; str102 = str102; } break; case 3: newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName()); break; case 4: newSerializer.text(xmlPullParser.getText()); break; case 5: newSerializer.cdsect(xmlPullParser.getText()); break; case 6: newSerializer.entityRef(xmlPullParser.getText()); break; case 7: newSerializer.ignorableWhitespace(xmlPullParser.getText()); break; case 8: newSerializer.processingInstruction(xmlPullParser.getText()); break; case 9: newSerializer.comment(xmlPullParser.getText()); break; case 10: newSerializer.docdecl(xmlPullParser.getText()); break; } str14 = str103; str15 = str102; xmlPullParser.nextToken(); str103 = str14; str102 = str15; } str13 = str103; str9 = str102; newSerializer.flush(); byte[] byteArray = byteArrayOutputStream2.toByteArray(); Long valueOf = Long.valueOf(y7); if (attributeValue16 != null) { byteArray = z2.q.p(attributeValue16); } byteArrayOutputStream = byteArrayOutputStream2; arrayList38.add(Pair.create(valueOf, new Z1.a(str11, str12, y6, l8, byteArray))); } else { str13 = str103; str9 = str102; byteArrayOutputStream = byteArrayOutputStream2; str7 = str100; str10 = str99; b(xmlPullParser); } if (z2.b.m(xmlPullParser2, "EventStream")) { long[] jArr = new long[arrayList38.size()]; Z1.a[] aVarArr = new Z1.a[arrayList38.size()]; for (int i39 = 0; i39 < arrayList38.size(); i39++) { Pair pair = (Pair) arrayList38.get(i39); jArr[i39] = ((Long) pair.first).longValue(); aVarArr[i39] = (Z1.a) pair.second; } arrayList4 = arrayList37; arrayList4.add(new C1814f(str11, str12, jArr, aVarArr)); str8 = str13; j14 = j27; obj = null; } else { str99 = str10; str100 = str7; str103 = str13; str102 = str9; byteArrayOutputStream2 = byteArrayOutputStream; } } } else { arrayList4 = arrayList37; str7 = str100; str8 = str98; str9 = str101; str10 = str99; if (z2.b.o(xmlPullParser2, YoutubeDashManifestCreatorsUtils.SEGMENT_BASE)) { obj = null; rVar2 = o(xmlPullParser2, null); str61 = str6; j14 = j27; } else { obj = null; if (z2.b.o(xmlPullParser2, "SegmentList")) { j14 = j27; r5 = p(xmlPullParser2, null, j14); } else { j14 = j27; if (z2.b.o(xmlPullParser2, YoutubeDashManifestCreatorsUtils.SEGMENT_TEMPLATE)) { r5 = r(xmlPullParser2, null, Collections.emptyList(), j14); } else { b(xmlPullParser); } } rVar2 = r5; } } } str61 = str6; } if (z2.b.m(xmlPullParser2, str61)) { Pair create = Pair.create(new C1815g(attributeValue5, i20, arrayList3, arrayList4), Long.valueOf(j14)); C1815g c1815g = (C1815g) create.first; if (c1815g.f15671b == -9223372036854775807L) { if (z6) { j20 = j21; arrayList = arrayList2; z10 = true; } else { throw new IOException("Unable to determine start of period " + arrayList2.size()); } } else { long longValue = ((Long) create.second).longValue(); if (longValue == -9223372036854775807L) { arrayList = arrayList2; j20 = -9223372036854775807L; } else { j20 = c1815g.f15671b + longValue; arrayList = arrayList2; } arrayList.add(c1815g); } str51 = str2; } else { xmlPullParser3 = xmlPullParser2; arrayList14 = arrayList3; arrayList15 = arrayList4; str59 = str8; str64 = str3; str62 = str10; arrayList13 = arrayList2; equals = z6; str63 = str7; str60 = str9; i21 = j14; str52 = str5; str53 = str4; } } } else { arrayList = arrayList13; j10 = i18; j11 = v6; j12 = j20; j13 = i19; z6 = equals; xmlPullParser2 = xmlPullParser3; obj = null; b(xmlPullParser); str51 = str2; j20 = j12; if (z2.b.m(xmlPullParser2, YoutubeDashManifestCreatorsUtils.MPD)) { } } } j10 = i18; j11 = v6; j13 = i19; z6 = equals; str51 = str2; xmlPullParser2 = xmlPullParser3; obj = null; if (z2.b.m(xmlPullParser2, YoutubeDashManifestCreatorsUtils.MPD)) { } } } } } public static C1817i n(XmlPullParser xmlPullParser, String str, String str2) { long j5; long j6; String attributeValue = xmlPullParser.getAttributeValue(null, str); String attributeValue2 = xmlPullParser.getAttributeValue(null, str2); if (attributeValue2 != null) { String[] split = attributeValue2.split("-"); j5 = Long.parseLong(split[0]); if (split.length == 2) { j6 = (Long.parseLong(split[1]) - j5) + 1; return new C1817i(j5, j6, attributeValue); } } else { j5 = 0; } j6 = -1; return new C1817i(j5, j6, attributeValue); } public static q o(XmlPullParser xmlPullParser, q qVar) { long j5; long j6; long j7; long j8; long j9; if (qVar != null) { j5 = qVar.f15695b; } else { j5 = 1; } long l6 = l(xmlPullParser, "timescale", j5); long j10 = 0; if (qVar != null) { j6 = qVar.f15696c; } else { j6 = 0; } long l7 = l(xmlPullParser, "presentationTimeOffset", j6); if (qVar != null) { j7 = qVar.d; } else { j7 = 0; } if (qVar != null) { j10 = qVar.e; } C1817i c1817i = null; String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange"); if (attributeValue != null) { String[] split = attributeValue.split("-"); long parseLong = Long.parseLong(split[0]); j8 = (Long.parseLong(split[1]) - parseLong) + 1; j9 = parseLong; } else { j8 = j10; j9 = j7; } if (qVar != null) { c1817i = qVar.f15694a; } do { xmlPullParser.next(); if (z2.b.o(xmlPullParser, YoutubeDashManifestCreatorsUtils.INITIALIZATION)) { c1817i = n(xmlPullParser, "sourceURL", "range"); } else { b(xmlPullParser); } } while (!z2.b.m(xmlPullParser, YoutubeDashManifestCreatorsUtils.SEGMENT_BASE)); return new q(c1817i, l6, l7, j9, j8); } public static C1822n p(XmlPullParser xmlPullParser, C1822n c1822n, long j5) { long j6; long j7; long j8; long j9 = 1; if (c1822n != null) { j6 = c1822n.f15695b; } else { j6 = 1; } long l6 = l(xmlPullParser, "timescale", j6); if (c1822n != null) { j7 = c1822n.f15696c; } else { j7 = 0; } long l7 = l(xmlPullParser, "presentationTimeOffset", j7); if (c1822n != null) { j8 = c1822n.e; } else { j8 = -9223372036854775807L; } long l8 = l(xmlPullParser, "duration", j8); if (c1822n != null) { j9 = c1822n.d; } long l9 = l(xmlPullParser, "startNumber", j9); List list = null; C1817i c1817i = null; List list2 = null; do { xmlPullParser.next(); if (z2.b.o(xmlPullParser, YoutubeDashManifestCreatorsUtils.INITIALIZATION)) { c1817i = n(xmlPullParser, "sourceURL", "range"); } else if (z2.b.o(xmlPullParser, YoutubeDashManifestCreatorsUtils.SEGMENT_TIMELINE)) { list2 = s(xmlPullParser, l6, j5); } else if (z2.b.o(xmlPullParser, "SegmentURL")) { if (list == null) { list = new ArrayList(); } list.add(n(xmlPullParser, "media", "mediaRange")); } else { b(xmlPullParser); } } while (!z2.b.m(xmlPullParser, "SegmentList")); if (c1822n != null) { if (c1817i == null) { c1817i = c1822n.f15694a; } if (list2 == null) { list2 = c1822n.f15687f; } if (list == null) { list = c1822n.f15688g; } } return new C1822n(c1817i, l6, l7, l9, l8, list2, list); } public static o r(XmlPullParser xmlPullParser, o oVar, List list, long j5) { long j6; long j7; long j8; long j9; C1691zb c1691zb; C1691zb c1691zb2; long j10 = 1; if (oVar != null) { j6 = oVar.f15695b; } else { j6 = 1; } long l6 = l(xmlPullParser, "timescale", j6); if (oVar != null) { j7 = oVar.f15696c; } else { j7 = 0; } long l7 = l(xmlPullParser, "presentationTimeOffset", j7); if (oVar != null) { j8 = oVar.e; } else { j8 = -9223372036854775807L; } long l8 = l(xmlPullParser, "duration", j8); if (oVar != null) { j10 = oVar.d; } long l9 = l(xmlPullParser, "startNumber", j10); int i5 = 0; while (true) { if (i5 < list.size()) { C1813e c1813e = (C1813e) list.get(i5); if ("http://dashif.org/guidelines/last-segment-number".equalsIgnoreCase(c1813e.f15664a)) { j9 = Long.parseLong(c1813e.f15665b); break; } i5++; } else { j9 = -1; break; } } long j11 = j9; C1817i c1817i = null; if (oVar != null) { c1691zb = oVar.f15690h; } else { c1691zb = null; } C1691zb u3 = u(xmlPullParser, "media", c1691zb); if (oVar != null) { c1691zb2 = oVar.f15689g; } else { c1691zb2 = null; } C1691zb u6 = u(xmlPullParser, "initialization", c1691zb2); List list2 = null; do { xmlPullParser.next(); if (z2.b.o(xmlPullParser, YoutubeDashManifestCreatorsUtils.INITIALIZATION)) { c1817i = n(xmlPullParser, "sourceURL", "range"); } else if (z2.b.o(xmlPullParser, YoutubeDashManifestCreatorsUtils.SEGMENT_TIMELINE)) { list2 = s(xmlPullParser, l6, j5); } else { b(xmlPullParser); } } while (!z2.b.m(xmlPullParser, YoutubeDashManifestCreatorsUtils.SEGMENT_TEMPLATE)); if (oVar != null) { if (c1817i == null) { c1817i = oVar.f15694a; } if (list2 == null) { list2 = oVar.f15687f; } } return new o(c1817i, l6, l7, l9, j11, l8, list2, u6, u3); } public static ArrayList s(XmlPullParser xmlPullParser, long j5, long j6) { ArrayList arrayList = new ArrayList(); long j7 = 0; long j8 = -9223372036854775807L; boolean z6 = false; int i5 = 0; do { xmlPullParser.next(); if (z2.b.o(xmlPullParser, "S")) { long l6 = l(xmlPullParser, "t", -9223372036854775807L); if (z6) { j7 = a(arrayList, j7, j8, i5, l6); } if (l6 == -9223372036854775807L) { l6 = j7; } long l7 = l(xmlPullParser, "d", -9223372036854775807L); i5 = k(xmlPullParser, "r", 0); z6 = true; j8 = l7; j7 = l6; } else { b(xmlPullParser); } } while (!z2.b.m(xmlPullParser, YoutubeDashManifestCreatorsUtils.SEGMENT_TIMELINE)); if (z6) { a(arrayList, j7, j8, i5, z2.q.y(j6, j5, 1000L)); } return arrayList; } public static String t(XmlPullParser xmlPullParser, String str) { String str2 = ""; do { xmlPullParser.next(); if (xmlPullParser.getEventType() == 4) { str2 = xmlPullParser.getText(); } else { b(xmlPullParser); } } while (!z2.b.m(xmlPullParser, str)); return str2; } public static C1691zb u(XmlPullParser xmlPullParser, String str, C1691zb c1691zb) { 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 i5 = 0; int i6 = 0; while (i5 < attributeValue.length()) { int indexOf = attributeValue.indexOf("$", i5); if (indexOf == -1) { strArr[i6] = strArr[i6] + attributeValue.substring(i5); i5 = attributeValue.length(); } else if (indexOf != i5) { strArr[i6] = strArr[i6] + attributeValue.substring(i5, indexOf); i5 = indexOf; } else if (attributeValue.startsWith("$$", i5)) { strArr[i6] = p4.r.j(strArr[i6], "$", new StringBuilder()); i5 += 2; } else { int i7 = i5 + 1; int indexOf2 = attributeValue.indexOf("$", i7); String substring = attributeValue.substring(i7, indexOf2); if (substring.equals("RepresentationID")) { iArr[i6] = 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.getClass(); char c7 = 65535; switch (substring.hashCode()) { case -1950496919: if (substring.equals("Number")) { c7 = 0; break; } break; case 2606829: if (substring.equals("Time")) { c7 = 1; break; } break; case 38199441: if (substring.equals("Bandwidth")) { c7 = 2; break; } break; } } i6++; strArr[i6] = ""; i5 = indexOf2 + 1; } } return new C1691zb(strArr, iArr, strArr2, i6); } return c1691zb; } @Override public final Object q(Uri uri, x2.j jVar) { try { XmlPullParser newPullParser = this.f15663b.newPullParser(); newPullParser.setInput(jVar, null); if (newPullParser.next() == 2 && YoutubeDashManifestCreatorsUtils.MPD.equals(newPullParser.getName())) { return m(newPullParser, uri.toString()); } throw new IOException("inputStream does not contain a valid media presentation description"); } catch (XmlPullParserException e7) { throw new IOException(e7); } } }