PG娱乐城.apk(点击下载) / e.java
package h6;
import android.util.Pair;
import android.util.SparseArray;
import b6.b0;
import b6.c0;
import b6.k;
import b6.l;
import b6.m;
import b6.p;
import b6.y;
import b6.z;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.tencent.smtt.sdk.TbsListener;
import com.tencent.ugc.TXRecordCommon;
import java.io.IOException;
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 org.checkerframework.checker.nullness.qual.EnsuresNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
import r7.e0;
import r7.r0;
import r7.s;
import r7.t;
import r7.w;
import r7.x;
import s7.d;
import s7.f;
import w5.j;
import w5.r1;
import w5.y2;
import y5.a;
/* compiled from: MatroskaExtractor */
public class e implements k {
/* renamed from: c0 reason: collision with root package name */
public static final p f19598c0 = new d();
/* renamed from: d0 reason: collision with root package name */
public static final byte[] f19599d0 = {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 reason: collision with root package name */
public static final byte[] f19600e0 = r0.m0("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
/* renamed from: f0 reason: collision with root package name */
public static final byte[] f19601f0 = {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 reason: collision with root package name */
public static final byte[] f19602g0 = {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 reason: collision with root package name */
public static final UUID f19603h0 = new UUID(72057594037932032L, -9223371306706625679L);
/* renamed from: i0 reason: collision with root package name */
public static final Map<String, Integer> f19604i0;
public long A;
public long B;
public t C;
public t D;
public boolean E;
public boolean F;
public int G;
public long H;
public long I;
public int J;
public int K;
public int[] L;
public int M;
public int N;
public int O;
public int P;
public boolean Q;
public long R;
public int S;
public int T;
public int U;
public boolean V;
public boolean W;
public boolean X;
public int Y;
public byte Z;
/* renamed from: a reason: collision with root package name */
public final c f19605a;
/* renamed from: a0 reason: collision with root package name */
public boolean f19606a0;
/* renamed from: b reason: collision with root package name */
public final g f19607b;
/* renamed from: b0 reason: collision with root package name */
public m f19608b0;
/* renamed from: c reason: collision with root package name */
public final SparseArray<c> f19609c;
/* renamed from: d reason: collision with root package name */
public final boolean f19610d;
/* renamed from: e reason: collision with root package name */
public final e0 f19611e;
/* renamed from: f reason: collision with root package name */
public final e0 f19612f;
/* renamed from: g reason: collision with root package name */
public final e0 f19613g;
/* renamed from: h reason: collision with root package name */
public final e0 f19614h;
/* renamed from: i reason: collision with root package name */
public final e0 f19615i;
/* renamed from: j reason: collision with root package name */
public final e0 f19616j;
/* renamed from: k reason: collision with root package name */
public final e0 f19617k;
/* renamed from: l reason: collision with root package name */
public final e0 f19618l;
/* renamed from: m reason: collision with root package name */
public final e0 f19619m;
/* renamed from: n reason: collision with root package name */
public final e0 f19620n;
/* renamed from: o reason: collision with root package name */
public ByteBuffer f19621o;
/* renamed from: p reason: collision with root package name */
public long f19622p;
/* renamed from: q reason: collision with root package name */
public long f19623q;
/* renamed from: r reason: collision with root package name */
public long f19624r;
/* renamed from: s reason: collision with root package name */
public long f19625s;
/* renamed from: t reason: collision with root package name */
public long f19626t;
/* renamed from: u reason: collision with root package name */
public c f19627u;
/* renamed from: v reason: collision with root package name */
public boolean f19628v;
/* renamed from: w reason: collision with root package name */
public int f19629w;
/* renamed from: x reason: collision with root package name */
public long f19630x;
/* renamed from: y reason: collision with root package name */
public boolean f19631y;
/* renamed from: z reason: collision with root package name */
public long f19632z;
/* compiled from: MatroskaExtractor */
public final class b implements b {
public b() {
}
@Override // h6.b
public void a(int i10) throws y2 {
e.this.o(i10);
}
@Override // h6.b
public void b(int i10, double d10) throws y2 {
e.this.r(i10, d10);
}
@Override // h6.b
public void c(int i10, int i11, l lVar) throws IOException {
e.this.l(i10, i11, lVar);
}
@Override // h6.b
public void d(int i10, long j10) throws y2 {
e.this.x(i10, j10);
}
@Override // h6.b
public int e(int i10) {
return e.this.u(i10);
}
@Override // h6.b
public boolean f(int i10) {
return e.this.z(i10);
}
@Override // h6.b
public void g(int i10, String str) throws y2 {
e.this.H(i10, str);
}
@Override // h6.b
public void h(int i10, long j10, long j11) throws y2 {
e.this.G(i10, j10, j11);
}
}
/* compiled from: MatroskaExtractor */
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 = TXRecordCommon.AUDIO_SAMPLERATE_8000;
public long R = 0;
public long S = 0;
public c0 T;
public boolean U;
public boolean V = true;
public String W = "eng";
public b0 X;
public int Y;
/* renamed from: a reason: collision with root package name */
public String f19634a;
/* renamed from: b reason: collision with root package name */
public String f19635b;
/* renamed from: c reason: collision with root package name */
public int f19636c;
/* renamed from: d reason: collision with root package name */
public int f19637d;
/* renamed from: e reason: collision with root package name */
public int f19638e;
/* renamed from: f reason: collision with root package name */
public int f19639f;
/* renamed from: g reason: collision with root package name */
public int f19640g;
/* renamed from: h reason: collision with root package name */
public boolean f19641h;
/* renamed from: i reason: collision with root package name */
public byte[] f19642i;
/* renamed from: j reason: collision with root package name */
public b0.a f19643j;
/* renamed from: k reason: collision with root package name */
public byte[] f19644k;
/* renamed from: l reason: collision with root package name */
public DrmInitData f19645l;
/* renamed from: m reason: collision with root package name */
public int f19646m = -1;
/* renamed from: n reason: collision with root package name */
public int f19647n = -1;
/* renamed from: o reason: collision with root package name */
public int f19648o = -1;
/* renamed from: p reason: collision with root package name */
public int f19649p = -1;
/* renamed from: q reason: collision with root package name */
public int f19650q = 0;
/* renamed from: r reason: collision with root package name */
public int f19651r = -1;
/* renamed from: s reason: collision with root package name */
public float f19652s = 0.0f;
/* renamed from: t reason: collision with root package name */
public float f19653t = 0.0f;
/* renamed from: u reason: collision with root package name */
public float f19654u = 0.0f;
/* renamed from: v reason: collision with root package name */
public byte[] f19655v = null;
/* renamed from: w reason: collision with root package name */
public int f19656w = -1;
/* renamed from: x reason: collision with root package name */
public boolean f19657x = false;
/* renamed from: y reason: collision with root package name */
public int f19658y = -1;
/* renamed from: z reason: collision with root package name */
public int f19659z = -1;
public static Pair<String, List<byte[]>> k(e0 e0Var) throws y2 {
try {
e0Var.V(16);
long x10 = e0Var.x();
if (x10 == 1482049860) {
return new Pair<>("video/divx", null);
}
if (x10 == 859189832) {
return new Pair<>("video/3gpp", null);
}
if (x10 == 826496599) {
byte[] e10 = e0Var.e();
for (int f10 = e0Var.f() + 20; f10 < e10.length - 4; f10++) {
if (e10[f10] == 0 && e10[f10 + 1] == 0 && e10[f10 + 2] == 1 && e10[f10 + 3] == 15) {
return new Pair<>("video/wvc1", Collections.singletonList(Arrays.copyOfRange(e10, f10, e10.length)));
}
}
throw y2.createForMalformedContainer("Failed to find FourCC VC1 initialization data", null);
}
s.i("MatroskaExtractor", "Unknown FourCC. Setting mimeType to video/x-unknown");
return new Pair<>("video/x-unknown", null);
} catch (ArrayIndexOutOfBoundsException unused) {
throw y2.createForMalformedContainer("Error parsing FourCC private data", null);
}
}
public static boolean l(e0 e0Var) throws y2 {
try {
int z10 = e0Var.z();
if (z10 == 1) {
return true;
}
if (z10 != 65534) {
return false;
}
e0Var.U(24);
if (e0Var.A() == e.f19603h0.getMostSignificantBits() && e0Var.A() == e.f19603h0.getLeastSignificantBits()) {
return true;
}
return false;
} catch (ArrayIndexOutOfBoundsException unused) {
throw y2.createForMalformedContainer("Error parsing MS/ACM codec private", null);
}
}
public static List<byte[]> m(byte[] bArr) throws y2 {
byte b10;
byte b11;
try {
if (bArr[0] == 2) {
int i10 = 0;
int i11 = 1;
while (true) {
b10 = bArr[i11];
if ((b10 & 255) != 255) {
break;
}
i10 += 255;
i11++;
}
int i12 = i11 + 1;
int i13 = i10 + (b10 & 255);
int i14 = 0;
while (true) {
b11 = bArr[i12];
if ((b11 & 255) != 255) {
break;
}
i14 += 255;
i12++;
}
int i15 = i12 + 1;
int i16 = i14 + (b11 & 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 y2.createForMalformedContainer("Error parsing vorbis codec private", null);
}
throw y2.createForMalformedContainer("Error parsing vorbis codec private", null);
}
throw y2.createForMalformedContainer("Error parsing vorbis codec private", null);
}
throw y2.createForMalformedContainer("Error parsing vorbis codec private", null);
} catch (ArrayIndexOutOfBoundsException unused) {
throw y2.createForMalformedContainer("Error parsing vorbis codec private", null);
}
}
@EnsuresNonNull({"output"})
public final void f() {
r7.a.e(this.X);
}
@EnsuresNonNull({"codecPrivate"})
public final byte[] g(String str) throws y2 {
byte[] bArr = this.f19644k;
if (bArr != null) {
return bArr;
}
throw y2.createForMalformedContainer("Missing CodecPrivate for codec " + str, null);
}
public final 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;
}
/* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARNING: Removed duplicated region for block: B:172:0x0432 */
/* JADX WARNING: Removed duplicated region for block: B:173:0x0434 */
/* JADX WARNING: Removed duplicated region for block: B:176:0x0441 */
/* JADX WARNING: Removed duplicated region for block: B:177:0x0453 */
@EnsuresNonNull({"this.output"})
@RequiresNonNull({"codecId"})
public void i(m mVar, int i10) throws y2 {
char c10;
int i11;
int i12;
String str;
List<byte[]> list;
int i13;
r1.b bVar;
int i14;
int i15;
int i16;
d a10;
int b02;
List<byte[]> list2;
String str2;
String str3 = this.f19635b;
str3.hashCode();
switch (str3.hashCode()) {
case -2095576542:
if (str3.equals("V_MPEG4/ISO/AP")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case -2095575984:
if (str3.equals("V_MPEG4/ISO/SP")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case -1985379776:
if (str3.equals("A_MS/ACM")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case -1784763192:
if (str3.equals("A_TRUEHD")) {
c10 = 3;
break;
}
c10 = 65535;
break;
case -1730367663:
if (str3.equals("A_VORBIS")) {
c10 = 4;
break;
}
c10 = 65535;
break;
case -1482641358:
if (str3.equals("A_MPEG/L2")) {
c10 = 5;
break;
}
c10 = 65535;
break;
case -1482641357:
if (str3.equals("A_MPEG/L3")) {
c10 = 6;
break;
}
c10 = 65535;
break;
case -1373388978:
if (str3.equals("V_MS/VFW/FOURCC")) {
c10 = 7;
break;
}
c10 = 65535;
break;
case -933872740:
if (str3.equals("S_DVBSUB")) {
c10 = '\b';
break;
}
c10 = 65535;
break;
case -538363189:
if (str3.equals("V_MPEG4/ISO/ASP")) {
c10 = '\t';
break;
}
c10 = 65535;
break;
case -538363109:
if (str3.equals("V_MPEG4/ISO/AVC")) {
c10 = '\n';
break;
}
c10 = 65535;
break;
case -425012669:
if (str3.equals("S_VOBSUB")) {
c10 = 11;
break;
}
c10 = 65535;
break;
case -356037306:
if (str3.equals("A_DTS/LOSSLESS")) {
c10 = '\f';
break;
}
c10 = 65535;
break;
case 62923557:
if (str3.equals("A_AAC")) {
c10 = '\r';
break;
}
c10 = 65535;
break;
case 62923603:
if (str3.equals("A_AC3")) {
c10 = 14;
break;
}
c10 = 65535;
break;
case 62927045:
if (str3.equals("A_DTS")) {
c10 = 15;
break;
}
c10 = 65535;
break;
case 82318131:
if (str3.equals("V_AV1")) {
c10 = 16;
break;
}
c10 = 65535;
break;
case 82338133:
if (str3.equals("V_VP8")) {
c10 = 17;
break;
}
c10 = 65535;
break;
case 82338134:
if (str3.equals("V_VP9")) {
c10 = 18;
break;
}
c10 = 65535;
break;
case 99146302:
if (str3.equals("S_HDMV/PGS")) {
c10 = 19;
break;
}
c10 = 65535;
break;
case 444813526:
if (str3.equals("V_THEORA")) {
c10 = 20;
break;
}
c10 = 65535;
break;
case 542569478:
if (str3.equals("A_DTS/EXPRESS")) {
c10 = 21;
break;
}
c10 = 65535;
break;
case 635596514:
if (str3.equals("A_PCM/FLOAT/IEEE")) {
c10 = 22;
break;
}
c10 = 65535;
break;
case 725948237:
if (str3.equals("A_PCM/INT/BIG")) {
c10 = 23;
break;
}
c10 = 65535;
break;
case 725957860:
if (str3.equals("A_PCM/INT/LIT")) {
c10 = 24;
break;
}
c10 = 65535;
break;
case 738597099:
if (str3.equals("S_TEXT/ASS")) {
c10 = 25;
break;
}
c10 = 65535;
break;
case 855502857:
if (str3.equals("V_MPEGH/ISO/HEVC")) {
c10 = 26;
break;
}
c10 = 65535;
break;
case 1045209816:
if (str3.equals("S_TEXT/WEBVTT")) {
c10 = 27;
break;
}
c10 = 65535;
break;
case 1422270023:
if (str3.equals("S_TEXT/UTF8")) {
c10 = 28;
break;
}
c10 = 65535;
break;
case 1809237540:
if (str3.equals("V_MPEG2")) {
c10 = 29;
break;
}
c10 = 65535;
break;
case 1950749482:
if (str3.equals("A_EAC3")) {
c10 = 30;
break;
}
c10 = 65535;
break;
case 1950789798:
if (str3.equals("A_FLAC")) {
c10 = 31;
break;
}
c10 = 65535;
break;
case 1951062397:
if (str3.equals("A_OPUS")) {
c10 = ' ';
break;
}
c10 = 65535;
break;
default:
c10 = 65535;
break;
}
int i17 = 4096;
String str4 = "audio/raw";
s7.c cVar = null;
switch (c10) {
case 0:
case 1:
case '\t':
byte[] bArr = this.f19644k;
if (bArr == null) {
list = null;
} else {
list = Collections.singletonList(bArr);
}
str4 = "video/mp4v-es";
str = null;
i12 = -1;
i11 = -1;
if (!(this.N == null || (a10 = d.a(new e0(this.N))) == null)) {
str = a10.f27939c;
str4 = "video/dolby-vision";
}
int i18 = (this.V ? 1 : 0) | 0;
if (this.U) {
i13 = 2;
} else {
i13 = 0;
}
int i19 = i13 | i18;
bVar = new r1.b();
if (w.o(str4)) {
bVar.J(this.O).h0(this.Q).a0(i12);
i14 = 1;
} else if (w.s(str4)) {
if (this.f19650q == 0) {
int i20 = this.f19648o;
i15 = -1;
if (i20 == -1) {
i20 = this.f19646m;
}
this.f19648o = i20;
int i21 = this.f19649p;
if (i21 == -1) {
i21 = this.f19647n;
}
this.f19649p = i21;
} else {
i15 = -1;
}
float f10 = -1.0f;
int i22 = this.f19648o;
if (!(i22 == i15 || (i16 = this.f19649p) == i15)) {
f10 = ((float) (this.f19647n * i22)) / ((float) (this.f19646m * i16));
}
if (this.f19657x) {
cVar = new s7.c(this.f19658y, this.A, this.f19659z, h());
}
if (this.f19634a != null && e.f19604i0.containsKey(this.f19634a)) {
i15 = ((Integer) e.f19604i0.get(this.f19634a)).intValue();
}
if (this.f19651r == 0 && Float.compare(this.f19652s, 0.0f) == 0 && Float.compare(this.f19653t, 0.0f) == 0) {
if (Float.compare(this.f19654u, 0.0f) == 0) {
i15 = 0;
} else if (Float.compare(this.f19653t, 90.0f) == 0) {
i15 = 90;
} else if (Float.compare(this.f19653t, -180.0f) == 0 || Float.compare(this.f19653t, 180.0f) == 0) {
i15 = 180;
} else if (Float.compare(this.f19653t, -90.0f) == 0) {
i15 = 270;
}
}
bVar.n0(this.f19646m).S(this.f19647n).c0(f10).f0(i15).d0(this.f19655v).j0(this.f19656w).L(cVar);
i14 = 2;
} else if ("application/x-subrip".equals(str4) || "text/x-ssa".equals(str4) || "text/vtt".equals(str4) || "application/vobsub".equals(str4) || "application/pgs".equals(str4) || "application/dvbsubs".equals(str4)) {
i14 = 3;
} else {
throw y2.createForMalformedContainer("Unexpected MIME type.", null);
}
if (this.f19634a != null && !e.f19604i0.containsKey(this.f19634a)) {
bVar.W(this.f19634a);
}
r1 G2 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19).V(list).K(str).O(this.f19645l).G();
b0 e10 = mVar.e(this.f19636c, i14);
this.X = e10;
e10.b(G2);
return;
case 2:
if (l(new e0(g(this.f19635b)))) {
b02 = r0.b0(this.P);
if (b02 == 0) {
s.i("MatroskaExtractor", "Unsupported PCM bit depth: " + this.P + ". Setting mimeType to " + "audio/x-unknown");
}
i12 = b02;
list = null;
str = null;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192 = i13 | i182;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192).V(list).K(str).O(this.f19645l).G();
b0 e102 = mVar.e(this.f19636c, i14);
this.X = e102;
e102.b(G22);
return;
}
s.i("MatroskaExtractor", "Non-PCM MS/ACM is unsupported. Setting mimeType to " + "audio/x-unknown");
list = null;
str = null;
str4 = "audio/x-unknown";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922 = i13 | i1822;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922).V(list).K(str).O(this.f19645l).G();
b0 e1022 = mVar.e(this.f19636c, i14);
this.X = e1022;
e1022.b(G222);
return;
case 3:
this.T = new c0();
str4 = "audio/true-hd";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222 = i13 | i18222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222).V(list).K(str).O(this.f19645l).G();
b0 e10222 = mVar.e(this.f19636c, i14);
this.X = e10222;
e10222.b(G2222);
return;
case 4:
i17 = 8192;
list = m(g(this.f19635b));
str4 = "audio/vorbis";
str = null;
i11 = i17;
i12 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222 = i13 | i182222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222).V(list).K(str).O(this.f19645l).G();
b0 e102222 = mVar.e(this.f19636c, i14);
this.X = e102222;
e102222.b(G22222);
return;
case 5:
str4 = "audio/mpeg-L2";
list = null;
str = null;
i11 = i17;
i12 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222 = i13 | i1822222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222).V(list).K(str).O(this.f19645l).G();
b0 e1022222 = mVar.e(this.f19636c, i14);
this.X = e1022222;
e1022222.b(G222222);
return;
case 6:
str4 = "audio/mpeg";
list = null;
str = null;
i11 = i17;
i12 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222 = i13 | i18222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222 = mVar.e(this.f19636c, i14);
this.X = e10222222;
e10222222.b(G2222222);
return;
case 7:
Pair<String, List<byte[]>> k10 = k(new e0(g(this.f19635b)));
str4 = (String) k10.first;
list = (List) k10.second;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222 = i13 | i182222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222 = mVar.e(this.f19636c, i14);
this.X = e102222222;
e102222222.b(G22222222);
return;
case '\b':
byte[] bArr2 = new byte[4];
System.arraycopy(g(this.f19635b), 0, bArr2, 0, 4);
list = com.google.common.collect.c0.of(bArr2);
str4 = "application/dvbsubs";
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222 = i13 | i1822222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222;
e1022222222.b(G222222222);
return;
case '\n':
s7.a b10 = s7.a.b(new e0(g(this.f19635b)));
list2 = b10.f27920a;
this.Y = b10.f27921b;
str2 = b10.f27925f;
str4 = "video/avc";
i12 = -1;
i11 = -1;
str = str2;
list = list2;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222 = i13 | i18222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222;
e10222222222.b(G2222222222);
return;
case 11:
list = com.google.common.collect.c0.of(g(this.f19635b));
str = null;
str4 = "application/vobsub";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222 = i13 | i182222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222;
e102222222222.b(G22222222222);
return;
case '\f':
str4 = "audio/vnd.dts.hd";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222 = i13 | i1822222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222;
e1022222222222.b(G222222222222);
return;
case '\r':
list = Collections.singletonList(g(this.f19635b));
a.b f11 = y5.a.f(this.f19644k);
this.Q = f11.f33016a;
this.O = f11.f33017b;
str = f11.f33018c;
str4 = "audio/mp4a-latm";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222 = i13 | i18222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222;
e10222222222222.b(G2222222222222);
return;
case 14:
str4 = "audio/ac3";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222 = i13 | i182222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222;
e102222222222222.b(G22222222222222);
return;
case 15:
case 21:
str4 = "audio/vnd.dts";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222 = i13 | i1822222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222;
e1022222222222222.b(G222222222222222);
return;
case 16:
str4 = "video/av01";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222 = i13 | i18222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222;
e10222222222222222.b(G2222222222222222);
return;
case 17:
str4 = "video/x-vnd.on2.vp8";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222 = i13 | i182222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222;
e102222222222222222.b(G22222222222222222);
return;
case 18:
str4 = "video/x-vnd.on2.vp9";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222 = i13 | i1822222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222;
e1022222222222222222.b(G222222222222222222);
return;
case 19:
list = null;
str = null;
str4 = "application/pgs";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222 = i13 | i18222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222;
e10222222222222222222.b(G2222222222222222222);
return;
case 20:
str4 = "video/x-unknown";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222 = i13 | i182222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222;
e102222222222222222222.b(G22222222222222222222);
return;
case 22:
if (this.P == 32) {
list = null;
str = null;
i12 = 4;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222222 = i13 | i1822222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222222;
e1022222222222222222222.b(G222222222222222222222);
return;
}
s.i("MatroskaExtractor", "Unsupported floating point PCM bit depth: " + this.P + ". Setting mimeType to " + "audio/x-unknown");
list = null;
str = null;
str4 = "audio/x-unknown";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222222 = i13 | i18222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222222;
e10222222222222222222222.b(G2222222222222222222222);
return;
case 23:
int i23 = this.P;
if (i23 == 8) {
list = null;
str = null;
i12 = 3;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222222 = i13 | i182222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222222;
e102222222222222222222222.b(G22222222222222222222222);
return;
} else if (i23 == 16) {
b02 = 268435456;
i12 = b02;
list = null;
str = null;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222222222 = i13 | i1822222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222222222;
e1022222222222222222222222.b(G222222222222222222222222);
return;
} else {
s.i("MatroskaExtractor", "Unsupported big endian PCM bit depth: " + this.P + ". Setting mimeType to " + "audio/x-unknown");
list = null;
str = null;
str4 = "audio/x-unknown";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222222222 = i13 | i18222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222222222;
e10222222222222222222222222.b(G2222222222222222222222222);
return;
}
case 24:
b02 = r0.b0(this.P);
if (b02 == 0) {
s.i("MatroskaExtractor", "Unsupported little endian PCM bit depth: " + this.P + ". Setting mimeType to " + "audio/x-unknown");
list = null;
str = null;
str4 = "audio/x-unknown";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222222222 = i13 | i182222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222222222;
e102222222222222222222222222.b(G22222222222222222222222222);
return;
}
i12 = b02;
list = null;
str = null;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222222222222 = i13 | i1822222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222222222222;
e1022222222222222222222222222.b(G222222222222222222222222222);
return;
case 25:
list = com.google.common.collect.c0.of(e.f19600e0, g(this.f19635b));
str = null;
str4 = "text/x-ssa";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222222222222 = i13 | i18222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222222222222;
e10222222222222222222222222222.b(G2222222222222222222222222222);
return;
case 26:
f a11 = f.a(new e0(g(this.f19635b)));
list2 = a11.f27954a;
this.Y = a11.f27955b;
str2 = a11.f27962i;
str4 = "video/hevc";
i12 = -1;
i11 = -1;
str = str2;
list = list2;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222222222222 = i13 | i182222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222222222222;
e102222222222222222222222222222.b(G22222222222222222222222222222);
return;
case 27:
list = null;
str = null;
str4 = "text/vtt";
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222222222222222 = i13 | i1822222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222222222222222;
e1022222222222222222222222222222.b(G222222222222222222222222222222);
return;
case 28:
str4 = "application/x-subrip";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222222222222222 = i13 | i18222222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222222222222222;
e10222222222222222222222222222222.b(G2222222222222222222222222222222);
return;
case 29:
str4 = "video/mpeg2";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222222222222222 = i13 | i182222222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222222222222222;
e102222222222222222222222222222222.b(G22222222222222222222222222222222);
return;
case 30:
str4 = "audio/eac3";
list = null;
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i1822222222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i1922222222222222222222222222222222 = i13 | i1822222222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i1922222222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e1022222222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e1022222222222222222222222222222222;
e1022222222222222222222222222222222.b(G222222222222222222222222222222222);
return;
case 31:
list = Collections.singletonList(g(this.f19635b));
str4 = "audio/flac";
str = null;
i12 = -1;
i11 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i18222222222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i19222222222222222222222222222222222 = i13 | i18222222222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G2222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i19222222222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e10222222222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e10222222222222222222222222222222222;
e10222222222222222222222222222222222.b(G2222222222222222222222222222222222);
return;
case ' ':
i17 = 5760;
list = new ArrayList<>(3);
list.add(g(this.f19635b));
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());
str4 = "audio/opus";
str = null;
i11 = i17;
i12 = -1;
str = a10.f27939c;
str4 = "video/dolby-vision";
int i182222222222222222222222222222222222 = (this.V ? 1 : 0) | 0;
if (this.U) {
}
int i192222222222222222222222222222222222 = i13 | i182222222222222222222222222222222222;
bVar = new r1.b();
if (w.o(str4)) {
}
bVar.W(this.f19634a);
r1 G22222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i11).X(this.W).i0(i192222222222222222222222222222222222).V(list).K(str).O(this.f19645l).G();
b0 e102222222222222222222222222222222222 = mVar.e(this.f19636c, i14);
this.X = e102222222222222222222222222222222222;
e102222222222222222222222222222222222.b(G22222222222222222222222222222222222);
return;
default:
throw y2.createForMalformedContainer("Unrecognized codec identifier.", null);
}
}
@RequiresNonNull({"output"})
public void j() {
c0 c0Var = this.T;
if (c0Var != null) {
c0Var.a(this.X, this.f19643j);
}
}
public void n() {
c0 c0Var = this.T;
if (c0Var != null) {
c0Var.b();
}
}
public final boolean o(boolean z10) {
if ("A_OPUS".equals(this.f19635b)) {
return z10;
}
if (this.f19639f > 0) {
return true;
}
return false;
}
}
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);
f19604i0 = Collections.unmodifiableMap(hashMap);
}
public e() {
this(0);
}
public static /* synthetic */ k[] A() {
return new k[]{new e()};
}
public 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);
}
public static int[] p(int[] iArr, int i10) {
if (iArr == null) {
return new int[i10];
}
if (iArr.length >= i10) {
return iArr;
}
return new int[Math.max(iArr.length * 2, i10)];
}
public static byte[] s(long j10, String str, long j11) {
boolean z10;
if (j10 != -9223372036854775807L) {
z10 = true;
} else {
z10 = false;
}
r7.a.a(z10);
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 r0.m0(String.format(Locale.US, str, Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf((int) ((j13 - (((long) i12) * 1000000)) / j11))));
}
public 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 final boolean B(y yVar, long j10) {
if (this.f19631y) {
this.A = j10;
yVar.f4818a = this.f19632z;
this.f19631y = false;
return true;
}
if (this.f19628v) {
long j11 = this.A;
if (j11 != -1) {
yVar.f4818a = j11;
this.A = -1;
return true;
}
}
return false;
}
public final void C(l lVar, int i10) throws IOException {
if (this.f19613g.g() < i10) {
if (this.f19613g.b() < i10) {
e0 e0Var = this.f19613g;
e0Var.c(Math.max(e0Var.b() * 2, i10));
}
lVar.readFully(this.f19613g.e(), this.f19613g.g(), i10 - this.f19613g.g());
this.f19613g.T(i10);
}
}
public final 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.f19606a0 = false;
this.f19616j.Q(0);
}
public final long E(long j10) throws y2 {
long j11 = this.f19624r;
if (j11 != -9223372036854775807L) {
return r0.O0(j10, j11, 1000);
}
throw y2.createForMalformedContainer("Can't scale timecode prior to timecodeScale being set.", null);
}
public void G(int i10, long j10, long j11) throws y2 {
k();
if (i10 == 160) {
this.Q = false;
this.R = 0;
} else if (i10 == 174) {
this.f19627u = new c();
} else if (i10 == 187) {
this.E = false;
} else if (i10 == 19899) {
this.f19629w = -1;
this.f19630x = -1;
} else if (i10 == 20533) {
t(i10).f19641h = true;
} else if (i10 == 21968) {
t(i10).f19657x = true;
} else if (i10 == 408125543) {
long j12 = this.f19623q;
if (j12 == -1 || j12 == j10) {
this.f19623q = j10;
this.f19622p = j11;
return;
}
throw y2.createForMalformedContainer("Multiple Segment elements not supported", null);
} else if (i10 == 475249515) {
this.C = new t();
this.D = new t();
} else if (i10 != 524531317 || this.f19628v) {
} else {
if (!this.f19610d || this.f19632z == -1) {
this.f19608b0.h(new z.b(this.f19626t));
this.f19628v = true;
return;
}
this.f19631y = true;
}
}
public void H(int i10, String str) throws y2 {
if (i10 == 134) {
t(i10).f19635b = str;
} else if (i10 != 17026) {
if (i10 == 21358) {
t(i10).f19634a = str;
} else if (i10 == 2274716) {
t(i10).W = str;
}
} else if (!"webm".equals(str) && !"matroska".equals(str)) {
throw y2.createForMalformedContainer("DocType " + str + " not supported", null);
}
}
@RequiresNonNull({"#2.output"})
public final int I(l lVar, c cVar, int i10, boolean z10) throws IOException {
boolean z11;
boolean z12;
int i11;
if ("S_TEXT/UTF8".equals(cVar.f19635b)) {
J(lVar, f19599d0, i10);
return q();
} else if ("S_TEXT/ASS".equals(cVar.f19635b)) {
J(lVar, f19601f0, i10);
return q();
} else if ("S_TEXT/WEBVTT".equals(cVar.f19635b)) {
J(lVar, f19602g0, i10);
return q();
} else {
b0 b0Var = cVar.X;
boolean z13 = true;
if (!this.V) {
if (cVar.f19641h) {
this.O &= -1073741825;
int i12 = 128;
if (!this.W) {
lVar.readFully(this.f19613g.e(), 0, 1);
this.S++;
if ((this.f19613g.e()[0] & 128) != 128) {
this.Z = this.f19613g.e()[0];
this.W = true;
} else {
throw y2.createForMalformedContainer("Extension bit is set in signal byte", null);
}
}
byte b10 = this.Z;
if ((b10 & 1) == 1) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
if ((b10 & 2) == 2) {
z12 = true;
} else {
z12 = false;
}
this.O |= 1073741824;
if (!this.f19606a0) {
lVar.readFully(this.f19618l.e(), 0, 8);
this.S += 8;
this.f19606a0 = true;
byte[] e10 = this.f19613g.e();
if (!z12) {
i12 = 0;
}
e10[0] = (byte) (i12 | 8);
this.f19613g.U(0);
b0Var.d(this.f19613g, 1, 1);
this.T++;
this.f19618l.U(0);
b0Var.d(this.f19618l, 8, 1);
this.T += 8;
}
if (z12) {
if (!this.X) {
lVar.readFully(this.f19613g.e(), 0, 1);
this.S++;
this.f19613g.U(0);
this.Y = this.f19613g.H();
this.X = true;
}
int i13 = this.Y * 4;
this.f19613g.Q(i13);
lVar.readFully(this.f19613g.e(), 0, i13);
this.S += i13;
short s10 = (short) ((this.Y / 2) + 1);
int i14 = (s10 * 6) + 2;
ByteBuffer byteBuffer = this.f19621o;
if (byteBuffer == null || byteBuffer.capacity() < i14) {
this.f19621o = ByteBuffer.allocate(i14);
}
this.f19621o.position(0);
this.f19621o.putShort(s10);
int i15 = 0;
int i16 = 0;
while (true) {
i11 = this.Y;
if (i15 >= i11) {
break;
}
int L2 = this.f19613g.L();
if (i15 % 2 == 0) {
this.f19621o.putShort((short) (L2 - i16));
} else {
this.f19621o.putInt(L2 - i16);
}
i15++;
i16 = L2;
}
int i17 = (i10 - this.S) - i16;
if (i11 % 2 == 1) {
this.f19621o.putInt(i17);
} else {
this.f19621o.putShort((short) i17);
this.f19621o.putInt(0);
}
this.f19619m.S(this.f19621o.array(), i14);
b0Var.d(this.f19619m, i14, 1);
this.T += i14;
}
}
} else {
byte[] bArr = cVar.f19642i;
if (bArr != null) {
this.f19616j.S(bArr, bArr.length);
}
}
if (cVar.o(z10)) {
this.O |= 268435456;
this.f19620n.Q(0);
int g10 = (this.f19616j.g() + i10) - this.S;
this.f19613g.Q(4);
this.f19613g.e()[0] = (byte) ((g10 >> 24) & 255);
this.f19613g.e()[1] = (byte) ((g10 >> 16) & 255);
this.f19613g.e()[2] = (byte) ((g10 >> 8) & 255);
this.f19613g.e()[3] = (byte) (g10 & 255);
b0Var.d(this.f19613g, 4, 2);
this.T += 4;
}
this.V = true;
}
int g11 = i10 + this.f19616j.g();
if (!"V_MPEG4/ISO/AVC".equals(cVar.f19635b) && !"V_MPEGH/ISO/HEVC".equals(cVar.f19635b)) {
if (cVar.T != null) {
if (this.f19616j.g() != 0) {
z13 = false;
}
r7.a.f(z13);
cVar.T.d(lVar);
}
while (true) {
int i18 = this.S;
if (i18 >= g11) {
break;
}
int K2 = K(lVar, b0Var, g11 - i18);
this.S += K2;
this.T += K2;
}
} else {
byte[] e11 = this.f19612f.e();
e11[0] = 0;
e11[1] = 0;
e11[2] = 0;
int i19 = cVar.Y;
int i20 = 4 - i19;
while (this.S < g11) {
int i21 = this.U;
if (i21 == 0) {
L(lVar, e11, i20, i19);
this.S += i19;
this.f19612f.U(0);
this.U = this.f19612f.L();
this.f19611e.U(0);
b0Var.f(this.f19611e, 4);
this.T += 4;
} else {
int K3 = K(lVar, b0Var, i21);
this.S += K3;
this.T += K3;
this.U -= K3;
}
}
}
if ("A_VORBIS".equals(cVar.f19635b)) {
this.f19614h.U(0);
b0Var.f(this.f19614h, 4);
this.T += 4;
}
return q();
}
}
public final void J(l lVar, byte[] bArr, int i10) throws IOException {
int length = bArr.length + i10;
if (this.f19617k.b() < length) {
this.f19617k.R(Arrays.copyOf(bArr, length + i10));
} else {
System.arraycopy(bArr, 0, this.f19617k.e(), 0, bArr.length);
}
lVar.readFully(this.f19617k.e(), bArr.length, i10);
this.f19617k.U(0);
this.f19617k.T(length);
}
public final int K(l lVar, b0 b0Var, int i10) throws IOException {
int a10 = this.f19616j.a();
if (a10 <= 0) {
return b0Var.a(lVar, i10, false);
}
int min = Math.min(i10, a10);
b0Var.f(this.f19616j, min);
return min;
}
public final void L(l lVar, byte[] bArr, int i10, int i11) throws IOException {
int min = Math.min(i11, this.f19616j.a());
lVar.readFully(bArr, i10 + min, i11 - min);
if (min > 0) {
this.f19616j.l(bArr, i10, min);
}
}
@Override // b6.k
public final void b(m mVar) {
this.f19608b0 = mVar;
}
@Override // b6.k
public void c(long j10, long j11) {
this.B = -9223372036854775807L;
this.G = 0;
this.f19605a.reset();
this.f19607b.e();
D();
for (int i10 = 0; i10 < this.f19609c.size(); i10++) {
this.f19609c.valueAt(i10).n();
}
}
@Override // b6.k
public final boolean e(l lVar) throws IOException {
return new f().b(lVar);
}
@Override // b6.k
public final int f(l lVar, y yVar) throws IOException {
this.F = false;
boolean z10 = true;
while (z10 && !this.F) {
z10 = this.f19605a.a(lVar);
if (z10 && B(yVar, lVar.getPosition())) {
return 1;
}
}
if (z10) {
return 0;
}
for (int i10 = 0; i10 < this.f19609c.size(); i10++) {
c valueAt = this.f19609c.valueAt(i10);
valueAt.f();
valueAt.j();
}
return -1;
}
@EnsuresNonNull({"cueTimesUs", "cueClusterPositions"})
public final void i(int i10) throws y2 {
if (this.C == null || this.D == null) {
throw y2.createForMalformedContainer("Element " + i10 + " must be in a Cues", null);
}
}
@EnsuresNonNull({"currentTrack"})
public final void j(int i10) throws y2 {
if (this.f19627u == null) {
throw y2.createForMalformedContainer("Element " + i10 + " must be in a TrackEntry", null);
}
}
@EnsuresNonNull({"extractorOutput"})
public final void k() {
r7.a.h(this.f19608b0);
}
public void l(int i10, int i11, l lVar) throws IOException {
c cVar;
int i12;
c cVar2;
c cVar3;
long j10;
long j11;
int i13;
int i14;
int i15;
int i16 = 0;
int i17 = 1;
if (i10 == 161 || i10 == 163) {
if (this.G == 0) {
this.M = (int) this.f19607b.d(lVar, false, true, 8);
this.N = this.f19607b.b();
this.I = -9223372036854775807L;
this.G = 1;
this.f19613g.Q(0);
}
c cVar4 = this.f19609c.get(this.M);
if (cVar4 == null) {
lVar.k(i11 - this.N);
this.G = 0;
return;
}
cVar4.f();
if (this.G == 1) {
C(lVar, 3);
int i18 = (this.f19613g.e()[2] & 6) >> 1;
byte b10 = 255;
if (i18 == 0) {
this.K = 1;
int[] p10 = p(this.L, 1);
this.L = p10;
p10[0] = (i11 - this.N) - 3;
} else {
int i19 = 4;
C(lVar, 4);
int i20 = (this.f19613g.e()[3] & 255) + 1;
this.K = i20;
int[] p11 = p(this.L, i20);
this.L = p11;
if (i18 == 2) {
int i21 = this.K;
Arrays.fill(p11, 0, i21, ((i11 - this.N) - 4) / i21);
} else if (i18 == 1) {
int i22 = 0;
int i23 = 0;
while (true) {
i13 = this.K;
if (i22 >= i13 - 1) {
break;
}
this.L[i22] = 0;
do {
i19++;
C(lVar, i19);
i14 = this.f19613g.e()[i19 - 1] & 255;
int[] iArr = this.L;
i15 = iArr[i22] + i14;
iArr[i22] = i15;
} while (i14 == 255);
i23 += i15;
i22++;
}
this.L[i13 - 1] = ((i11 - this.N) - i19) - i23;
} else if (i18 == 3) {
int i24 = 0;
int i25 = 0;
while (true) {
int i26 = this.K;
if (i24 >= i26 - 1) {
cVar2 = cVar4;
this.L[i26 - 1] = ((i11 - this.N) - i19) - i25;
break;
}
this.L[i24] = i16;
i19++;
C(lVar, i19);
int i27 = i19 - 1;
if (this.f19613g.e()[i27] != 0) {
int i28 = i16;
while (true) {
if (i28 >= 8) {
cVar3 = cVar4;
j10 = 0;
break;
}
int i29 = i17 << (7 - i28);
if ((this.f19613g.e()[i27] & i29) != 0) {
int i30 = i19 + i28;
C(lVar, i30);
cVar3 = cVar4;
long j12 = (long) ((~i29) & this.f19613g.e()[i27] & b10);
int i31 = i27 + 1;
while (true) {
j11 = j12;
if (i31 >= i30) {
break;
}
j12 = (j11 << 8) | ((long) (this.f19613g.e()[i31] & b10));
i31++;
i30 = i30;
b10 = 255;
}
if (i24 > 0) {
j11 -= (1 << ((i28 * 7) + 6)) - 1;
}
j10 = j11;
i19 = i30;
} else {
i28++;
i17 = 1;
b10 = 255;
}
}
if (j10 >= -2147483648L && j10 <= 2147483647L) {
int i32 = (int) j10;
int[] iArr2 = this.L;
if (i24 != 0) {
i32 += iArr2[i24 - 1];
}
iArr2[i24] = i32;
i25 += i32;
i24++;
cVar4 = cVar3;
i16 = 0;
i17 = 1;
b10 = 255;
}
} else {
throw y2.createForMalformedContainer("No valid varint length mask found", null);
}
}
throw y2.createForMalformedContainer("EBML lacing sample size out of range.", null);
} else {
throw y2.createForMalformedContainer("Unexpected lacing value: " + i18, null);
}
}
cVar2 = cVar4;
this.H = this.B + E((long) ((this.f19613g.e()[0] << 8) | (this.f19613g.e()[1] & 255)));
cVar = cVar2;
this.O = (cVar.f19637d == 2 || (i10 == 163 && (this.f19613g.e()[2] & 128) == 128)) ? 1 : 0;
this.G = 2;
this.J = 0;
i12 = 163;
} else {
cVar = cVar4;
i12 = 163;
}
if (i10 == i12) {
while (true) {
int i33 = this.J;
if (i33 < this.K) {
n(cVar, ((long) ((this.J * cVar.f19638e) / 1000)) + this.H, this.O, I(lVar, cVar, this.L[i33], false), 0);
this.J++;
} else {
this.G = 0;
return;
}
}
} else {
while (true) {
int i34 = this.J;
if (i34 < this.K) {
int[] iArr3 = this.L;
iArr3[i34] = I(lVar, cVar, iArr3[i34], 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.f19627u.f19642i = bArr;
lVar.readFully(bArr, 0, i11);
} else if (i10 == 18402) {
byte[] bArr2 = new byte[i11];
lVar.readFully(bArr2, 0, i11);
t(i10).f19643j = new b0.a(1, bArr2, 0, 0);
} else if (i10 == 21419) {
Arrays.fill(this.f19615i.e(), (byte) 0);
lVar.readFully(this.f19615i.e(), 4 - i11, i11);
this.f19615i.U(0);
this.f19629w = (int) this.f19615i.J();
} else if (i10 == 25506) {
j(i10);
byte[] bArr3 = new byte[i11];
this.f19627u.f19644k = bArr3;
lVar.readFully(bArr3, 0, i11);
} else if (i10 == 30322) {
j(i10);
byte[] bArr4 = new byte[i11];
this.f19627u.f19655v = bArr4;
lVar.readFully(bArr4, 0, i11);
} else {
throw y2.createForMalformedContainer("Unexpected id: " + i10, null);
}
} else if (this.G == 2) {
w(this.f19609c.get(this.M), this.P, lVar, i11);
}
}
public final z m(t tVar, t tVar2) {
int i10;
if (this.f19623q == -1 || this.f19626t == -9223372036854775807L || tVar == null || tVar.c() == 0 || tVar2 == null || tVar2.c() != tVar.c()) {
return new z.b(this.f19626t);
}
int c10 = tVar.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] = tVar.b(i12);
jArr[i12] = this.f19623q + tVar2.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.f19623q + this.f19622p) - jArr[i10]);
long j10 = this.f19626t - jArr3[i10];
jArr2[i10] = j10;
if (j10 <= 0) {
s.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 b6.c(iArr, jArr, jArr2, jArr3);
}
@RequiresNonNull({"#1.output"})
public final void n(c cVar, long j10, int i10, int i11, int i12) {
c0 c0Var = cVar.T;
if (c0Var != null) {
c0Var.c(cVar.X, j10, i10, i11, i12, cVar.f19643j);
} else {
if ("S_TEXT/UTF8".equals(cVar.f19635b) || "S_TEXT/ASS".equals(cVar.f19635b) || "S_TEXT/WEBVTT".equals(cVar.f19635b)) {
if (this.K > 1) {
s.i("MatroskaExtractor", "Skipping subtitle sample in laced block.");
} else {
long j11 = this.I;
if (j11 == -9223372036854775807L) {
s.i("MatroskaExtractor", "Skipping subtitle sample with no duration.");
} else {
F(cVar.f19635b, j11, this.f19617k.e());
int f10 = this.f19617k.f();
while (true) {
if (f10 >= this.f19617k.g()) {
break;
} else if (this.f19617k.e()[f10] == 0) {
this.f19617k.T(f10);
break;
} else {
f10++;
}
}
b0 b0Var = cVar.X;
e0 e0Var = this.f19617k;
b0Var.f(e0Var, e0Var.g());
i11 += this.f19617k.g();
}
}
}
if ((268435456 & i10) != 0) {
if (this.K > 1) {
this.f19620n.Q(0);
} else {
int g10 = this.f19620n.g();
cVar.X.d(this.f19620n, g10, 2);
i11 += g10;
}
}
cVar.X.c(j10, i10, i11, i12, cVar.f19643j);
}
this.F = true;
}
public void o(int i10) throws y2 {
k();
if (i10 != 160) {
if (i10 == 174) {
c cVar = (c) r7.a.h(this.f19627u);
String str = cVar.f19635b;
if (str != null) {
if (y(str)) {
cVar.i(this.f19608b0, cVar.f19636c);
this.f19609c.put(cVar.f19636c, cVar);
}
this.f19627u = null;
return;
}
throw y2.createForMalformedContainer("CodecId is missing in TrackEntry element", null);
} else if (i10 == 19899) {
int i11 = this.f19629w;
if (i11 != -1) {
long j10 = this.f19630x;
if (j10 != -1) {
if (i11 == 475249515) {
this.f19632z = j10;
return;
}
return;
}
}
throw y2.createForMalformedContainer("Mandatory element SeekID or SeekPosition not found", null);
} else if (i10 == 25152) {
j(i10);
c cVar2 = this.f19627u;
if (!cVar2.f19641h) {
return;
}
if (cVar2.f19643j != null) {
cVar2.f19645l = new DrmInitData(new DrmInitData.SchemeData(j.f30652a, "video/webm", this.f19627u.f19643j.f4713b));
return;
}
throw y2.createForMalformedContainer("Encrypted Track found but ContentEncKeyID was not found", null);
} else if (i10 == 28032) {
j(i10);
c cVar3 = this.f19627u;
if (cVar3.f19641h && cVar3.f19642i != null) {
throw y2.createForMalformedContainer("Combining encryption and compression is not supported", null);
}
} else if (i10 == 357149030) {
if (this.f19624r == -9223372036854775807L) {
this.f19624r = 1000000;
}
long j11 = this.f19625s;
if (j11 != -9223372036854775807L) {
this.f19626t = E(j11);
}
} else if (i10 != 374648427) {
if (i10 == 475249515) {
if (!this.f19628v) {
this.f19608b0.h(m(this.C, this.D));
this.f19628v = true;
}
this.C = null;
this.D = null;
}
} else if (this.f19609c.size() != 0) {
this.f19608b0.q();
} else {
throw y2.createForMalformedContainer("No valid tracks were found", null);
}
} else if (this.G == 2) {
c cVar4 = this.f19609c.get(this.M);
cVar4.f();
if (this.R > 0 && "A_OPUS".equals(cVar4.f19635b)) {
this.f19620n.R(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.f19638e * 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 final int q() {
int i10 = this.T;
D();
return i10;
}
public void r(int i10, double d10) throws y2 {
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).f19652s = (float) d10;
return;
case 30324:
t(i10).f19653t = (float) d10;
return;
case 30325:
t(i10).f19654u = (float) d10;
return;
default:
return;
}
}
} else {
this.f19625s = (long) d10;
}
}
@Override // b6.k
public final void release() {
}
public c t(int i10) throws y2 {
j(i10);
return this.f19627u;
}
public int u(int i10) {
switch (i10) {
case TbsListener.ErrorCode.DOWNLOAD_USER_CANCEL:
case 136:
case TbsListener.ErrorCode.NO_NEED_STARTDOWNLOAD:
case 159:
case 176:
case 179:
case 186:
case TbsListener.ErrorCode.COPY_EXCEPTION:
case TbsListener.ErrorCode.RENAME_FAIL:
case TbsListener.ErrorCode.TPATCH_FAIL:
case TbsListener.ErrorCode.TPATCH_BACKUP_NOT_VALID:
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 TbsListener.ErrorCode.DOWNLOAD_USER_PAUSE:
case 17026:
case 21358:
case 2274716:
return 3;
case 160:
case 166:
case 174:
case 183:
case 187:
case TbsListener.ErrorCode.EXCEED_INCR_UPDATE:
case TbsListener.ErrorCode.CREATE_TEMP_CONF_ERROR:
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) throws IOException {
if (cVar.f19640g == 1685485123 || cVar.f19640g == 1685480259) {
byte[] bArr = new byte[i10];
cVar.N = bArr;
lVar.readFully(bArr, 0, i10);
return;
}
lVar.k(i10);
}
public void w(c cVar, int i10, l lVar, int i11) throws IOException {
if (i10 != 4 || !"V_VP9".equals(cVar.f19635b)) {
lVar.k(i11);
return;
}
this.f19620n.Q(i11);
lVar.readFully(this.f19620n.e(), 0, i11);
}
public void x(int i10, long j10) throws y2 {
if (i10 != 20529) {
if (i10 != 20530) {
boolean z10 = false;
switch (i10) {
case TbsListener.ErrorCode.DOWNLOAD_USER_CANCEL:
t(i10).f19637d = (int) j10;
return;
case 136:
c t10 = t(i10);
if (j10 == 1) {
z10 = true;
}
t10.V = z10;
return;
case TbsListener.ErrorCode.NO_NEED_STARTDOWNLOAD:
this.I = E(j10);
return;
case 159:
t(i10).O = (int) j10;
return;
case 176:
t(i10).f19646m = (int) j10;
return;
case 179:
i(i10);
this.C.a(E(j10));
return;
case 186:
t(i10).f19647n = (int) j10;
return;
case TbsListener.ErrorCode.COPY_EXCEPTION:
t(i10).f19636c = (int) j10;
return;
case TbsListener.ErrorCode.RENAME_FAIL:
this.B = E(j10);
return;
case TbsListener.ErrorCode.TPATCH_FAIL:
this.P = (int) j10;
return;
case TbsListener.ErrorCode.TPATCH_BACKUP_NOT_VALID:
if (!this.E) {
i(i10);
this.D.a(j10);
this.E = true;
return;
}
return;
case 251:
this.Q = true;
return;
case 16871:
t(i10).f19640g = (int) j10;
return;
case 16980:
if (j10 != 3) {
throw y2.createForMalformedContainer("ContentCompAlgo " + j10 + " not supported", null);
}
return;
case 17029:
if (j10 < 1 || j10 > 2) {
throw y2.createForMalformedContainer("DocTypeReadVersion " + j10 + " not supported", null);
}
return;
case 17143:
if (j10 != 1) {
throw y2.createForMalformedContainer("EBMLReadVersion " + j10 + " not supported", null);
}
return;
case 18401:
if (j10 != 5) {
throw y2.createForMalformedContainer("ContentEncAlgo " + j10 + " not supported", null);
}
return;
case 18408:
if (j10 != 1) {
throw y2.createForMalformedContainer("AESSettingsCipherMode " + j10 + " not supported", null);
}
return;
case 21420:
this.f19630x = j10 + this.f19623q;
return;
case 21432:
int i11 = (int) j10;
j(i10);
if (i11 == 0) {
this.f19627u.f19656w = 0;
return;
} else if (i11 == 1) {
this.f19627u.f19656w = 2;
return;
} else if (i11 == 3) {
this.f19627u.f19656w = 1;
return;
} else if (i11 == 15) {
this.f19627u.f19656w = 3;
return;
} else {
return;
}
case 21680:
t(i10).f19648o = (int) j10;
return;
case 21682:
t(i10).f19650q = (int) j10;
return;
case 21690:
t(i10).f19649p = (int) j10;
return;
case 21930:
c t11 = t(i10);
if (j10 == 1) {
z10 = true;
}
t11.U = z10;
return;
case 21998:
t(i10).f19639f = (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.f19627u.f19651r = 0;
return;
} else if (i12 == 1) {
this.f19627u.f19651r = 1;
return;
} else if (i12 == 2) {
this.f19627u.f19651r = 2;
return;
} else if (i12 == 3) {
this.f19627u.f19651r = 3;
return;
} else {
return;
}
case 2352003:
t(i10).f19638e = (int) j10;
return;
case 2807729:
this.f19624r = j10;
return;
default:
switch (i10) {
case 21945:
j(i10);
int i13 = (int) j10;
if (i13 == 1) {
this.f19627u.A = 2;
return;
} else if (i13 == 2) {
this.f19627u.A = 1;
return;
} else {
return;
}
case 21946:
j(i10);
int c10 = s7.c.c((int) j10);
if (c10 != -1) {
this.f19627u.f19659z = c10;
return;
}
return;
case 21947:
j(i10);
this.f19627u.f19657x = true;
int b10 = s7.c.b((int) j10);
if (b10 != -1) {
this.f19627u.f19658y = 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 y2.createForMalformedContainer("ContentEncodingScope " + j10 + " not supported", null);
}
} else if (j10 != 0) {
throw y2.createForMalformedContainer("ContentEncodingOrder " + j10 + " not supported", null);
}
}
public boolean z(int i10) {
return i10 == 357149030 || i10 == 524531317 || i10 == 475249515 || i10 == 374648427;
}
public e(int i10) {
this(new a(), i10);
}
public e(c cVar, int i10) {
this.f19623q = -1;
this.f19624r = -9223372036854775807L;
this.f19625s = -9223372036854775807L;
this.f19626t = -9223372036854775807L;
this.f19632z = -1;
this.A = -1;
this.B = -9223372036854775807L;
this.f19605a = cVar;
cVar.b(new b());
this.f19610d = (i10 & 1) == 0;
this.f19607b = new g();
this.f19609c = new SparseArray<>();
this.f19613g = new e0(4);
this.f19614h = new e0(ByteBuffer.allocate(4).putInt(-1).array());
this.f19615i = new e0(4);
this.f19611e = new e0(x.f27519a);
this.f19612f = new e0(4);
this.f19616j = new e0();
this.f19617k = new e0();
this.f19618l = new e0(8);
this.f19619m = new e0();
this.f19620n = new e0();
this.L = new int[1];
}
}
(责任编辑:)
|