package d6; import android.util.Pair; import android.util.SparseArray; import com.google.common.collect.q; import com.tencent.thumbplayer.api.TPOptionalID; import com.tencent.thumbplayer.core.common.TPDecoderType; import com.tencent.thumbplayer.core.player.TPNativePlayerInitConfig; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.UUID; import q7.b0; import q7.n0; import q7.r; import q7.s; import q7.v; import q7.w; import r7.d; import r7.f; import s5.h2; import s5.i; import s5.m1; import u5.a; import w5.m; import x5.b0; import x5.c0; import x5.k; import x5.l; import x5.m; import x5.p; import x5.y; import x5.z; public class e implements k { /* renamed from: c0 */ public static final p f13243c0 = d.f13242b; /* renamed from: d0 */ private static final byte[] f13244d0 = {49, 10, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 48, 48, 10}; /* renamed from: e0 */ private static final byte[] f13245e0 = n0.l0("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text"); /* renamed from: f0 */ private static final byte[] f13246f0 = {68, 105, 97, 108, 111, 103, 117, 101, 58, 32, 48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44, 48, 58, 48, 48, 58, 48, 48, 58, 48, 48, 44}; /* renamed from: g0 */ private static final byte[] f13247g0 = {87, 69, 66, 86, 84, 84, 10, 10, 48, 48, 58, 48, 48, 58, 48, 48, 46, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48, 48, 58, 48, 48, 46, 48, 48, 48, 10}; /* renamed from: h0 */ private static final UUID f13248h0 = new UUID(72057594037932032L, -9223371306706625679L); /* renamed from: i0 */ private static final Map<String, Integer> f13249i0; private long A; private long B; private s C; private s D; private boolean E; private boolean F; private int G; private long H; private long I; private int J; private int K; private int[] L; private int M; private int N; private int O; private int P; private boolean Q; private long R; private int S; private int T; private int U; private boolean V; private boolean W; private boolean X; private int Y; private byte Z; /* renamed from: a */ private final c f13250a; /* renamed from: a0 */ private boolean f13251a0; /* renamed from: b */ private final g f13252b; /* renamed from: b0 */ private m f13253b0; /* renamed from: c */ private final SparseArray<c> f13254c; /* renamed from: d */ private final boolean f13255d; /* renamed from: e */ private final b0 f13256e; /* renamed from: f */ private final b0 f13257f; /* renamed from: g */ private final b0 f13258g; /* renamed from: h */ private final b0 f13259h; /* renamed from: i */ private final b0 f13260i; /* renamed from: j */ private final b0 f13261j; /* renamed from: k */ private final b0 f13262k; /* renamed from: l */ private final b0 f13263l; /* renamed from: m */ private final b0 f13264m; /* renamed from: n */ private final b0 f13265n; /* renamed from: o */ private ByteBuffer f13266o; /* renamed from: p */ private long f13267p; /* renamed from: q */ private long f13268q; /* renamed from: r */ private long f13269r; /* renamed from: s */ private long f13270s; /* renamed from: t */ private long f13271t; /* renamed from: u */ private c f13272u; /* renamed from: v */ private boolean f13273v; /* renamed from: w */ private int f13274w; /* renamed from: x */ private long f13275x; /* renamed from: y */ private boolean f13276y; /* renamed from: z */ private long f13277z; /* access modifiers changed from: private */ public final class b implements b { private b() { e.this = r1; } @Override // d6.b public void a(int i10) { e.this.o(i10); } @Override // d6.b public int b(int i10) { return e.this.u(i10); } @Override // d6.b public boolean c(int i10) { return e.this.z(i10); } @Override // d6.b public void d(int i10, String str) { e.this.H(i10, str); } @Override // d6.b public void e(int i10, int i11, l lVar) { e.this.l(i10, i11, lVar); } @Override // d6.b public void f(int i10, double d10) { e.this.r(i10, d10); } @Override // d6.b public void g(int i10, long j10, long j11) { e.this.G(i10, j10, j11); } @Override // d6.b public void h(int i10, long j10) { e.this.x(i10, j10); } } public static final class c { public int A = -1; public int B = 1000; public int C = 200; public float D = -1.0f; public float E = -1.0f; public float F = -1.0f; public float G = -1.0f; public float H = -1.0f; public float I = -1.0f; public float J = -1.0f; public float K = -1.0f; public float L = -1.0f; public float M = -1.0f; public byte[] N; public int O = 1; public int P = -1; public int Q = 8000; public long R = 0; public long S = 0; public c0 T; public boolean U; public boolean V = true; private String W = "eng"; public x5.b0 X; public int Y; /* renamed from: a */ public String f13279a; /* renamed from: b */ public String f13280b; /* renamed from: c */ public int f13281c; /* renamed from: d */ public int f13282d; /* renamed from: e */ public int f13283e; /* renamed from: f */ public int f13284f; /* renamed from: g */ private int f13285g; /* renamed from: h */ public boolean f13286h; /* renamed from: i */ public byte[] f13287i; /* renamed from: j */ public b0.a f13288j; /* renamed from: k */ public byte[] f13289k; /* renamed from: l */ public w5.m f13290l; /* renamed from: m */ public int f13291m = -1; /* renamed from: n */ public int f13292n = -1; /* renamed from: o */ public int f13293o = -1; /* renamed from: p */ public int f13294p = -1; /* renamed from: q */ public int f13295q = 0; /* renamed from: r */ public int f13296r = -1; /* renamed from: s */ public float f13297s = 0.0f; /* renamed from: t */ public float f13298t = 0.0f; /* renamed from: u */ public float f13299u = 0.0f; /* renamed from: v */ public byte[] f13300v = null; /* renamed from: w */ public int f13301w = -1; /* renamed from: x */ public boolean f13302x = false; /* renamed from: y */ public int f13303y = -1; /* renamed from: z */ public int f13304z = -1; protected c() { } private void f() { q7.a.e(this.X); } private byte[] g(String str) { byte[] bArr = this.f13289k; if (bArr != null) { return bArr; } throw h2.a("Missing CodecPrivate for codec " + str, null); } private byte[] h() { if (this.D == -1.0f || this.E == -1.0f || this.F == -1.0f || this.G == -1.0f || this.H == -1.0f || this.I == -1.0f || this.J == -1.0f || this.K == -1.0f || this.L == -1.0f || this.M == -1.0f) { return null; } byte[] bArr = new byte[25]; ByteBuffer order = ByteBuffer.wrap(bArr).order(ByteOrder.LITTLE_ENDIAN); order.put((byte) 0); order.putShort((short) ((int) ((this.D * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.E * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.F * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.G * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.H * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.I * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.J * 50000.0f) + 0.5f))); order.putShort((short) ((int) ((this.K * 50000.0f) + 0.5f))); order.putShort((short) ((int) (this.L + 0.5f))); order.putShort((short) ((int) (this.M + 0.5f))); order.putShort((short) this.B); order.putShort((short) this.C); return bArr; } private static Pair<String, List<byte[]>> k(q7.b0 b0Var) { try { b0Var.P(16); long s10 = b0Var.s(); if (s10 == 1482049860) { return new Pair<>("video/divx", null); } if (s10 == 859189832) { return new Pair<>("video/3gpp", null); } if (s10 == 826496599) { byte[] d10 = b0Var.d(); for (int e10 = b0Var.e() + 20; e10 < d10.length - 4; e10++) { if (d10[e10] == 0 && d10[e10 + 1] == 0 && d10[e10 + 2] == 1 && d10[e10 + 3] == 15) { return new Pair<>("video/wvc1", Collections.singletonList(Arrays.copyOfRange(d10, e10, d10.length))); } } throw h2.a("Failed to find FourCC VC1 initialization data", null); } r.i("MatroskaExtractor", "Unknown FourCC. Setting mimeType to video/x-unknown"); return new Pair<>("video/x-unknown", null); } catch (ArrayIndexOutOfBoundsException unused) { throw h2.a("Error parsing FourCC private data", null); } } private static boolean l(q7.b0 b0Var) { try { int u10 = b0Var.u(); if (u10 == 1) { return true; } if (u10 != 65534) { return false; } b0Var.O(24); return b0Var.v() == e.f13248h0.getMostSignificantBits() && b0Var.v() == e.f13248h0.getLeastSignificantBits(); } catch (ArrayIndexOutOfBoundsException unused) { throw h2.a("Error parsing MS/ACM codec private", null); } } private static List<byte[]> m(byte[] bArr) { try { if (bArr[0] == 2) { int i10 = 0; int i11 = 1; while ((bArr[i11] & 255) == 255) { i10 += 255; i11++; } int i12 = i11 + 1; int i13 = i10 + (bArr[i11] & 255); int i14 = 0; while ((bArr[i12] & 255) == 255) { i14 += 255; i12++; } int i15 = i12 + 1; int i16 = i14 + (bArr[i12] & 255); if (bArr[i15] == 1) { byte[] bArr2 = new byte[i13]; System.arraycopy(bArr, i15, bArr2, 0, i13); int i17 = i15 + i13; if (bArr[i17] == 3) { int i18 = i17 + i16; if (bArr[i18] == 5) { byte[] bArr3 = new byte[(bArr.length - i18)]; System.arraycopy(bArr, i18, bArr3, 0, bArr.length - i18); ArrayList arrayList = new ArrayList(2); arrayList.add(bArr2); arrayList.add(bArr3); return arrayList; } throw h2.a("Error parsing vorbis codec private", null); } throw h2.a("Error parsing vorbis codec private", null); } throw h2.a("Error parsing vorbis codec private", null); } throw h2.a("Error parsing vorbis codec private", null); } catch (ArrayIndexOutOfBoundsException unused) { throw h2.a("Error parsing vorbis codec private", null); } } private boolean o(boolean z10) { return "A_OPUS".equals(this.f13280b) ? z10 : this.f13284f > 0; } /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */ /* JADX WARNING: Removed duplicated region for block: B:173:0x03e4 */ /* JADX WARNING: Removed duplicated region for block: B:174:0x03e6 */ /* JADX WARNING: Removed duplicated region for block: B:177:0x03f3 */ /* JADX WARNING: Removed duplicated region for block: B:178:0x0405 */ public void i(m mVar, int i10) { char c10; int i11; int i12; String str; List<byte[]> list; m1.b bVar; int i13; int i14; int i15; d a10; StringBuilder sb2; int b02; String str2; List<byte[]> list2; String str3; String str4 = this.f13280b; str4.hashCode(); switch (str4.hashCode()) { case -2095576542: if (str4.equals("V_MPEG4/ISO/AP")) { c10 = 0; break; } c10 = 65535; break; case -2095575984: if (str4.equals("V_MPEG4/ISO/SP")) { c10 = 1; break; } c10 = 65535; break; case -1985379776: if (str4.equals("A_MS/ACM")) { c10 = 2; break; } c10 = 65535; break; case -1784763192: if (str4.equals("A_TRUEHD")) { c10 = 3; break; } c10 = 65535; break; case -1730367663: if (str4.equals("A_VORBIS")) { c10 = 4; break; } c10 = 65535; break; case -1482641358: if (str4.equals("A_MPEG/L2")) { c10 = 5; break; } c10 = 65535; break; case -1482641357: if (str4.equals("A_MPEG/L3")) { c10 = 6; break; } c10 = 65535; break; case -1373388978: if (str4.equals("V_MS/VFW/FOURCC")) { c10 = 7; break; } c10 = 65535; break; case -933872740: if (str4.equals("S_DVBSUB")) { c10 = '\b'; break; } c10 = 65535; break; case -538363189: if (str4.equals("V_MPEG4/ISO/ASP")) { c10 = '\t'; break; } c10 = 65535; break; case -538363109: if (str4.equals("V_MPEG4/ISO/AVC")) { c10 = '\n'; break; } c10 = 65535; break; case -425012669: if (str4.equals("S_VOBSUB")) { c10 = 11; break; } c10 = 65535; break; case -356037306: if (str4.equals("A_DTS/LOSSLESS")) { c10 = '\f'; break; } c10 = 65535; break; case 62923557: if (str4.equals("A_AAC")) { c10 = '\r'; break; } c10 = 65535; break; case 62923603: if (str4.equals("A_AC3")) { c10 = 14; break; } c10 = 65535; break; case 62927045: if (str4.equals("A_DTS")) { c10 = 15; break; } c10 = 65535; break; case 82318131: if (str4.equals("V_AV1")) { c10 = 16; break; } c10 = 65535; break; case 82338133: if (str4.equals("V_VP8")) { c10 = 17; break; } c10 = 65535; break; case 82338134: if (str4.equals("V_VP9")) { c10 = 18; break; } c10 = 65535; break; case 99146302: if (str4.equals("S_HDMV/PGS")) { c10 = 19; break; } c10 = 65535; break; case 444813526: if (str4.equals("V_THEORA")) { c10 = 20; break; } c10 = 65535; break; case 542569478: if (str4.equals("A_DTS/EXPRESS")) { c10 = 21; break; } c10 = 65535; break; case 635596514: if (str4.equals("A_PCM/FLOAT/IEEE")) { c10 = 22; break; } c10 = 65535; break; case 725948237: if (str4.equals("A_PCM/INT/BIG")) { c10 = 23; break; } c10 = 65535; break; case 725957860: if (str4.equals("A_PCM/INT/LIT")) { c10 = 24; break; } c10 = 65535; break; case 738597099: if (str4.equals("S_TEXT/ASS")) { c10 = 25; break; } c10 = 65535; break; case 855502857: if (str4.equals("V_MPEGH/ISO/HEVC")) { c10 = 26; break; } c10 = 65535; break; case 1045209816: if (str4.equals("S_TEXT/WEBVTT")) { c10 = 27; break; } c10 = 65535; break; case 1422270023: if (str4.equals("S_TEXT/UTF8")) { c10 = 28; break; } c10 = 65535; break; case 1809237540: if (str4.equals("V_MPEG2")) { c10 = 29; break; } c10 = 65535; break; case 1950749482: if (str4.equals("A_EAC3")) { c10 = 30; break; } c10 = 65535; break; case 1950789798: if (str4.equals("A_FLAC")) { c10 = 31; break; } c10 = 65535; break; case 1951062397: if (str4.equals("A_OPUS")) { c10 = ' '; break; } c10 = 65535; break; default: c10 = 65535; break; } int i16 = 4096; String str5 = "audio/raw"; r7.c cVar = null; switch (c10) { case 0: case 1: case '\t': byte[] bArr = this.f13289k; list = bArr == null ? null : Collections.singletonList(bArr); str5 = "video/mp4v-es"; str = null; i12 = -1; i11 = -1; byte[] bArr2 = this.N; if (!(bArr2 == null || (a10 = d.a(new q7.b0(bArr2))) == null)) { str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; } int i17 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { bVar.H(this.O).f0(this.Q).Y(i12); i13 = 1; } else if (v.s(str5)) { if (this.f13295q == 0) { int i18 = this.f13293o; i14 = -1; if (i18 == -1) { i18 = this.f13291m; } this.f13293o = i18; int i19 = this.f13294p; if (i19 == -1) { i19 = this.f13292n; } this.f13294p = i19; } else { i14 = -1; } float f10 = -1.0f; int i20 = this.f13293o; if (!(i20 == i14 || (i15 = this.f13294p) == i14)) { f10 = ((float) (this.f13292n * i20)) / ((float) (this.f13291m * i15)); } if (this.f13302x) { cVar = new r7.c(this.f13303y, this.A, this.f13304z, h()); } if (this.f13279a != null && e.f13249i0.containsKey(this.f13279a)) { i14 = ((Integer) e.f13249i0.get(this.f13279a)).intValue(); } if (this.f13296r == 0 && Float.compare(this.f13297s, 0.0f) == 0 && Float.compare(this.f13298t, 0.0f) == 0) { if (Float.compare(this.f13299u, 0.0f) == 0) { i14 = 0; } else if (Float.compare(this.f13298t, 90.0f) == 0) { i14 = 90; } else if (Float.compare(this.f13298t, -180.0f) == 0 || Float.compare(this.f13298t, 180.0f) == 0) { i14 = 180; } else if (Float.compare(this.f13298t, -90.0f) == 0) { i14 = 270; } } bVar.j0(this.f13291m).Q(this.f13292n).a0(f10).d0(i14).b0(this.f13300v).h0(this.f13301w).J(cVar); i13 = 2; } else if ("application/x-subrip".equals(str5) || "text/x-ssa".equals(str5) || "text/vtt".equals(str5) || "application/vobsub".equals(str5) || "application/pgs".equals(str5) || "application/dvbsubs".equals(str5)) { i13 = 3; } else { throw h2.a("Unexpected MIME type.", null); } if (this.f13279a != null && !e.f13249i0.containsKey(this.f13279a)) { bVar.U(this.f13279a); } m1 E2 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17).T(list).I(str).M(this.f13290l).E(); x5.b0 e10 = mVar.e(this.f13281c, i13); this.X = e10; e10.b(E2); return; case 2: if (l(new q7.b0(g(this.f13280b)))) { b02 = n0.b0(this.P); if (b02 == 0) { sb2 = new StringBuilder(); str2 = "Unsupported PCM bit depth: "; sb2.append(str2); sb2.append(this.P); sb2.append(". Setting mimeType to "); sb2.append("audio/x-unknown"); r.i("MatroskaExtractor", sb2.toString()); list = null; str = null; str5 = "audio/x-unknown"; i12 = -1; i11 = -1; byte[] bArr22 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172).T(list).I(str).M(this.f13290l).E(); x5.b0 e102 = mVar.e(this.f13281c, i13); this.X = e102; e102.b(E22); return; } i12 = b02; list = null; str = null; i11 = -1; byte[] bArr222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022 = mVar.e(this.f13281c, i13); this.X = e1022; e1022.b(E222); return; } sb2 = new StringBuilder(); sb2.append("Non-PCM MS/ACM is unsupported. Setting mimeType to "); sb2.append("audio/x-unknown"); r.i("MatroskaExtractor", sb2.toString()); list = null; str = null; str5 = "audio/x-unknown"; i12 = -1; i11 = -1; byte[] bArr2222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222 = mVar.e(this.f13281c, i13); this.X = e10222; e10222.b(E2222); return; case 3: this.T = new c0(); str5 = "audio/true-hd"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr22222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222 = mVar.e(this.f13281c, i13); this.X = e102222; e102222.b(E22222); return; case 4: i16 = 8192; list = m(g(this.f13280b)); str5 = "audio/vorbis"; str = null; i11 = i16; i12 = -1; byte[] bArr222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222 = mVar.e(this.f13281c, i13); this.X = e1022222; e1022222.b(E222222); return; case 5: str5 = "audio/mpeg-L2"; list = null; str = null; i11 = i16; i12 = -1; byte[] bArr2222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222 = mVar.e(this.f13281c, i13); this.X = e10222222; e10222222.b(E2222222); return; case 6: str5 = "audio/mpeg"; list = null; str = null; i11 = i16; i12 = -1; byte[] bArr22222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222 = mVar.e(this.f13281c, i13); this.X = e102222222; e102222222.b(E22222222); return; case 7: Pair<String, List<byte[]>> k10 = k(new q7.b0(g(this.f13280b))); str5 = (String) k10.first; list = (List) k10.second; str = null; i12 = -1; i11 = -1; byte[] bArr222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222 = mVar.e(this.f13281c, i13); this.X = e1022222222; e1022222222.b(E222222222); return; case '\b': byte[] bArr3 = new byte[4]; System.arraycopy(g(this.f13280b), 0, bArr3, 0, 4); list = q.w(bArr3); str5 = "application/dvbsubs"; str = null; i12 = -1; i11 = -1; byte[] bArr2222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222; e10222222222.b(E2222222222); return; case '\n': r7.a b10 = r7.a.b(new q7.b0(g(this.f13280b))); list2 = b10.f23800a; this.Y = b10.f23801b; str3 = b10.f23805f; str5 = TPDecoderType.TP_CODEC_MIMETYPE_AVC; i12 = -1; i11 = -1; str = str3; list = list2; byte[] bArr22222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222; e102222222222.b(E22222222222); return; case 11: list = q.w(g(this.f13280b)); str = null; str5 = "application/vobsub"; i12 = -1; i11 = -1; byte[] bArr222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222; e1022222222222.b(E222222222222); return; case '\f': str5 = "audio/vnd.dts.hd"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr2222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222; e10222222222222.b(E2222222222222); return; case '\r': list = Collections.singletonList(g(this.f13280b)); a.b f11 = u5.a.f(this.f13289k); this.Q = f11.f25849a; this.O = f11.f25850b; str = f11.f25851c; str5 = "audio/mp4a-latm"; i12 = -1; i11 = -1; byte[] bArr22222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222; e102222222222222.b(E22222222222222); return; case 14: str5 = "audio/ac3"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222; e1022222222222222.b(E222222222222222); return; case 15: case 21: str5 = "audio/vnd.dts"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr2222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222; e10222222222222222.b(E2222222222222222); return; case 16: str5 = TPDecoderType.TP_CODEC_MIMETYPE_AV1; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr22222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222; e102222222222222222.b(E22222222222222222); return; case 17: str5 = TPDecoderType.TP_CODEC_MIMETYPE_VP8; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222; e1022222222222222222.b(E222222222222222222); return; case 18: str5 = TPDecoderType.TP_CODEC_MIMETYPE_VP9; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr2222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222; e10222222222222222222.b(E2222222222222222222); return; case 19: list = null; str = null; str5 = "application/pgs"; i12 = -1; i11 = -1; byte[] bArr22222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222; e102222222222222222222.b(E22222222222222222222); return; case 20: str5 = "video/x-unknown"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222; e1022222222222222222222.b(E222222222222222222222); return; case 22: if (this.P == 32) { list = null; str = null; i12 = 4; i11 = -1; byte[] bArr2222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222222; e10222222222222222222222.b(E2222222222222222222222); return; } sb2 = new StringBuilder(); str2 = "Unsupported floating point PCM bit depth: "; sb2.append(str2); sb2.append(this.P); sb2.append(". Setting mimeType to "); sb2.append("audio/x-unknown"); r.i("MatroskaExtractor", sb2.toString()); list = null; str = null; str5 = "audio/x-unknown"; i12 = -1; i11 = -1; byte[] bArr22222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222222; e102222222222222222222222.b(E22222222222222222222222); return; case 23: int i21 = this.P; if (i21 == 8) { list = null; str = null; i12 = 3; i11 = -1; byte[] bArr222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222222; e1022222222222222222222222.b(E222222222222222222222222); return; } else if (i21 == 16) { b02 = 268435456; i12 = b02; list = null; str = null; i11 = -1; byte[] bArr2222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222222222; e10222222222222222222222222.b(E2222222222222222222222222); return; } else { sb2 = new StringBuilder(); str2 = "Unsupported big endian PCM bit depth: "; sb2.append(str2); sb2.append(this.P); sb2.append(". Setting mimeType to "); sb2.append("audio/x-unknown"); r.i("MatroskaExtractor", sb2.toString()); list = null; str = null; str5 = "audio/x-unknown"; i12 = -1; i11 = -1; byte[] bArr22222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222222222; e102222222222222222222222222.b(E22222222222222222222222222); return; } case 24: b02 = n0.b0(this.P); if (b02 == 0) { sb2 = new StringBuilder(); str2 = "Unsupported little endian PCM bit depth: "; sb2.append(str2); sb2.append(this.P); sb2.append(". Setting mimeType to "); sb2.append("audio/x-unknown"); r.i("MatroskaExtractor", sb2.toString()); list = null; str = null; str5 = "audio/x-unknown"; i12 = -1; i11 = -1; byte[] bArr222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222222222; e1022222222222222222222222222.b(E222222222222222222222222222); return; } i12 = b02; list = null; str = null; i11 = -1; byte[] bArr2222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222222222222; e10222222222222222222222222222.b(E2222222222222222222222222222); return; case 25: list = q.x(e.f13245e0, g(this.f13280b)); str = null; str5 = "text/x-ssa"; i12 = -1; i11 = -1; byte[] bArr22222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222222222222; e102222222222222222222222222222.b(E22222222222222222222222222222); return; case 26: f a11 = f.a(new q7.b0(g(this.f13280b))); list2 = a11.f23830a; this.Y = a11.f23831b; str3 = a11.f23835f; str5 = TPDecoderType.TP_CODEC_MIMETYPE_HEVC; i12 = -1; i11 = -1; str = str3; list = list2; byte[] bArr222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222222222222; e1022222222222222222222222222222.b(E222222222222222222222222222222); return; case 27: list = null; str = null; str5 = "text/vtt"; i12 = -1; i11 = -1; byte[] bArr2222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222222222222222; e10222222222222222222222222222222.b(E2222222222222222222222222222222); return; case 28: str5 = "application/x-subrip"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr22222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222222222222222; e102222222222222222222222222222222.b(E22222222222222222222222222222222); return; case 29: str5 = "video/mpeg2"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr222222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222222222222222; e1022222222222222222222222222222222.b(E222222222222222222222222222222222); return; case 30: str5 = "audio/eac3"; list = null; str = null; i12 = -1; i11 = -1; byte[] bArr2222222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i17222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E2222222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i17222222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e10222222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e10222222222222222222222222222222222; e10222222222222222222222222222222222.b(E2222222222222222222222222222222222); return; case 31: list = Collections.singletonList(g(this.f13280b)); str5 = "audio/flac"; str = null; i12 = -1; i11 = -1; byte[] bArr22222222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i172222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E22222222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i172222222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e102222222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e102222222222222222222222222222222222; e102222222222222222222222222222222222.b(E22222222222222222222222222222222222); return; case ' ': i16 = 5760; list = new ArrayList<>(3); list.add(g(this.f13280b)); ByteBuffer allocate = ByteBuffer.allocate(8); ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN; list.add(allocate.order(byteOrder).putLong(this.R).array()); list.add(ByteBuffer.allocate(8).order(byteOrder).putLong(this.S).array()); str5 = "audio/opus"; str = null; i11 = i16; i12 = -1; byte[] bArr222222222222222222222222222222222222 = this.N; str = a10.f23815c; str5 = TPDecoderType.TP_CODEC_MIMETYPE_DOLBYVISION; int i1722222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0; bVar = new m1.b(); if (!v.o(str5)) { } bVar.U(this.f13279a); m1 E222222222222222222222222222222222222 = bVar.R(i10).e0(str5).W(i11).V(this.W).g0(i1722222222222222222222222222222222222).T(list).I(str).M(this.f13290l).E(); x5.b0 e1022222222222222222222222222222222222 = mVar.e(this.f13281c, i13); this.X = e1022222222222222222222222222222222222; e1022222222222222222222222222222222222.b(E222222222222222222222222222222222222); return; default: throw h2.a("Unrecognized codec identifier.", null); } } public void j() { c0 c0Var = this.T; if (c0Var != null) { c0Var.a(this.X, this.f13288j); } } public void n() { c0 c0Var = this.T; if (c0Var != null) { c0Var.b(); } } } static { HashMap hashMap = new HashMap(); hashMap.put("htc_video_rotA-000", 0); hashMap.put("htc_video_rotA-090", 90); hashMap.put("htc_video_rotA-180", 180); hashMap.put("htc_video_rotA-270", 270); f13249i0 = Collections.unmodifiableMap(hashMap); } public e() { this(0); } public e(int i10) { this(new a(), i10); } e(c cVar, int i10) { this.f13268q = -1; this.f13269r = -9223372036854775807L; this.f13270s = -9223372036854775807L; this.f13271t = -9223372036854775807L; this.f13277z = -1; this.A = -1; this.B = -9223372036854775807L; this.f13250a = cVar; cVar.b(new b()); this.f13255d = (i10 & 1) == 0; this.f13252b = new g(); this.f13254c = new SparseArray<>(); this.f13258g = new q7.b0(4); this.f13259h = new q7.b0(ByteBuffer.allocate(4).putInt(-1).array()); this.f13260i = new q7.b0(4); this.f13256e = new q7.b0(w.f23235a); this.f13257f = new q7.b0(4); this.f13261j = new q7.b0(); this.f13262k = new q7.b0(); this.f13263l = new q7.b0(8); this.f13264m = new q7.b0(); this.f13265n = new q7.b0(); this.L = new int[1]; } public static /* synthetic */ k[] A() { return new k[]{new e()}; } private boolean B(y yVar, long j10) { if (this.f13276y) { this.A = j10; yVar.f29152a = this.f13277z; this.f13276y = false; return true; } if (this.f13273v) { long j11 = this.A; if (j11 != -1) { yVar.f29152a = j11; this.A = -1; return true; } } return false; } private void C(l lVar, int i10) { if (this.f13258g.f() < i10) { if (this.f13258g.b() < i10) { q7.b0 b0Var = this.f13258g; b0Var.c(Math.max(b0Var.b() * 2, i10)); } lVar.readFully(this.f13258g.d(), this.f13258g.f(), i10 - this.f13258g.f()); this.f13258g.N(i10); } } private void D() { this.S = 0; this.T = 0; this.U = 0; this.V = false; this.W = false; this.X = false; this.Y = 0; this.Z = 0; this.f13251a0 = false; this.f13261j.K(0); } private long E(long j10) { long j11 = this.f13269r; if (j11 != -9223372036854775807L) { return n0.M0(j10, j11, 1000); } throw h2.a("Can't scale timecode prior to timecodeScale being set.", null); } private static void F(String str, long j10, byte[] bArr) { int i10; byte[] bArr2; str.hashCode(); char c10 = 65535; switch (str.hashCode()) { case 738597099: if (str.equals("S_TEXT/ASS")) { c10 = 0; break; } break; case 1045209816: if (str.equals("S_TEXT/WEBVTT")) { c10 = 1; break; } break; case 1422270023: if (str.equals("S_TEXT/UTF8")) { c10 = 2; break; } break; } switch (c10) { case 0: bArr2 = s(j10, "%01d:%02d:%02d:%02d", 10000); i10 = 21; break; case 1: bArr2 = s(j10, "%02d:%02d:%02d.%03d", 1000); i10 = 25; break; case 2: bArr2 = s(j10, "%02d:%02d:%02d,%03d", 1000); i10 = 19; break; default: throw new IllegalArgumentException(); } System.arraycopy(bArr2, 0, bArr, i10, bArr2.length); } private int I(l lVar, c cVar, int i10, boolean z10) { int i11; if ("S_TEXT/UTF8".equals(cVar.f13280b)) { J(lVar, f13244d0, i10); } else if ("S_TEXT/ASS".equals(cVar.f13280b)) { J(lVar, f13246f0, i10); } else if ("S_TEXT/WEBVTT".equals(cVar.f13280b)) { J(lVar, f13247g0, i10); } else { x5.b0 b0Var = cVar.X; boolean z11 = true; if (!this.V) { if (cVar.f13286h) { this.O &= -1073741825; int i12 = 128; if (!this.W) { lVar.readFully(this.f13258g.d(), 0, 1); this.S++; if ((this.f13258g.d()[0] & 128) != 128) { this.Z = this.f13258g.d()[0]; this.W = true; } else { throw h2.a("Extension bit is set in signal byte", null); } } byte b10 = this.Z; if ((b10 & 1) == 1) { boolean z12 = (b10 & 2) == 2; this.O |= 1073741824; if (!this.f13251a0) { lVar.readFully(this.f13263l.d(), 0, 8); this.S += 8; this.f13251a0 = true; byte[] d10 = this.f13258g.d(); if (!z12) { i12 = 0; } d10[0] = (byte) (i12 | 8); this.f13258g.O(0); b0Var.a(this.f13258g, 1, 1); this.T++; this.f13263l.O(0); b0Var.a(this.f13263l, 8, 1); this.T += 8; } if (z12) { if (!this.X) { lVar.readFully(this.f13258g.d(), 0, 1); this.S++; this.f13258g.O(0); this.Y = this.f13258g.C(); this.X = true; } int i13 = this.Y * 4; this.f13258g.K(i13); lVar.readFully(this.f13258g.d(), 0, i13); this.S += i13; short s10 = (short) ((this.Y / 2) + 1); int i14 = (s10 * 6) + 2; ByteBuffer byteBuffer = this.f13266o; if (byteBuffer == null || byteBuffer.capacity() < i14) { this.f13266o = ByteBuffer.allocate(i14); } this.f13266o.position(0); this.f13266o.putShort(s10); int i15 = 0; int i16 = 0; while (true) { i11 = this.Y; if (i15 >= i11) { break; } int G2 = this.f13258g.G(); if (i15 % 2 == 0) { this.f13266o.putShort((short) (G2 - i16)); } else { this.f13266o.putInt(G2 - i16); } i15++; i16 = G2; } int i17 = (i10 - this.S) - i16; int i18 = i11 % 2; ByteBuffer byteBuffer2 = this.f13266o; if (i18 == 1) { byteBuffer2.putInt(i17); } else { byteBuffer2.putShort((short) i17); this.f13266o.putInt(0); } this.f13264m.M(this.f13266o.array(), i14); b0Var.a(this.f13264m, i14, 1); this.T += i14; } } } else { byte[] bArr = cVar.f13287i; if (bArr != null) { this.f13261j.M(bArr, bArr.length); } } if (cVar.o(z10)) { this.O |= 268435456; this.f13265n.K(0); int f10 = (this.f13261j.f() + i10) - this.S; this.f13258g.K(4); this.f13258g.d()[0] = (byte) ((f10 >> 24) & 255); this.f13258g.d()[1] = (byte) ((f10 >> 16) & 255); this.f13258g.d()[2] = (byte) ((f10 >> 8) & 255); this.f13258g.d()[3] = (byte) (f10 & 255); b0Var.a(this.f13258g, 4, 2); this.T += 4; } this.V = true; } int f11 = i10 + this.f13261j.f(); if (!"V_MPEG4/ISO/AVC".equals(cVar.f13280b) && !"V_MPEGH/ISO/HEVC".equals(cVar.f13280b)) { if (cVar.T != null) { if (this.f13261j.f() != 0) { z11 = false; } q7.a.f(z11); cVar.T.d(lVar); } while (true) { int i19 = this.S; if (i19 >= f11) { break; } int K2 = K(lVar, b0Var, f11 - i19); this.S += K2; this.T += K2; } } else { byte[] d11 = this.f13257f.d(); d11[0] = 0; d11[1] = 0; d11[2] = 0; int i20 = cVar.Y; int i21 = 4 - i20; while (this.S < f11) { int i22 = this.U; if (i22 == 0) { L(lVar, d11, i21, i20); this.S += i20; this.f13257f.O(0); this.U = this.f13257f.G(); this.f13256e.O(0); b0Var.f(this.f13256e, 4); this.T += 4; } else { int K3 = K(lVar, b0Var, i22); this.S += K3; this.T += K3; this.U -= K3; } } } if ("A_VORBIS".equals(cVar.f13280b)) { this.f13259h.O(0); b0Var.f(this.f13259h, 4); this.T += 4; } return q(); } return q(); } private void J(l lVar, byte[] bArr, int i10) { int length = bArr.length + i10; if (this.f13262k.b() < length) { this.f13262k.L(Arrays.copyOf(bArr, length + i10)); } else { System.arraycopy(bArr, 0, this.f13262k.d(), 0, bArr.length); } lVar.readFully(this.f13262k.d(), bArr.length, i10); this.f13262k.O(0); this.f13262k.N(length); } private int K(l lVar, x5.b0 b0Var, int i10) { int a10 = this.f13261j.a(); if (a10 <= 0) { return b0Var.e(lVar, i10, false); } int min = Math.min(i10, a10); b0Var.f(this.f13261j, min); return min; } private void L(l lVar, byte[] bArr, int i10, int i11) { int min = Math.min(i11, this.f13261j.a()); lVar.readFully(bArr, i10 + min, i11 - min); if (min > 0) { this.f13261j.j(bArr, i10, min); } } private void i(int i10) { if (this.C == null || this.D == null) { throw h2.a("Element " + i10 + " must be in a Cues", null); } } private void j(int i10) { if (this.f13272u == null) { throw h2.a("Element " + i10 + " must be in a TrackEntry", null); } } private void k() { q7.a.h(this.f13253b0); } private z m(s sVar, s sVar2) { int i10; if (this.f13268q == -1 || this.f13271t == -9223372036854775807L || sVar == null || sVar.c() == 0 || sVar2 == null || sVar2.c() != sVar.c()) { return new z.b(this.f13271t); } int c10 = sVar.c(); int[] iArr = new int[c10]; long[] jArr = new long[c10]; long[] jArr2 = new long[c10]; long[] jArr3 = new long[c10]; int i11 = 0; for (int i12 = 0; i12 < c10; i12++) { jArr3[i12] = sVar.b(i12); jArr[i12] = this.f13268q + sVar2.b(i12); } while (true) { i10 = c10 - 1; if (i11 >= i10) { break; } int i13 = i11 + 1; iArr[i11] = (int) (jArr[i13] - jArr[i11]); jArr2[i11] = jArr3[i13] - jArr3[i11]; i11 = i13; } iArr[i10] = (int) ((this.f13268q + this.f13267p) - jArr[i10]); jArr2[i10] = this.f13271t - jArr3[i10]; long j10 = jArr2[i10]; if (j10 <= 0) { r.i("MatroskaExtractor", "Discarding last cue point with unexpected duration: " + j10); iArr = Arrays.copyOf(iArr, i10); jArr = Arrays.copyOf(jArr, i10); jArr2 = Arrays.copyOf(jArr2, i10); jArr3 = Arrays.copyOf(jArr3, i10); } return new x5.c(iArr, jArr, jArr2, jArr3); } private void n(c cVar, long j10, int i10, int i11, int i12) { String str; c0 c0Var = cVar.T; if (c0Var != null) { c0Var.c(cVar.X, j10, i10, i11, i12, cVar.f13288j); } else { if ("S_TEXT/UTF8".equals(cVar.f13280b) || "S_TEXT/ASS".equals(cVar.f13280b) || "S_TEXT/WEBVTT".equals(cVar.f13280b)) { if (this.K > 1) { str = "Skipping subtitle sample in laced block."; } else { long j11 = this.I; if (j11 == -9223372036854775807L) { str = "Skipping subtitle sample with no duration."; } else { F(cVar.f13280b, j11, this.f13262k.d()); int e10 = this.f13262k.e(); while (true) { if (e10 >= this.f13262k.f()) { break; } else if (this.f13262k.d()[e10] == 0) { this.f13262k.N(e10); break; } else { e10++; } } x5.b0 b0Var = cVar.X; q7.b0 b0Var2 = this.f13262k; b0Var.f(b0Var2, b0Var2.f()); i11 += this.f13262k.f(); } } r.i("MatroskaExtractor", str); } if ((268435456 & i10) != 0) { if (this.K > 1) { this.f13265n.K(0); } else { int f10 = this.f13265n.f(); cVar.X.a(this.f13265n, f10, 2); i11 += f10; } } cVar.X.d(j10, i10, i11, i12, cVar.f13288j); } this.F = true; } private static int[] p(int[] iArr, int i10) { return iArr == null ? new int[i10] : iArr.length >= i10 ? iArr : new int[Math.max(iArr.length * 2, i10)]; } private int q() { int i10 = this.T; D(); return i10; } private static byte[] s(long j10, String str, long j11) { q7.a.a(j10 != -9223372036854775807L); int i10 = (int) (j10 / 3600000000L); long j12 = j10 - ((((long) i10) * 3600) * 1000000); int i11 = (int) (j12 / 60000000); long j13 = j12 - ((((long) i11) * 60) * 1000000); int i12 = (int) (j13 / 1000000); return n0.l0(String.format(Locale.US, str, Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf((int) ((j13 - (((long) i12) * 1000000)) / j11)))); } private static boolean y(String str) { str.hashCode(); char c10 = 65535; switch (str.hashCode()) { case -2095576542: if (str.equals("V_MPEG4/ISO/AP")) { c10 = 0; break; } break; case -2095575984: if (str.equals("V_MPEG4/ISO/SP")) { c10 = 1; break; } break; case -1985379776: if (str.equals("A_MS/ACM")) { c10 = 2; break; } break; case -1784763192: if (str.equals("A_TRUEHD")) { c10 = 3; break; } break; case -1730367663: if (str.equals("A_VORBIS")) { c10 = 4; break; } break; case -1482641358: if (str.equals("A_MPEG/L2")) { c10 = 5; break; } break; case -1482641357: if (str.equals("A_MPEG/L3")) { c10 = 6; break; } break; case -1373388978: if (str.equals("V_MS/VFW/FOURCC")) { c10 = 7; break; } break; case -933872740: if (str.equals("S_DVBSUB")) { c10 = '\b'; break; } break; case -538363189: if (str.equals("V_MPEG4/ISO/ASP")) { c10 = '\t'; break; } break; case -538363109: if (str.equals("V_MPEG4/ISO/AVC")) { c10 = '\n'; break; } break; case -425012669: if (str.equals("S_VOBSUB")) { c10 = 11; break; } break; case -356037306: if (str.equals("A_DTS/LOSSLESS")) { c10 = '\f'; break; } break; case 62923557: if (str.equals("A_AAC")) { c10 = '\r'; break; } break; case 62923603: if (str.equals("A_AC3")) { c10 = 14; break; } break; case 62927045: if (str.equals("A_DTS")) { c10 = 15; break; } break; case 82318131: if (str.equals("V_AV1")) { c10 = 16; break; } break; case 82338133: if (str.equals("V_VP8")) { c10 = 17; break; } break; case 82338134: if (str.equals("V_VP9")) { c10 = 18; break; } break; case 99146302: if (str.equals("S_HDMV/PGS")) { c10 = 19; break; } break; case 444813526: if (str.equals("V_THEORA")) { c10 = 20; break; } break; case 542569478: if (str.equals("A_DTS/EXPRESS")) { c10 = 21; break; } break; case 635596514: if (str.equals("A_PCM/FLOAT/IEEE")) { c10 = 22; break; } break; case 725948237: if (str.equals("A_PCM/INT/BIG")) { c10 = 23; break; } break; case 725957860: if (str.equals("A_PCM/INT/LIT")) { c10 = 24; break; } break; case 738597099: if (str.equals("S_TEXT/ASS")) { c10 = 25; break; } break; case 855502857: if (str.equals("V_MPEGH/ISO/HEVC")) { c10 = 26; break; } break; case 1045209816: if (str.equals("S_TEXT/WEBVTT")) { c10 = 27; break; } break; case 1422270023: if (str.equals("S_TEXT/UTF8")) { c10 = 28; break; } break; case 1809237540: if (str.equals("V_MPEG2")) { c10 = 29; break; } break; case 1950749482: if (str.equals("A_EAC3")) { c10 = 30; break; } break; case 1950789798: if (str.equals("A_FLAC")) { c10 = 31; break; } break; case 1951062397: if (str.equals("A_OPUS")) { c10 = ' '; break; } break; } switch (c10) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case '\b': case '\t': case '\n': case 11: case '\f': case '\r': case 14: case 15: case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: case ' ': return true; default: return false; } } public void G(int i10, long j10, long j11) { k(); if (i10 == 160) { this.Q = false; this.R = 0; } else if (i10 == 174) { this.f13272u = new c(); } else if (i10 == 187) { this.E = false; } else if (i10 == 19899) { this.f13274w = -1; this.f13275x = -1; } else if (i10 == 20533) { t(i10).f13286h = true; } else if (i10 == 21968) { t(i10).f13302x = true; } else if (i10 == 408125543) { long j12 = this.f13268q; if (j12 == -1 || j12 == j10) { this.f13268q = j10; this.f13267p = j11; return; } throw h2.a("Multiple Segment elements not supported", null); } else if (i10 == 475249515) { this.C = new s(); this.D = new s(); } else if (i10 != 524531317 || this.f13273v) { } else { if (!this.f13255d || this.f13277z == -1) { this.f13253b0.n(new z.b(this.f13271t)); this.f13273v = true; return; } this.f13276y = true; } } public void H(int i10, String str) { if (i10 == 134) { t(i10).f13280b = str; } else if (i10 != 17026) { if (i10 == 21358) { t(i10).f13279a = str; } else if (i10 == 2274716) { t(i10).W = str; } } else if (!"webm".equals(str) && !"matroska".equals(str)) { throw h2.a("DocType " + str + " not supported", null); } } @Override // x5.k public final void b(m mVar) { this.f13253b0 = mVar; } @Override // x5.k public void c(long j10, long j11) { this.B = -9223372036854775807L; this.G = 0; this.f13250a.reset(); this.f13252b.e(); D(); for (int i10 = 0; i10 < this.f13254c.size(); i10++) { this.f13254c.valueAt(i10).n(); } } @Override // x5.k public final boolean d(l lVar) { return new f().b(lVar); } @Override // x5.k public final int g(l lVar, y yVar) { this.F = false; boolean z10 = true; while (z10 && !this.F) { z10 = this.f13250a.a(lVar); if (z10 && B(yVar, lVar.getPosition())) { return 1; } } if (z10) { return 0; } for (int i10 = 0; i10 < this.f13254c.size(); i10++) { c valueAt = this.f13254c.valueAt(i10); valueAt.f(); valueAt.j(); } return -1; } public void l(int i10, int i11, l lVar) { c cVar; int i12; c cVar2; c cVar3; long j10; long j11; int i13; int i14; int[] iArr; int i15 = 0; int i16 = 1; if (i10 == 161 || i10 == 163) { if (this.G == 0) { this.M = (int) this.f13252b.d(lVar, false, true, 8); this.N = this.f13252b.b(); this.I = -9223372036854775807L; this.G = 1; this.f13258g.K(0); } c cVar4 = this.f13254c.get(this.M); if (cVar4 == null) { lVar.m(i11 - this.N); this.G = 0; return; } cVar4.f(); if (this.G == 1) { C(lVar, 3); int i17 = (this.f13258g.d()[2] & 6) >> 1; byte b10 = 255; if (i17 == 0) { this.K = 1; int[] p10 = p(this.L, 1); this.L = p10; p10[0] = (i11 - this.N) - 3; } else { int i18 = 4; C(lVar, 4); int i19 = (this.f13258g.d()[3] & 255) + 1; this.K = i19; int[] p11 = p(this.L, i19); this.L = p11; if (i17 == 2) { int i20 = this.K; Arrays.fill(p11, 0, i20, ((i11 - this.N) - 4) / i20); } else if (i17 == 1) { int i21 = 0; int i22 = 0; while (true) { i13 = this.K; if (i21 >= i13 - 1) { break; } this.L[i21] = 0; do { i18++; C(lVar, i18); i14 = this.f13258g.d()[i18 - 1] & 255; iArr = this.L; iArr[i21] = iArr[i21] + i14; } while (i14 == 255); i22 += iArr[i21]; i21++; } this.L[i13 - 1] = ((i11 - this.N) - i18) - i22; } else if (i17 == 3) { int i23 = 0; int i24 = 0; while (true) { int i25 = this.K; if (i23 >= i25 - 1) { cVar2 = cVar4; this.L[i25 - 1] = ((i11 - this.N) - i18) - i24; break; } this.L[i23] = i15; i18++; C(lVar, i18); int i26 = i18 - 1; if (this.f13258g.d()[i26] != 0) { int i27 = i15; while (true) { if (i27 >= 8) { cVar3 = cVar4; j10 = 0; break; } int i28 = i16 << (7 - i27); if ((this.f13258g.d()[i26] & i28) != 0) { int i29 = i18 + i27; C(lVar, i29); cVar3 = cVar4; long j12 = (long) ((~i28) & this.f13258g.d()[i26] & b10); int i30 = i26 + 1; while (true) { j11 = j12; if (i30 >= i29) { break; } j12 = (j11 << 8) | ((long) (this.f13258g.d()[i30] & b10)); i30++; i29 = i29; b10 = 255; } if (i23 > 0) { j11 -= (1 << ((i27 * 7) + 6)) - 1; } j10 = j11; i18 = i29; } else { i27++; i16 = 1; b10 = 255; } } if (j10 >= -2147483648L && j10 <= 2147483647L) { int i31 = (int) j10; int[] iArr2 = this.L; if (i23 != 0) { i31 += iArr2[i23 - 1]; } iArr2[i23] = i31; i24 += iArr2[i23]; i23++; cVar4 = cVar3; i15 = 0; i16 = 1; b10 = 255; } } else { throw h2.a("No valid varint length mask found", null); } } throw h2.a("EBML lacing sample size out of range.", null); } else { throw h2.a("Unexpected lacing value: " + i17, null); } } cVar2 = cVar4; this.H = this.B + E((long) ((this.f13258g.d()[0] << 8) | (this.f13258g.d()[1] & 255))); cVar = cVar2; this.O = (cVar.f13282d == 2 || (i10 == 163 && (this.f13258g.d()[2] & 128) == 128)) ? 1 : 0; this.G = 2; this.J = 0; i12 = 163; } else { cVar = cVar4; i12 = 163; } if (i10 == i12) { while (true) { int i32 = this.J; if (i32 < this.K) { n(cVar, ((long) ((this.J * cVar.f13283e) / 1000)) + this.H, this.O, I(lVar, cVar, this.L[i32], false), 0); this.J++; } else { this.G = 0; return; } } } else { while (true) { int i33 = this.J; if (i33 < this.K) { int[] iArr3 = this.L; iArr3[i33] = I(lVar, cVar, iArr3[i33], true); this.J++; } else { return; } } } } else if (i10 != 165) { if (i10 == 16877) { v(t(i10), lVar, i11); } else if (i10 == 16981) { j(i10); byte[] bArr = new byte[i11]; this.f13272u.f13287i = bArr; lVar.readFully(bArr, 0, i11); } else if (i10 == 18402) { byte[] bArr2 = new byte[i11]; lVar.readFully(bArr2, 0, i11); t(i10).f13288j = new b0.a(1, bArr2, 0, 0); } else if (i10 == 21419) { Arrays.fill(this.f13260i.d(), (byte) 0); lVar.readFully(this.f13260i.d(), 4 - i11, i11); this.f13260i.O(0); this.f13274w = (int) this.f13260i.E(); } else if (i10 == 25506) { j(i10); byte[] bArr3 = new byte[i11]; this.f13272u.f13289k = bArr3; lVar.readFully(bArr3, 0, i11); } else if (i10 == 30322) { j(i10); byte[] bArr4 = new byte[i11]; this.f13272u.f13300v = bArr4; lVar.readFully(bArr4, 0, i11); } else { throw h2.a("Unexpected id: " + i10, null); } } else if (this.G == 2) { w(this.f13254c.get(this.M), this.P, lVar, i11); } } public void o(int i10) { k(); if (i10 != 160) { if (i10 == 174) { c cVar = (c) q7.a.h(this.f13272u); String str = cVar.f13280b; if (str != null) { if (y(str)) { cVar.i(this.f13253b0, cVar.f13281c); this.f13254c.put(cVar.f13281c, cVar); } this.f13272u = null; return; } throw h2.a("CodecId is missing in TrackEntry element", null); } else if (i10 == 19899) { int i11 = this.f13274w; if (i11 != -1) { long j10 = this.f13275x; if (j10 != -1) { if (i11 == 475249515) { this.f13277z = j10; return; } return; } } throw h2.a("Mandatory element SeekID or SeekPosition not found", null); } else if (i10 == 25152) { j(i10); c cVar2 = this.f13272u; if (!cVar2.f13286h) { return; } if (cVar2.f13288j != null) { cVar2.f13290l = new w5.m(new m.b(i.f24357a, "video/webm", this.f13272u.f13288j.f29046b)); return; } throw h2.a("Encrypted Track found but ContentEncKeyID was not found", null); } else if (i10 == 28032) { j(i10); c cVar3 = this.f13272u; if (cVar3.f13286h && cVar3.f13287i != null) { throw h2.a("Combining encryption and compression is not supported", null); } } else if (i10 == 357149030) { if (this.f13269r == -9223372036854775807L) { this.f13269r = 1000000; } long j11 = this.f13270s; if (j11 != -9223372036854775807L) { this.f13271t = E(j11); } } else if (i10 != 374648427) { if (i10 == 475249515) { if (!this.f13273v) { this.f13253b0.n(m(this.C, this.D)); this.f13273v = true; } this.C = null; this.D = null; } } else if (this.f13254c.size() != 0) { this.f13253b0.k(); } else { throw h2.a("No valid tracks were found", null); } } else if (this.G == 2) { c cVar4 = this.f13254c.get(this.M); cVar4.f(); if (this.R > 0 && "A_OPUS".equals(cVar4.f13280b)) { this.f13265n.L(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(this.R).array()); } int i12 = 0; for (int i13 = 0; i13 < this.K; i13++) { i12 += this.L[i13]; } int i14 = 0; while (i14 < this.K) { long j12 = this.H + ((long) ((cVar4.f13283e * i14) / 1000)); int i15 = this.O; if (i14 == 0 && !this.Q) { i15 |= 1; } int i16 = this.L[i14]; int i17 = i12 - i16; n(cVar4, j12, i15, i16, i17); i14++; i12 = i17; } this.G = 0; } } public void r(int i10, double d10) { if (i10 == 181) { t(i10).Q = (int) d10; } else if (i10 != 17545) { switch (i10) { case 21969: t(i10).D = (float) d10; return; case 21970: t(i10).E = (float) d10; return; case 21971: t(i10).F = (float) d10; return; case 21972: t(i10).G = (float) d10; return; case 21973: t(i10).H = (float) d10; return; case 21974: t(i10).I = (float) d10; return; case 21975: t(i10).J = (float) d10; return; case 21976: t(i10).K = (float) d10; return; case 21977: t(i10).L = (float) d10; return; case 21978: t(i10).M = (float) d10; return; default: switch (i10) { case 30323: t(i10).f13297s = (float) d10; return; case 30324: t(i10).f13298t = (float) d10; return; case 30325: t(i10).f13299u = (float) d10; return; default: return; } } } else { this.f13270s = (long) d10; } } @Override // x5.k public final void release() { } public c t(int i10) { j(i10); return this.f13272u; } public int u(int i10) { switch (i10) { case 131: case TPOptionalID.OPTION_ID_BEFORE_LONG_DEMXUER_TYPE: case 155: case 159: case 176: case 179: case 186: case TPNativePlayerInitConfig.BOOL_VIDEO_KEEP_MEDIA_CODEC_PTS: case 231: case 238: case 241: case 251: case 16871: case 16980: case 17029: case 17143: case 18401: case 18408: case 20529: case 20530: case 21420: case 21432: case 21680: case 21682: case 21690: case 21930: case 21945: case 21946: case 21947: case 21948: case 21949: case 21998: case 22186: case 22203: case 25188: case 30114: case 30321: case 2352003: case 2807729: return 2; case 134: case 17026: case 21358: case 2274716: return 3; case 160: case 166: case 174: case 183: case 187: case 224: case 225: case 16868: case 18407: case 19899: case 20532: case 20533: case 21936: case 21968: case 25152: case 28032: case 30113: case 30320: case 290298740: case 357149030: case 374648427: case 408125543: case 440786851: case 475249515: case 524531317: return 1; case 161: case 163: case 165: case 16877: case 16981: case 18402: case 21419: case 25506: case 30322: return 4; case 181: case 17545: case 21969: case 21970: case 21971: case 21972: case 21973: case 21974: case 21975: case 21976: case 21977: case 21978: case 30323: case 30324: case 30325: return 5; default: return 0; } } public void v(c cVar, l lVar, int i10) { if (cVar.f13285g == 1685485123 || cVar.f13285g == 1685480259) { byte[] bArr = new byte[i10]; cVar.N = bArr; lVar.readFully(bArr, 0, i10); return; } lVar.m(i10); } public void w(c cVar, int i10, l lVar, int i11) { if (i10 != 4 || !"V_VP9".equals(cVar.f13280b)) { lVar.m(i11); return; } this.f13265n.K(i11); lVar.readFully(this.f13265n.d(), 0, i11); } public void x(int i10, long j10) { if (i10 != 20529) { if (i10 != 20530) { boolean z10 = false; switch (i10) { case 131: t(i10).f13282d = (int) j10; return; case TPOptionalID.OPTION_ID_BEFORE_LONG_DEMXUER_TYPE: c t10 = t(i10); if (j10 == 1) { z10 = true; } t10.V = z10; return; case 155: this.I = E(j10); return; case 159: t(i10).O = (int) j10; return; case 176: t(i10).f13291m = (int) j10; return; case 179: i(i10); this.C.a(E(j10)); return; case 186: t(i10).f13292n = (int) j10; return; case TPNativePlayerInitConfig.BOOL_VIDEO_KEEP_MEDIA_CODEC_PTS: t(i10).f13281c = (int) j10; return; case 231: this.B = E(j10); return; case 238: this.P = (int) j10; return; case 241: if (!this.E) { i(i10); this.D.a(j10); this.E = true; return; } return; case 251: this.Q = true; return; case 16871: t(i10).f13285g = (int) j10; return; case 16980: if (j10 != 3) { throw h2.a("ContentCompAlgo " + j10 + " not supported", null); } return; case 17029: if (j10 < 1 || j10 > 2) { throw h2.a("DocTypeReadVersion " + j10 + " not supported", null); } return; case 17143: if (j10 != 1) { throw h2.a("EBMLReadVersion " + j10 + " not supported", null); } return; case 18401: if (j10 != 5) { throw h2.a("ContentEncAlgo " + j10 + " not supported", null); } return; case 18408: if (j10 != 1) { throw h2.a("AESSettingsCipherMode " + j10 + " not supported", null); } return; case 21420: this.f13275x = j10 + this.f13268q; return; case 21432: int i11 = (int) j10; j(i10); if (i11 == 0) { this.f13272u.f13301w = 0; return; } else if (i11 == 1) { this.f13272u.f13301w = 2; return; } else if (i11 == 3) { this.f13272u.f13301w = 1; return; } else if (i11 == 15) { this.f13272u.f13301w = 3; return; } else { return; } case 21680: t(i10).f13293o = (int) j10; return; case 21682: t(i10).f13295q = (int) j10; return; case 21690: t(i10).f13294p = (int) j10; return; case 21930: c t11 = t(i10); if (j10 == 1) { z10 = true; } t11.U = z10; return; case 21998: t(i10).f13284f = (int) j10; return; case 22186: t(i10).R = j10; return; case 22203: t(i10).S = j10; return; case 25188: t(i10).P = (int) j10; return; case 30114: this.R = j10; return; case 30321: j(i10); int i12 = (int) j10; if (i12 == 0) { this.f13272u.f13296r = 0; return; } else if (i12 == 1) { this.f13272u.f13296r = 1; return; } else if (i12 == 2) { this.f13272u.f13296r = 2; return; } else if (i12 == 3) { this.f13272u.f13296r = 3; return; } else { return; } case 2352003: t(i10).f13283e = (int) j10; return; case 2807729: this.f13269r = j10; return; default: switch (i10) { case 21945: j(i10); int i13 = (int) j10; if (i13 == 1) { this.f13272u.A = 2; return; } else if (i13 == 2) { this.f13272u.A = 1; return; } else { return; } case 21946: j(i10); int c10 = r7.c.c((int) j10); if (c10 != -1) { this.f13272u.f13304z = c10; return; } return; case 21947: j(i10); this.f13272u.f13302x = true; int b10 = r7.c.b((int) j10); if (b10 != -1) { this.f13272u.f13303y = b10; return; } return; case 21948: t(i10).B = (int) j10; return; case 21949: t(i10).C = (int) j10; return; default: return; } } } else if (j10 != 1) { throw h2.a("ContentEncodingScope " + j10 + " not supported", null); } } else if (j10 != 0) { throw h2.a("ContentEncodingOrder " + j10 + " not supported", null); } } public boolean z(int i10) { return i10 == 357149030 || i10 == 524531317 || i10 == 475249515 || i10 == 374648427; } }