Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 d.java 源代码,内容仅作参考
package com.applovin.exoplayer2.e.e;
import android.net.Uri;
import android.util.Pair;
import android.util.SparseArray;
import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;
import com.applovin.exoplayer2.b.a;
import com.applovin.exoplayer2.common.a.s;
import com.applovin.exoplayer2.d.e;
import com.applovin.exoplayer2.e.c0;
import com.applovin.exoplayer2.e.h;
import com.applovin.exoplayer2.e.i;
import com.applovin.exoplayer2.e.j;
import com.applovin.exoplayer2.e.l;
import com.applovin.exoplayer2.e.v;
import com.applovin.exoplayer2.e.x;
import com.applovin.exoplayer2.l.ai;
import com.applovin.exoplayer2.l.q;
import com.applovin.exoplayer2.l.r;
import com.applovin.exoplayer2.l.u;
import com.applovin.exoplayer2.l.y;
import com.applovin.exoplayer2.v;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.TsExtractor;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import com.startapp.b4;
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;
public class d implements h {
public static final l f26560a = new l() {
@Override
public h[] a(Uri uri, Map map) {
return c0.a(this, uri, map);
}
@Override
public final h[] createExtractors() {
h[] h11;
h11 = d.h();
return h11;
}
};
private static final byte[] f26561b = {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};
private static final byte[] f26562c = ai.c("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
private static final byte[] f26563d = {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};
private static final UUID f26564e = new UUID(72057594037932032L, -9223371306706625679L);
private static final Map<String, Integer> f26565f;
@Nullable
private b A;
private boolean B;
private int C;
private long D;
private boolean E;
private long F;
private long G;
private long H;
@Nullable
private r I;
@Nullable
private r J;
private boolean K;
private boolean L;
private int M;
private long N;
private long O;
private int P;
private int Q;
private int[] R;
private int S;
private int T;
private int U;
private int V;
private boolean W;
private int X;
private int Y;
private int Z;
private boolean f26566aa;
private boolean f26567ab;
private boolean f26568ac;
private int f26569ad;
private byte f26570ae;
private boolean f26571af;
private j f26572ag;
private final com.applovin.exoplayer2.e.e.c f26573g;
private final f f26574h;
private final SparseArray<b> f26575i;
private final boolean f26576j;
private final y f26577k;
private final y f26578l;
private final y f26579m;
private final y f26580n;
private final y f26581o;
private final y f26582p;
private final y f26583q;
private final y f26584r;
private final y f26585s;
private final y f26586t;
private ByteBuffer f26587u;
private long f26588v;
private long f26589w;
private long f26590x;
private long f26591y;
private long f26592z;
public final class a implements com.applovin.exoplayer2.e.e.b {
private a() {
}
@Override
public int a(int i11) {
return d.this.a(i11);
}
@Override
public boolean b(int i11) {
return d.this.b(i11);
}
@Override
public void c(int i11) throws com.applovin.exoplayer2.ai {
d.this.c(i11);
}
@Override
public void a(int i11, long j11, long j12) throws com.applovin.exoplayer2.ai {
d.this.a(i11, j11, j12);
}
@Override
public void a(int i11, long j11) throws com.applovin.exoplayer2.ai {
d.this.a(i11, j11);
}
@Override
public void a(int i11, double d11) throws com.applovin.exoplayer2.ai {
d.this.a(i11, d11);
}
@Override
public void a(int i11, String str) throws com.applovin.exoplayer2.ai {
d.this.a(i11, str);
}
@Override
public void a(int i11, int i12, i iVar) throws IOException {
d.this.a(i11, i12, iVar);
}
}
public static final class b {
public int A;
public int B;
public float C;
public float D;
public float E;
public float F;
public float G;
public float H;
public float I;
public float J;
public float K;
public float L;
public byte[] M;
public int N;
public int O;
public int P;
public long Q;
public long R;
public c S;
public boolean T;
public boolean U;
public x V;
public int W;
private int X;
private String Y;
public String f26594a;
public String f26595b;
public int f26596c;
public int f26597d;
public int f26598e;
public int f26599f;
public boolean f26600g;
public byte[] f26601h;
public x.a f26602i;
public byte[] f26603j;
public com.applovin.exoplayer2.d.e f26604k;
public int f26605l;
public int f26606m;
public int f26607n;
public int f26608o;
public int f26609p;
public int f26610q;
public float f26611r;
public float f26612s;
public float f26613t;
public byte[] f26614u;
public int f26615v;
public boolean f26616w;
public int f26617x;
public int f26618y;
public int f26619z;
private b() {
this.f26605l = -1;
this.f26606m = -1;
this.f26607n = -1;
this.f26608o = -1;
this.f26609p = 0;
this.f26610q = -1;
this.f26611r = 0.0f;
this.f26612s = 0.0f;
this.f26613t = 0.0f;
this.f26614u = null;
this.f26615v = -1;
this.f26616w = false;
this.f26617x = -1;
this.f26618y = -1;
this.f26619z = -1;
this.A = 1000;
this.B = 200;
this.C = -1.0f;
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.N = 1;
this.O = -1;
this.P = 8000;
this.Q = 0L;
this.R = 0L;
this.U = true;
this.Y = "eng";
}
@Nullable
private byte[] c() {
if (this.C != -1.0f && 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) {
byte[] bArr = new byte[25];
ByteBuffer order = ByteBuffer.wrap(bArr).order(ByteOrder.LITTLE_ENDIAN);
order.put((byte) 0);
order.putShort((short) ((this.C * 50000.0f) + 0.5f));
order.putShort((short) ((this.D * 50000.0f) + 0.5f));
order.putShort((short) ((this.E * 50000.0f) + 0.5f));
order.putShort((short) ((this.F * 50000.0f) + 0.5f));
order.putShort((short) ((this.G * 50000.0f) + 0.5f));
order.putShort((short) ((this.H * 50000.0f) + 0.5f));
order.putShort((short) ((this.I * 50000.0f) + 0.5f));
order.putShort((short) ((this.J * 50000.0f) + 0.5f));
order.putShort((short) (this.K + 0.5f));
order.putShort((short) (this.L + 0.5f));
order.putShort((short) this.A);
order.putShort((short) this.B);
return bArr;
}
return null;
}
public void d() {
com.applovin.exoplayer2.l.a.b(this.V);
}
public void b() {
c cVar = this.S;
if (cVar != null) {
cVar.a();
}
}
private static boolean b(y yVar) throws com.applovin.exoplayer2.ai {
try {
int j11 = yVar.j();
if (j11 == 1) {
return true;
}
if (j11 != 65534) {
return false;
}
yVar.d(24);
if (yVar.s() == d.f26564e.getMostSignificantBits()) {
if (yVar.s() == d.f26564e.getLeastSignificantBits()) {
return true;
}
}
return false;
} catch (ArrayIndexOutOfBoundsException unused) {
throw com.applovin.exoplayer2.ai.b("Error parsing MS/ACM codec private", null);
}
}
public void a(j jVar, int i11) throws com.applovin.exoplayer2.ai {
char c11;
String str;
List<byte[]> singletonList;
int i12;
String str2;
List<byte[]> list;
String str3;
byte[] bArr;
String str4;
v.a aVar;
int i13;
int i14;
com.applovin.exoplayer2.m.c a11;
String str5 = this.f26595b;
str5.hashCode();
int i15 = 4;
int i16 = 3;
int i17 = 0;
switch (str5.hashCode()) {
case -2095576542:
if (str5.equals("V_MPEG4/ISO/AP")) {
c11 = 0;
break;
}
c11 = 65535;
break;
case -2095575984:
if (str5.equals("V_MPEG4/ISO/SP")) {
c11 = 1;
break;
}
c11 = 65535;
break;
case -1985379776:
if (str5.equals("A_MS/ACM")) {
c11 = 2;
break;
}
c11 = 65535;
break;
case -1784763192:
if (str5.equals("A_TRUEHD")) {
c11 = 3;
break;
}
c11 = 65535;
break;
case -1730367663:
if (str5.equals("A_VORBIS")) {
c11 = 4;
break;
}
c11 = 65535;
break;
case -1482641358:
if (str5.equals("A_MPEG/L2")) {
c11 = 5;
break;
}
c11 = 65535;
break;
case -1482641357:
if (str5.equals("A_MPEG/L3")) {
c11 = 6;
break;
}
c11 = 65535;
break;
case -1373388978:
if (str5.equals("V_MS/VFW/FOURCC")) {
c11 = 7;
break;
}
c11 = 65535;
break;
case -933872740:
if (str5.equals("S_DVBSUB")) {
c11 = '\b';
break;
}
c11 = 65535;
break;
case -538363189:
if (str5.equals("V_MPEG4/ISO/ASP")) {
c11 = '\t';
break;
}
c11 = 65535;
break;
case -538363109:
if (str5.equals("V_MPEG4/ISO/AVC")) {
c11 = '\n';
break;
}
c11 = 65535;
break;
case -425012669:
if (str5.equals("S_VOBSUB")) {
c11 = 11;
break;
}
c11 = 65535;
break;
case -356037306:
if (str5.equals("A_DTS/LOSSLESS")) {
c11 = '\f';
break;
}
c11 = 65535;
break;
case 62923557:
if (str5.equals("A_AAC")) {
c11 = '\r';
break;
}
c11 = 65535;
break;
case 62923603:
if (str5.equals("A_AC3")) {
c11 = 14;
break;
}
c11 = 65535;
break;
case 62927045:
if (str5.equals("A_DTS")) {
c11 = 15;
break;
}
c11 = 65535;
break;
case 82318131:
if (str5.equals("V_AV1")) {
c11 = 16;
break;
}
c11 = 65535;
break;
case 82338133:
if (str5.equals("V_VP8")) {
c11 = 17;
break;
}
c11 = 65535;
break;
case 82338134:
if (str5.equals("V_VP9")) {
c11 = 18;
break;
}
c11 = 65535;
break;
case 99146302:
if (str5.equals("S_HDMV/PGS")) {
c11 = 19;
break;
}
c11 = 65535;
break;
case 444813526:
if (str5.equals("V_THEORA")) {
c11 = 20;
break;
}
c11 = 65535;
break;
case 542569478:
if (str5.equals("A_DTS/EXPRESS")) {
c11 = 21;
break;
}
c11 = 65535;
break;
case 635596514:
if (str5.equals("A_PCM/FLOAT/IEEE")) {
c11 = 22;
break;
}
c11 = 65535;
break;
case 725948237:
if (str5.equals("A_PCM/INT/BIG")) {
c11 = 23;
break;
}
c11 = 65535;
break;
case 725957860:
if (str5.equals("A_PCM/INT/LIT")) {
c11 = 24;
break;
}
c11 = 65535;
break;
case 738597099:
if (str5.equals("S_TEXT/ASS")) {
c11 = 25;
break;
}
c11 = 65535;
break;
case 855502857:
if (str5.equals("V_MPEGH/ISO/HEVC")) {
c11 = 26;
break;
}
c11 = 65535;
break;
case 1422270023:
if (str5.equals("S_TEXT/UTF8")) {
c11 = 27;
break;
}
c11 = 65535;
break;
case 1809237540:
if (str5.equals("V_MPEG2")) {
c11 = 28;
break;
}
c11 = 65535;
break;
case 1950749482:
if (str5.equals("A_EAC3")) {
c11 = 29;
break;
}
c11 = 65535;
break;
case 1950789798:
if (str5.equals("A_FLAC")) {
c11 = 30;
break;
}
c11 = 65535;
break;
case 1951062397:
if (str5.equals("A_OPUS")) {
c11 = 31;
break;
}
c11 = 65535;
break;
default:
c11 = 65535;
break;
}
String str6 = MimeTypes.AUDIO_RAW;
switch (c11) {
case 0:
case 1:
case '\t':
str = MimeTypes.APPLICATION_PGS;
byte[] bArr2 = this.f26603j;
singletonList = bArr2 == null ? null : Collections.singletonList(bArr2);
str6 = MimeTypes.VIDEO_MP4V;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null && (a11 = com.applovin.exoplayer2.m.c.a(new y(bArr))) != null) {
str2 = a11.f29003c;
str6 = "video/dolby-vision";
}
str4 = str6;
int i18 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
aVar.k(this.N).l(this.P).m(i15);
i16 = 1;
} else if (u.b(str4)) {
if (this.f26609p == 0) {
int i19 = this.f26607n;
i13 = -1;
if (i19 == -1) {
i19 = this.f26605l;
}
this.f26607n = i19;
int i21 = this.f26608o;
if (i21 == -1) {
i21 = this.f26606m;
}
this.f26608o = i21;
} else {
i13 = -1;
}
float f11 = (this.f26607n == i13 || (i14 = this.f26608o) == i13) ? -1.0f : (this.f26606m * r2) / (this.f26605l * i14);
com.applovin.exoplayer2.m.b bVar = this.f26616w ? new com.applovin.exoplayer2.m.b(this.f26617x, this.f26619z, this.f26618y, c()) : null;
if (this.f26594a != null && d.f26565f.containsKey(this.f26594a)) {
i13 = ((Integer) d.f26565f.get(this.f26594a)).intValue();
}
if (this.f26610q == 0 && Float.compare(this.f26611r, 0.0f) == 0 && Float.compare(this.f26612s, 0.0f) == 0) {
if (Float.compare(this.f26613t, 0.0f) != 0) {
if (Float.compare(this.f26612s, 90.0f) == 0) {
i17 = 90;
} else if (Float.compare(this.f26612s, -180.0f) == 0 || Float.compare(this.f26612s, 180.0f) == 0) {
i17 = 180;
} else if (Float.compare(this.f26612s, -90.0f) == 0) {
i17 = 270;
}
}
aVar.g(this.f26605l).h(this.f26606m).b(f11).i(i17).a(this.f26614u).j(this.f26615v).a(bVar);
i16 = 2;
}
i17 = i13;
aVar.g(this.f26605l).h(this.f26606m).b(f11).i(i17).a(this.f26614u).j(this.f26615v).a(bVar);
i16 = 2;
} else if (!MimeTypes.APPLICATION_SUBRIP.equals(str4) && !MimeTypes.TEXT_SSA.equals(str4) && !MimeTypes.APPLICATION_VOBSUB.equals(str4) && !str.equals(str4) && !MimeTypes.APPLICATION_DVBSUBS.equals(str4)) {
throw com.applovin.exoplayer2.ai.b("Unexpected MIME type.", null);
}
if (this.f26594a != null && !d.f26565f.containsKey(this.f26594a)) {
aVar.b(this.f26594a);
}
v a12 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18).a(singletonList).d(str2).a(this.f26604k).a();
x a13 = jVar.a(this.f26596c, i16);
this.V = a13;
a13.a(a12);
return;
case 2:
str = MimeTypes.APPLICATION_PGS;
if (b(new y(a(this.f26595b)))) {
i15 = ai.c(this.O);
if (i15 == 0) {
q.c("MatroskaExtractor", "Unsupported PCM bit depth: " + this.O + ". Setting mimeType to " + MimeTypes.AUDIO_UNKNOWN);
}
singletonList = null;
str2 = null;
i12 = -1;
bArr = this.M;
if (bArr != null) {
str2 = a11.f29003c;
str6 = "video/dolby-vision";
break;
}
str4 = str6;
int i182 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
aVar.b(this.f26594a);
break;
}
v a122 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182).a(singletonList).d(str2).a(this.f26604k).a();
x a132 = jVar.a(this.f26596c, i16);
this.V = a132;
a132.a(a122);
return;
}
q.c("MatroskaExtractor", "Non-PCM MS/ACM is unsupported. Setting mimeType to " + MimeTypes.AUDIO_UNKNOWN);
str6 = MimeTypes.AUDIO_UNKNOWN;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822).a(singletonList).d(str2).a(this.f26604k).a();
x a1322 = jVar.a(this.f26596c, i16);
this.V = a1322;
a1322.a(a1222);
return;
case 3:
str = MimeTypes.APPLICATION_PGS;
this.S = new c();
str6 = MimeTypes.AUDIO_TRUEHD;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222 = jVar.a(this.f26596c, i16);
this.V = a13222;
a13222.a(a12222);
return;
case 4:
str = MimeTypes.APPLICATION_PGS;
singletonList = a(a(this.f26595b));
str6 = MimeTypes.AUDIO_VORBIS;
i12 = 8192;
str2 = null;
i15 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222 = jVar.a(this.f26596c, i16);
this.V = a132222;
a132222.a(a122222);
return;
case 5:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_MPEG_L2;
singletonList = null;
str2 = null;
i15 = -1;
i12 = 4096;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222 = jVar.a(this.f26596c, i16);
this.V = a1322222;
a1322222.a(a1222222);
return;
case 6:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_MPEG;
singletonList = null;
str2 = null;
i15 = -1;
i12 = 4096;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222 = jVar.a(this.f26596c, i16);
this.V = a13222222;
a13222222.a(a12222222);
return;
case 7:
str = MimeTypes.APPLICATION_PGS;
Pair<String, List<byte[]>> a14 = a(new y(a(this.f26595b)));
str6 = (String) a14.first;
singletonList = (List) a14.second;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222 = jVar.a(this.f26596c, i16);
this.V = a132222222;
a132222222.a(a122222222);
return;
case '\b':
str = MimeTypes.APPLICATION_PGS;
byte[] bArr3 = new byte[4];
System.arraycopy(a(this.f26595b), 0, bArr3, 0, 4);
singletonList = s.a(bArr3);
str6 = MimeTypes.APPLICATION_DVBSUBS;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222;
a1322222222.a(a1222222222);
return;
case '\n':
str = MimeTypes.APPLICATION_PGS;
com.applovin.exoplayer2.m.a a15 = com.applovin.exoplayer2.m.a.a(new y(a(this.f26595b)));
list = a15.f28934a;
this.W = a15.f28935b;
str3 = a15.f28939f;
str6 = "video/avc";
i15 = -1;
i12 = -1;
List<byte[]> list2 = list;
str2 = str3;
singletonList = list2;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222;
a13222222222.a(a12222222222);
return;
case 11:
str = MimeTypes.APPLICATION_PGS;
singletonList = s.a(a(this.f26595b));
str6 = MimeTypes.APPLICATION_VOBSUB;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222;
a132222222222.a(a122222222222);
return;
case '\f':
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_DTS_HD;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222;
a1322222222222.a(a1222222222222);
return;
case '\r':
str = MimeTypes.APPLICATION_PGS;
singletonList = Collections.singletonList(a(this.f26595b));
a.C0487a a16 = com.applovin.exoplayer2.b.a.a(this.f26603j);
this.P = a16.f25612a;
this.N = a16.f25613b;
str2 = a16.f25614c;
str6 = MimeTypes.AUDIO_AAC;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222;
a13222222222222.a(a12222222222222);
return;
case 14:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_AC3;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222;
a132222222222222.a(a122222222222222);
return;
case 15:
case 21:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_DTS;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222;
a1322222222222222.a(a1222222222222222);
return;
case 16:
str = MimeTypes.APPLICATION_PGS;
str6 = "video/av01";
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222;
a13222222222222222.a(a12222222222222222);
return;
case 17:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.VIDEO_VP8;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222;
a132222222222222222.a(a122222222222222222);
return;
case 18:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.VIDEO_VP9;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222;
a1322222222222222222.a(a1222222222222222222);
return;
case 19:
str = MimeTypes.APPLICATION_PGS;
str6 = str;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222;
a13222222222222222222.a(a12222222222222222222);
return;
case 20:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.VIDEO_UNKNOWN;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222222;
a132222222222222222222.a(a122222222222222222222);
return;
case 22:
str = MimeTypes.APPLICATION_PGS;
if (this.O != 32) {
q.c("MatroskaExtractor", "Unsupported floating point PCM bit depth: " + this.O + ". Setting mimeType to " + MimeTypes.AUDIO_UNKNOWN);
str6 = MimeTypes.AUDIO_UNKNOWN;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222222;
a1322222222222222222222.a(a1222222222222222222222);
return;
}
singletonList = null;
str2 = null;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222222;
a13222222222222222222222.a(a12222222222222222222222);
return;
case 23:
str = MimeTypes.APPLICATION_PGS;
int i22 = this.O;
if (i22 == 8) {
singletonList = null;
str2 = null;
i15 = 3;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222222222;
a132222222222222222222222.a(a122222222222222222222222);
return;
}
if (i22 != 16) {
q.c("MatroskaExtractor", "Unsupported big endian PCM bit depth: " + this.O + ". Setting mimeType to " + MimeTypes.AUDIO_UNKNOWN);
str6 = MimeTypes.AUDIO_UNKNOWN;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222222222;
a1322222222222222222222222.a(a1222222222222222222222222);
return;
}
i15 = 268435456;
singletonList = null;
str2 = null;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222222222;
a13222222222222222222222222.a(a12222222222222222222222222);
return;
case 24:
str = MimeTypes.APPLICATION_PGS;
i15 = ai.c(this.O);
if (i15 == 0) {
q.c("MatroskaExtractor", "Unsupported little endian PCM bit depth: " + this.O + ". Setting mimeType to " + MimeTypes.AUDIO_UNKNOWN);
str6 = MimeTypes.AUDIO_UNKNOWN;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222222222222;
a132222222222222222222222222.a(a122222222222222222222222222);
return;
}
singletonList = null;
str2 = null;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222222222222;
a1322222222222222222222222222.a(a1222222222222222222222222222);
return;
case 25:
str = MimeTypes.APPLICATION_PGS;
singletonList = s.a(d.f26562c, a(this.f26595b));
str6 = MimeTypes.TEXT_SSA;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222222222222;
a13222222222222222222222222222.a(a12222222222222222222222222222);
return;
case 26:
str = MimeTypes.APPLICATION_PGS;
com.applovin.exoplayer2.m.f a17 = com.applovin.exoplayer2.m.f.a(new y(a(this.f26595b)));
list = a17.f29032a;
this.W = a17.f29033b;
str3 = a17.f29034c;
str6 = "video/hevc";
i15 = -1;
i12 = -1;
List<byte[]> list22 = list;
str2 = str3;
singletonList = list22;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222222222222222;
a132222222222222222222222222222.a(a122222222222222222222222222222);
return;
case 27:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.APPLICATION_SUBRIP;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222222222222222;
a1322222222222222222222222222222.a(a1222222222222222222222222222222);
return;
case 28:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.VIDEO_MPEG2;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222222222222222;
a13222222222222222222222222222222.a(a12222222222222222222222222222222);
return;
case 29:
str = MimeTypes.APPLICATION_PGS;
str6 = MimeTypes.AUDIO_E_AC3;
singletonList = null;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i182222222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a122222222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a132222222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a132222222222222222222222222222222;
a132222222222222222222222222222222.a(a122222222222222222222222222222222);
return;
case 30:
str = MimeTypes.APPLICATION_PGS;
singletonList = Collections.singletonList(a(this.f26595b));
str6 = MimeTypes.AUDIO_FLAC;
str2 = null;
i15 = -1;
i12 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i1822222222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a1222222222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a1322222222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a1322222222222222222222222222222222;
a1322222222222222222222222222222222.a(a1222222222222222222222222222222222);
return;
case 31:
singletonList = new ArrayList<>(3);
singletonList.add(a(this.f26595b));
ByteBuffer allocate = ByteBuffer.allocate(8);
ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
ByteBuffer order = allocate.order(byteOrder);
str = MimeTypes.APPLICATION_PGS;
singletonList.add(order.putLong(this.Q).array());
singletonList.add(ByteBuffer.allocate(8).order(byteOrder).putLong(this.R).array());
str6 = MimeTypes.AUDIO_OPUS;
i12 = 5760;
str2 = null;
i15 = -1;
bArr = this.M;
if (bArr != null) {
}
str4 = str6;
int i18222222222222222222222222222222222 = (this.U ? 1 : 0) | 0 | (!this.T ? 2 : 0);
aVar = new v.a();
if (!u.a(str4)) {
}
if (this.f26594a != null) {
}
v a12222222222222222222222222222222222 = aVar.a(i11).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222222222222).a(singletonList).d(str2).a(this.f26604k).a();
x a13222222222222222222222222222222222 = jVar.a(this.f26596c, i16);
this.V = a13222222222222222222222222222222222;
a13222222222222222222222222222222222.a(a12222222222222222222222222222222222);
return;
default:
throw com.applovin.exoplayer2.ai.b("Unrecognized codec identifier.", null);
}
}
public void a() {
c cVar = this.S;
if (cVar != null) {
cVar.a(this);
}
}
private static Pair<String, List<byte[]>> a(y yVar) throws com.applovin.exoplayer2.ai {
try {
yVar.e(16);
long p11 = yVar.p();
if (p11 == 1482049860) {
return new Pair<>("video/divx", null);
}
if (p11 == 859189832) {
return new Pair<>(MimeTypes.VIDEO_H263, null);
}
if (p11 == 826496599) {
byte[] d11 = yVar.d();
for (int c11 = yVar.c() + 20; c11 < d11.length - 4; c11++) {
if (d11[c11] == 0 && d11[c11 + 1] == 0 && d11[c11 + 2] == 1 && d11[c11 + 3] == 15) {
return new Pair<>(MimeTypes.VIDEO_VC1, Collections.singletonList(Arrays.copyOfRange(d11, c11, d11.length)));
}
}
throw com.applovin.exoplayer2.ai.b("Failed to find FourCC VC1 initialization data", null);
}
q.c("MatroskaExtractor", "Unknown FourCC. Setting mimeType to video/x-unknown");
return new Pair<>(MimeTypes.VIDEO_UNKNOWN, null);
} catch (ArrayIndexOutOfBoundsException unused) {
throw com.applovin.exoplayer2.ai.b("Error parsing FourCC private data", null);
}
}
private static List<byte[]> a(byte[] bArr) throws com.applovin.exoplayer2.ai {
int i11;
int i12;
try {
if (bArr[0] == 2) {
int i13 = 1;
int i14 = 0;
while (true) {
i11 = bArr[i13];
if ((i11 & 255) != 255) {
break;
}
i14 += 255;
i13++;
}
int i15 = i13 + 1;
int i16 = i14 + (i11 & 255);
int i17 = 0;
while (true) {
i12 = bArr[i15];
if ((i12 & 255) != 255) {
break;
}
i17 += 255;
i15++;
}
int i18 = i15 + 1;
int i19 = i17 + (i12 & 255);
if (bArr[i18] == 1) {
byte[] bArr2 = new byte[i16];
System.arraycopy(bArr, i18, bArr2, 0, i16);
int i21 = i18 + i16;
if (bArr[i21] == 3) {
int i22 = i21 + i19;
if (bArr[i22] == 5) {
byte[] bArr3 = new byte[bArr.length - i22];
System.arraycopy(bArr, i22, bArr3, 0, bArr.length - i22);
ArrayList arrayList = new ArrayList(2);
arrayList.add(bArr2);
arrayList.add(bArr3);
return arrayList;
}
throw com.applovin.exoplayer2.ai.b("Error parsing vorbis codec private", null);
}
throw com.applovin.exoplayer2.ai.b("Error parsing vorbis codec private", null);
}
throw com.applovin.exoplayer2.ai.b("Error parsing vorbis codec private", null);
}
throw com.applovin.exoplayer2.ai.b("Error parsing vorbis codec private", null);
} catch (ArrayIndexOutOfBoundsException unused) {
throw com.applovin.exoplayer2.ai.b("Error parsing vorbis codec private", null);
}
}
private byte[] a(String str) throws com.applovin.exoplayer2.ai {
byte[] bArr = this.f26603j;
if (bArr != null) {
return bArr;
}
throw com.applovin.exoplayer2.ai.b("Missing CodecPrivate for codec " + str, null);
}
}
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);
f26565f = Collections.unmodifiableMap(hashMap);
}
public d() {
this(0);
}
private void e(int i11) throws com.applovin.exoplayer2.ai {
if (this.I == null || this.J == null) {
throw com.applovin.exoplayer2.ai.b("Element " + i11 + " must be in a Cues", null);
}
}
private b f(int i11) throws com.applovin.exoplayer2.ai {
d(i11);
return this.A;
}
private void g() {
com.applovin.exoplayer2.l.a.a(this.f26572ag);
}
public static h[] h() {
return new h[]{new d()};
}
@CallSuper
public int a(int i11) {
switch (i11) {
case 131:
case 136:
case 155:
case 159:
case 176:
case 179:
case 186:
case 215:
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 30321:
case 2352003:
case 2807729:
return 2;
case TsExtractor.TS_STREAM_TYPE_SPLICE_INFO:
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;
}
}
@CallSuper
public boolean b(int i11) {
return i11 == 357149030 || i11 == 524531317 || i11 == 475249515 || i11 == 374648427;
}
@Override
public final void c() {
}
public static final class c {
private final byte[] f26620a = new byte[10];
private boolean f26621b;
private int f26622c;
private long f26623d;
private int f26624e;
private int f26625f;
private int f26626g;
public void a() {
this.f26621b = false;
this.f26622c = 0;
}
public void a(i iVar) throws IOException {
if (this.f26621b) {
return;
}
iVar.d(this.f26620a, 0, 10);
iVar.a();
if (com.applovin.exoplayer2.b.b.b(this.f26620a) == 0) {
return;
}
this.f26621b = true;
}
public void a(b bVar, long j11, int i11, int i12, int i13) {
if (this.f26621b) {
int i14 = this.f26622c;
int i15 = i14 + 1;
this.f26622c = i15;
if (i14 == 0) {
this.f26623d = j11;
this.f26624e = i11;
this.f26625f = 0;
}
this.f26625f += i12;
this.f26626g = i13;
if (i15 >= 16) {
a(bVar);
}
}
}
public void a(b bVar) {
if (this.f26622c > 0) {
bVar.V.a(this.f26623d, this.f26624e, this.f26625f, this.f26626g, bVar.f26602i);
this.f26622c = 0;
}
}
}
public d(int i11) {
this(new com.applovin.exoplayer2.e.e.a(), i11);
}
private void d(int i11) throws com.applovin.exoplayer2.ai {
if (this.A != null) {
return;
}
throw com.applovin.exoplayer2.ai.b("Element " + i11 + " must be in a TrackEntry", null);
}
@CallSuper
public void c(int i11) throws com.applovin.exoplayer2.ai {
g();
if (i11 == 160) {
if (this.M != 2) {
return;
}
int i12 = 0;
for (int i13 = 0; i13 < this.Q; i13++) {
i12 += this.R[i13];
}
b bVar = this.f26575i.get(this.S);
bVar.d();
for (int i14 = 0; i14 < this.Q; i14++) {
long j11 = ((bVar.f26598e * i14) / 1000) + this.N;
int i15 = this.U;
if (i14 == 0 && !this.W) {
i15 |= 1;
}
int i16 = this.R[i14];
i12 -= i16;
a(bVar, j11, i15, i16, i12);
}
this.M = 0;
return;
}
if (i11 == 174) {
b bVar2 = (b) com.applovin.exoplayer2.l.a.a(this.A);
String str = bVar2.f26595b;
if (str != null) {
if (a(str)) {
bVar2.a(this.f26572ag, bVar2.f26596c);
this.f26575i.put(bVar2.f26596c, bVar2);
}
this.A = null;
return;
}
throw com.applovin.exoplayer2.ai.b("CodecId is missing in TrackEntry element", null);
}
if (i11 == 19899) {
int i17 = this.C;
if (i17 != -1) {
long j12 = this.D;
if (j12 != -1) {
if (i17 == 475249515) {
this.F = j12;
return;
}
return;
}
}
throw com.applovin.exoplayer2.ai.b("Mandatory element SeekID or SeekPosition not found", null);
}
if (i11 == 25152) {
d(i11);
b bVar3 = this.A;
if (bVar3.f26600g) {
if (bVar3.f26602i != null) {
bVar3.f26604k = new com.applovin.exoplayer2.d.e(new e.a(com.applovin.exoplayer2.h.f27693a, "video/webm", this.A.f26602i.f27361b));
return;
}
throw com.applovin.exoplayer2.ai.b("Encrypted Track found but ContentEncKeyID was not found", null);
}
return;
}
if (i11 == 28032) {
d(i11);
b bVar4 = this.A;
if (bVar4.f26600g && bVar4.f26601h != null) {
throw com.applovin.exoplayer2.ai.b("Combining encryption and compression is not supported", null);
}
return;
}
if (i11 == 357149030) {
if (this.f26590x == C.TIME_UNSET) {
this.f26590x = 1000000L;
}
long j13 = this.f26591y;
if (j13 != C.TIME_UNSET) {
this.f26592z = a(j13);
return;
}
return;
}
if (i11 == 374648427) {
if (this.f26575i.size() != 0) {
this.f26572ag.a();
return;
}
throw com.applovin.exoplayer2.ai.b("No valid tracks were found", null);
}
if (i11 != 475249515) {
return;
}
if (!this.B) {
this.f26572ag.a(a(this.I, this.J));
this.B = true;
}
this.I = null;
this.J = null;
}
public d(com.applovin.exoplayer2.e.e.c cVar, int i11) {
this.f26589w = -1L;
this.f26590x = C.TIME_UNSET;
this.f26591y = C.TIME_UNSET;
this.f26592z = C.TIME_UNSET;
this.F = -1L;
this.G = -1L;
this.H = C.TIME_UNSET;
this.f26573g = cVar;
cVar.a(new a());
this.f26576j = (i11 & 1) == 0;
this.f26574h = new f();
this.f26575i = new SparseArray<>();
this.f26579m = new y(4);
this.f26580n = new y(ByteBuffer.allocate(4).putInt(-1).array());
this.f26581o = new y(4);
this.f26577k = new y(com.applovin.exoplayer2.l.v.f28888a);
this.f26578l = new y(4);
this.f26582p = new y();
this.f26583q = new y();
this.f26584r = new y(8);
this.f26585s = new y();
this.f26586t = new y();
this.R = new int[1];
}
private int e() {
int i11 = this.Y;
f();
return i11;
}
private void f() {
this.X = 0;
this.Y = 0;
this.Z = 0;
this.f26566aa = false;
this.f26567ab = false;
this.f26568ac = false;
this.f26569ad = 0;
this.f26570ae = (byte) 0;
this.f26571af = false;
this.f26582p.a(0);
}
@Override
public final boolean a(i iVar) throws IOException {
return new e().a(iVar);
}
@Override
public final void a(j jVar) {
this.f26572ag = jVar;
}
@Override
@CallSuper
public void a(long j11, long j12) {
this.H = C.TIME_UNSET;
this.M = 0;
this.f26573g.a();
this.f26574h.a();
f();
for (int i11 = 0; i11 < this.f26575i.size(); i11++) {
this.f26575i.valueAt(i11).b();
}
}
@Override
public final int a(i iVar, com.applovin.exoplayer2.e.u uVar) throws IOException {
this.L = false;
boolean z11 = true;
while (z11 && !this.L) {
z11 = this.f26573g.a(iVar);
if (z11 && a(uVar, iVar.c())) {
return 1;
}
}
if (z11) {
return 0;
}
for (int i11 = 0; i11 < this.f26575i.size(); i11++) {
b valueAt = this.f26575i.valueAt(i11);
valueAt.d();
valueAt.a();
}
return -1;
}
@CallSuper
public void a(int i11, long j11, long j12) throws com.applovin.exoplayer2.ai {
g();
if (i11 == 160) {
this.W = false;
return;
}
if (i11 == 174) {
this.A = new b();
return;
}
if (i11 == 187) {
this.K = false;
return;
}
if (i11 == 19899) {
this.C = -1;
this.D = -1L;
return;
}
if (i11 == 20533) {
f(i11).f26600g = true;
return;
}
if (i11 == 21968) {
f(i11).f26616w = true;
return;
}
if (i11 == 408125543) {
long j13 = this.f26589w;
if (j13 != -1 && j13 != j11) {
throw com.applovin.exoplayer2.ai.b("Multiple Segment elements not supported", null);
}
this.f26589w = j11;
this.f26588v = j12;
return;
}
if (i11 != 475249515) {
if (i11 == 524531317 && !this.B) {
if (this.f26576j && this.F != -1) {
this.E = true;
return;
} else {
this.f26572ag.a(new v.b(this.f26592z));
this.B = true;
return;
}
}
return;
}
this.I = new r();
this.J = new r();
}
@CallSuper
public void a(int i11, long j11) throws com.applovin.exoplayer2.ai {
if (i11 == 20529) {
if (j11 == 0) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncodingOrder " + j11 + " not supported", null);
}
if (i11 == 20530) {
if (j11 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncodingScope " + j11 + " not supported", null);
}
switch (i11) {
case 131:
f(i11).f26597d = (int) j11;
return;
case 136:
f(i11).U = j11 == 1;
return;
case 155:
this.O = a(j11);
return;
case 159:
f(i11).N = (int) j11;
return;
case 176:
f(i11).f26605l = (int) j11;
return;
case 179:
e(i11);
this.I.a(a(j11));
return;
case 186:
f(i11).f26606m = (int) j11;
return;
case 215:
f(i11).f26596c = (int) j11;
return;
case 231:
this.H = a(j11);
return;
case 238:
this.V = (int) j11;
return;
case 241:
if (this.K) {
return;
}
e(i11);
this.J.a(j11);
this.K = true;
return;
case 251:
this.W = true;
return;
case 16871:
f(i11).X = (int) j11;
return;
case 16980:
if (j11 == 3) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentCompAlgo " + j11 + " not supported", null);
case 17029:
if (j11 < 1 || j11 > 2) {
throw com.applovin.exoplayer2.ai.b("DocTypeReadVersion " + j11 + " not supported", null);
}
return;
case 17143:
if (j11 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("EBMLReadVersion " + j11 + " not supported", null);
case 18401:
if (j11 == 5) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncAlgo " + j11 + " not supported", null);
case 18408:
if (j11 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("AESSettingsCipherMode " + j11 + " not supported", null);
case 21420:
this.D = j11 + this.f26589w;
return;
case 21432:
int i12 = (int) j11;
d(i11);
if (i12 == 0) {
this.A.f26615v = 0;
return;
}
if (i12 == 1) {
this.A.f26615v = 2;
return;
} else if (i12 == 3) {
this.A.f26615v = 1;
return;
} else {
if (i12 != 15) {
return;
}
this.A.f26615v = 3;
return;
}
case 21680:
f(i11).f26607n = (int) j11;
return;
case 21682:
f(i11).f26609p = (int) j11;
return;
case 21690:
f(i11).f26608o = (int) j11;
return;
case 21930:
f(i11).T = j11 == 1;
return;
case 21998:
f(i11).f26599f = (int) j11;
return;
case 22186:
f(i11).Q = j11;
return;
case 22203:
f(i11).R = j11;
return;
case 25188:
f(i11).O = (int) j11;
return;
case 30321:
d(i11);
int i13 = (int) j11;
if (i13 == 0) {
this.A.f26610q = 0;
return;
}
if (i13 == 1) {
this.A.f26610q = 1;
return;
} else if (i13 == 2) {
this.A.f26610q = 2;
return;
} else {
if (i13 != 3) {
return;
}
this.A.f26610q = 3;
return;
}
case 2352003:
f(i11).f26598e = (int) j11;
return;
case 2807729:
this.f26590x = j11;
return;
default:
switch (i11) {
case 21945:
d(i11);
int i14 = (int) j11;
if (i14 == 1) {
this.A.f26619z = 2;
return;
} else {
if (i14 != 2) {
return;
}
this.A.f26619z = 1;
return;
}
case 21946:
d(i11);
int b11 = com.applovin.exoplayer2.m.b.b((int) j11);
if (b11 != -1) {
this.A.f26618y = b11;
return;
}
return;
case 21947:
d(i11);
this.A.f26616w = true;
int a11 = com.applovin.exoplayer2.m.b.a((int) j11);
if (a11 != -1) {
this.A.f26617x = a11;
return;
}
return;
case 21948:
f(i11).A = (int) j11;
return;
case 21949:
f(i11).B = (int) j11;
return;
default:
return;
}
}
}
@CallSuper
public void a(int i11, double d11) throws com.applovin.exoplayer2.ai {
if (i11 == 181) {
f(i11).P = (int) d11;
return;
}
if (i11 != 17545) {
switch (i11) {
case 21969:
f(i11).C = (float) d11;
return;
case 21970:
f(i11).D = (float) d11;
return;
case 21971:
f(i11).E = (float) d11;
return;
case 21972:
f(i11).F = (float) d11;
return;
case 21973:
f(i11).G = (float) d11;
return;
case 21974:
f(i11).H = (float) d11;
return;
case 21975:
f(i11).I = (float) d11;
return;
case 21976:
f(i11).J = (float) d11;
return;
case 21977:
f(i11).K = (float) d11;
return;
case 21978:
f(i11).L = (float) d11;
return;
default:
switch (i11) {
case 30323:
f(i11).f26611r = (float) d11;
return;
case 30324:
f(i11).f26612s = (float) d11;
return;
case 30325:
f(i11).f26613t = (float) d11;
return;
default:
return;
}
}
}
this.f26591y = (long) d11;
}
@CallSuper
public void a(int i11, String str) throws com.applovin.exoplayer2.ai {
if (i11 == 134) {
f(i11).f26595b = str;
return;
}
if (i11 != 17026) {
if (i11 == 21358) {
f(i11).f26594a = str;
return;
} else {
if (i11 != 2274716) {
return;
}
f(i11).Y = str;
return;
}
}
if ("webm".equals(str) || "matroska".equals(str)) {
return;
}
throw com.applovin.exoplayer2.ai.b("DocType " + str + " not supported", null);
}
@CallSuper
public void a(int i11, int i12, i iVar) throws IOException {
b bVar;
b bVar2;
b bVar3;
long j11;
int i13;
int i14;
int i15;
int i16 = 0;
int i17 = 1;
if (i11 != 161 && i11 != 163) {
if (i11 == 165) {
if (this.M != 2) {
return;
}
a(this.f26575i.get(this.S), this.V, iVar, i12);
return;
}
if (i11 == 16877) {
a(f(i11), iVar, i12);
return;
}
if (i11 == 16981) {
d(i11);
byte[] bArr = new byte[i12];
this.A.f26601h = bArr;
iVar.b(bArr, 0, i12);
return;
}
if (i11 == 18402) {
byte[] bArr2 = new byte[i12];
iVar.b(bArr2, 0, i12);
f(i11).f26602i = new x.a(1, bArr2, 0, 0);
return;
}
if (i11 == 21419) {
Arrays.fill(this.f26581o.d(), (byte) 0);
iVar.b(this.f26581o.d(), 4 - i12, i12);
this.f26581o.d(0);
this.C = (int) this.f26581o.o();
return;
}
if (i11 == 25506) {
d(i11);
byte[] bArr3 = new byte[i12];
this.A.f26603j = bArr3;
iVar.b(bArr3, 0, i12);
return;
}
if (i11 == 30322) {
d(i11);
byte[] bArr4 = new byte[i12];
this.A.f26614u = bArr4;
iVar.b(bArr4, 0, i12);
return;
}
throw com.applovin.exoplayer2.ai.b("Unexpected id: " + i11, null);
}
if (this.M == 0) {
this.S = (int) this.f26574h.a(iVar, false, true, 8);
this.T = this.f26574h.b();
this.O = C.TIME_UNSET;
this.M = 1;
this.f26579m.a(0);
}
b bVar4 = this.f26575i.get(this.S);
if (bVar4 != null) {
bVar4.d();
if (this.M == 1) {
a(iVar, 3);
int i18 = (this.f26579m.d()[2] & 6) >> 1;
byte b11 = 255;
if (i18 == 0) {
this.Q = 1;
int[] a11 = a(this.R, 1);
this.R = a11;
a11[0] = (i12 - this.T) - 3;
} else {
int i19 = 4;
a(iVar, 4);
int i21 = (this.f26579m.d()[3] & 255) + 1;
this.Q = i21;
int[] a12 = a(this.R, i21);
this.R = a12;
if (i18 == 2) {
int i22 = (i12 - this.T) - 4;
int i23 = this.Q;
Arrays.fill(a12, 0, i23, i22 / i23);
} else if (i18 == 1) {
int i24 = 0;
int i25 = 0;
while (true) {
i13 = this.Q;
if (i24 >= i13 - 1) {
break;
}
this.R[i24] = 0;
do {
i19++;
a(iVar, i19);
i14 = this.f26579m.d()[i19 - 1] & 255;
int[] iArr = this.R;
i15 = iArr[i24] + i14;
iArr[i24] = i15;
} while (i14 == 255);
i25 += i15;
i24++;
}
this.R[i13 - 1] = ((i12 - this.T) - i19) - i25;
} else {
if (i18 != 3) {
throw com.applovin.exoplayer2.ai.b("Unexpected lacing value: " + i18, null);
}
int i26 = 0;
int i27 = 0;
while (true) {
int i28 = this.Q;
if (i26 < i28 - 1) {
this.R[i26] = i16;
i19++;
a(iVar, i19);
int i29 = i19 - 1;
if (this.f26579m.d()[i29] == 0) {
throw com.applovin.exoplayer2.ai.b("No valid varint length mask found", null);
}
int i31 = 0;
while (true) {
if (i31 >= 8) {
bVar3 = bVar4;
j11 = 0;
break;
}
int i32 = i17 << (7 - i31);
if ((this.f26579m.d()[i29] & i32) != 0) {
int i33 = i19 + i31;
a(iVar, i33);
bVar3 = bVar4;
j11 = (~i32) & this.f26579m.d()[i29] & b11;
int i34 = i29 + 1;
while (i34 < i33) {
j11 = (j11 << 8) | (this.f26579m.d()[i34] & b11);
i34++;
i33 = i33;
b11 = 255;
}
int i35 = i33;
if (i26 > 0) {
j11 -= (1 << ((i31 * 7) + 6)) - 1;
}
i19 = i35;
} else {
i31++;
i17 = 1;
b11 = 255;
}
}
if (j11 < -2147483648L || j11 > 2147483647L) {
break;
}
int i36 = (int) j11;
int[] iArr2 = this.R;
if (i26 != 0) {
i36 += iArr2[i26 - 1];
}
iArr2[i26] = i36;
i27 += i36;
i26++;
bVar4 = bVar3;
i16 = 0;
i17 = 1;
b11 = 255;
} else {
bVar2 = bVar4;
this.R[i28 - 1] = ((i12 - this.T) - i19) - i27;
break;
}
}
}
}
bVar2 = bVar4;
this.N = this.H + a((this.f26579m.d()[0] << 8) | (this.f26579m.d()[1] & 255));
bVar = bVar2;
this.U = (bVar.f26597d == 2 || (i11 == 163 && (this.f26579m.d()[2] & b4.f52487d) == 128)) ? 1 : 0;
this.M = 2;
this.P = 0;
} else {
bVar = bVar4;
}
if (i11 == 163) {
while (true) {
int i37 = this.P;
if (i37 < this.Q) {
a(bVar, ((this.P * bVar.f26598e) / 1000) + this.N, this.U, a(iVar, bVar, this.R[i37]), 0);
this.P++;
} else {
this.M = 0;
return;
}
}
} else {
while (true) {
int i38 = this.P;
if (i38 >= this.Q) {
return;
}
int[] iArr3 = this.R;
iArr3[i38] = a(iVar, bVar, iArr3[i38]);
this.P++;
}
}
} else {
iVar.b(i12 - this.T);
this.M = 0;
}
}
public void a(b bVar, i iVar, int i11) throws IOException {
if (bVar.X != 1685485123 && bVar.X != 1685480259) {
iVar.b(i11);
return;
}
byte[] bArr = new byte[i11];
bVar.M = bArr;
iVar.b(bArr, 0, i11);
}
public void a(b bVar, int i11, i iVar, int i12) throws IOException {
if (i11 == 4 && "V_VP9".equals(bVar.f26595b)) {
this.f26586t.a(i12);
iVar.b(this.f26586t.d(), 0, i12);
} else {
iVar.b(i12);
}
}
private void a(b bVar, long j11, int i11, int i12, int i13) {
c cVar = bVar.S;
if (cVar != null) {
cVar.a(bVar, j11, i11, i12, i13);
} else {
if ("S_TEXT/UTF8".equals(bVar.f26595b) || "S_TEXT/ASS".equals(bVar.f26595b)) {
if (this.Q > 1) {
q.c("MatroskaExtractor", "Skipping subtitle sample in laced block.");
} else {
long j12 = this.O;
if (j12 == C.TIME_UNSET) {
q.c("MatroskaExtractor", "Skipping subtitle sample with no duration.");
} else {
a(bVar.f26595b, j12, this.f26583q.d());
int c11 = this.f26583q.c();
while (true) {
if (c11 >= this.f26583q.b()) {
break;
}
if (this.f26583q.d()[c11] == 0) {
this.f26583q.c(c11);
break;
}
c11++;
}
x xVar = bVar.V;
y yVar = this.f26583q;
xVar.a(yVar, yVar.b());
i12 += this.f26583q.b();
}
}
}
if ((268435456 & i11) != 0) {
if (this.Q > 1) {
i11 &= -268435457;
} else {
int b11 = this.f26586t.b();
bVar.V.a(this.f26586t, b11, 2);
i12 += b11;
}
}
bVar.V.a(j11, i11, i12, i13, bVar.f26602i);
}
this.L = true;
}
private void a(i iVar, int i11) throws IOException {
if (this.f26579m.b() >= i11) {
return;
}
if (this.f26579m.e() < i11) {
y yVar = this.f26579m;
yVar.b(Math.max(yVar.e() * 2, i11));
}
iVar.b(this.f26579m.d(), this.f26579m.b(), i11 - this.f26579m.b());
this.f26579m.c(i11);
}
private int a(i iVar, b bVar, int i11) throws IOException {
int i12;
if ("S_TEXT/UTF8".equals(bVar.f26595b)) {
a(iVar, f26561b, i11);
return e();
}
if ("S_TEXT/ASS".equals(bVar.f26595b)) {
a(iVar, f26563d, i11);
return e();
}
x xVar = bVar.V;
if (!this.f26566aa) {
if (bVar.f26600g) {
this.U &= -1073741825;
if (!this.f26567ab) {
iVar.b(this.f26579m.d(), 0, 1);
this.X++;
if ((this.f26579m.d()[0] & b4.f52487d) != 128) {
this.f26570ae = this.f26579m.d()[0];
this.f26567ab = true;
} else {
throw com.applovin.exoplayer2.ai.b("Extension bit is set in signal byte", null);
}
}
byte b11 = this.f26570ae;
if ((b11 & 1) == 1) {
boolean z11 = (b11 & 2) == 2;
this.U |= 1073741824;
if (!this.f26571af) {
iVar.b(this.f26584r.d(), 0, 8);
this.X += 8;
this.f26571af = true;
this.f26579m.d()[0] = (byte) ((z11 ? 128 : 0) | 8);
this.f26579m.d(0);
xVar.a(this.f26579m, 1, 1);
this.Y++;
this.f26584r.d(0);
xVar.a(this.f26584r, 8, 1);
this.Y += 8;
}
if (z11) {
if (!this.f26568ac) {
iVar.b(this.f26579m.d(), 0, 1);
this.X++;
this.f26579m.d(0);
this.f26569ad = this.f26579m.h();
this.f26568ac = true;
}
int i13 = this.f26569ad * 4;
this.f26579m.a(i13);
iVar.b(this.f26579m.d(), 0, i13);
this.X += i13;
short s11 = (short) ((this.f26569ad / 2) + 1);
int i14 = (s11 * 6) + 2;
ByteBuffer byteBuffer = this.f26587u;
if (byteBuffer == null || byteBuffer.capacity() < i14) {
this.f26587u = ByteBuffer.allocate(i14);
}
this.f26587u.position(0);
this.f26587u.putShort(s11);
int i15 = 0;
int i16 = 0;
while (true) {
i12 = this.f26569ad;
if (i15 >= i12) {
break;
}
int w11 = this.f26579m.w();
if (i15 % 2 == 0) {
this.f26587u.putShort((short) (w11 - i16));
} else {
this.f26587u.putInt(w11 - i16);
}
i15++;
i16 = w11;
}
int i17 = (i11 - this.X) - i16;
if (i12 % 2 == 1) {
this.f26587u.putInt(i17);
} else {
this.f26587u.putShort((short) i17);
this.f26587u.putInt(0);
}
this.f26585s.a(this.f26587u.array(), i14);
xVar.a(this.f26585s, i14, 1);
this.Y += i14;
}
}
} else {
byte[] bArr = bVar.f26601h;
if (bArr != null) {
this.f26582p.a(bArr, bArr.length);
}
}
if (bVar.f26599f > 0) {
this.U |= 268435456;
this.f26586t.a(0);
this.f26579m.a(4);
this.f26579m.d()[0] = (byte) ((i11 >> 24) & 255);
this.f26579m.d()[1] = (byte) ((i11 >> 16) & 255);
this.f26579m.d()[2] = (byte) ((i11 >> 8) & 255);
this.f26579m.d()[3] = (byte) (i11 & 255);
xVar.a(this.f26579m, 4, 2);
this.Y += 4;
}
this.f26566aa = true;
}
int b12 = i11 + this.f26582p.b();
if (!"V_MPEG4/ISO/AVC".equals(bVar.f26595b) && !"V_MPEGH/ISO/HEVC".equals(bVar.f26595b)) {
if (bVar.S != null) {
com.applovin.exoplayer2.l.a.b(this.f26582p.b() == 0);
bVar.S.a(iVar);
}
while (true) {
int i18 = this.X;
if (i18 >= b12) {
break;
}
int a11 = a(iVar, xVar, b12 - i18);
this.X += a11;
this.Y += a11;
}
} else {
byte[] d11 = this.f26578l.d();
d11[0] = 0;
d11[1] = 0;
d11[2] = 0;
int i19 = bVar.W;
int i21 = 4 - i19;
while (this.X < b12) {
int i22 = this.Z;
if (i22 == 0) {
a(iVar, d11, i21, i19);
this.X += i19;
this.f26578l.d(0);
this.Z = this.f26578l.w();
this.f26577k.d(0);
xVar.a(this.f26577k, 4);
this.Y += 4;
} else {
int a12 = a(iVar, xVar, i22);
this.X += a12;
this.Y += a12;
this.Z -= a12;
}
}
}
if ("A_VORBIS".equals(bVar.f26595b)) {
this.f26580n.d(0);
xVar.a(this.f26580n, 4);
this.Y += 4;
}
return e();
}
private void a(i iVar, byte[] bArr, int i11) throws IOException {
int length = bArr.length + i11;
if (this.f26583q.e() < length) {
this.f26583q.a(Arrays.copyOf(bArr, length + i11));
} else {
System.arraycopy(bArr, 0, this.f26583q.d(), 0, bArr.length);
}
iVar.b(this.f26583q.d(), bArr.length, i11);
this.f26583q.d(0);
this.f26583q.c(length);
}
private static void a(String str, long j11, byte[] bArr) {
byte[] a11;
int i11;
str.hashCode();
if (str.equals("S_TEXT/ASS")) {
a11 = a(j11, "%01d:%02d:%02d:%02d", 10000L);
i11 = 21;
} else if (str.equals("S_TEXT/UTF8")) {
a11 = a(j11, "%02d:%02d:%02d,%03d", 1000L);
i11 = 19;
} else {
throw new IllegalArgumentException();
}
System.arraycopy(a11, 0, bArr, i11, a11.length);
}
private static byte[] a(long j11, String str, long j12) {
com.applovin.exoplayer2.l.a.a(j11 != C.TIME_UNSET);
int i11 = (int) (j11 / 3600000000L);
long j13 = j11 - ((i11 * 3600) * 1000000);
int i12 = (int) (j13 / 60000000);
long j14 = j13 - ((i12 * 60) * 1000000);
int i13 = (int) (j14 / 1000000);
return ai.c(String.format(Locale.US, str, Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf(i13), Integer.valueOf((int) ((j14 - (i13 * 1000000)) / j12))));
}
private void a(i iVar, byte[] bArr, int i11, int i12) throws IOException {
int min = Math.min(i12, this.f26582p.a());
iVar.b(bArr, i11 + min, i12 - min);
if (min > 0) {
this.f26582p.a(bArr, i11, min);
}
}
private int a(i iVar, x xVar, int i11) throws IOException {
int a11 = this.f26582p.a();
if (a11 > 0) {
int min = Math.min(i11, a11);
xVar.a(this.f26582p, min);
return min;
}
return xVar.a((com.applovin.exoplayer2.k.g) iVar, i11, false);
}
private com.applovin.exoplayer2.e.v a(@Nullable r rVar, @Nullable r rVar2) {
int i11;
if (this.f26589w != -1 && this.f26592z != C.TIME_UNSET && rVar != null && rVar.a() != 0 && rVar2 != null && rVar2.a() == rVar.a()) {
int a11 = rVar.a();
int[] iArr = new int[a11];
long[] jArr = new long[a11];
long[] jArr2 = new long[a11];
long[] jArr3 = new long[a11];
int i12 = 0;
for (int i13 = 0; i13 < a11; i13++) {
jArr3[i13] = rVar.a(i13);
jArr[i13] = this.f26589w + rVar2.a(i13);
}
while (true) {
i11 = a11 - 1;
if (i12 >= i11) {
break;
}
int i14 = i12 + 1;
iArr[i12] = (int) (jArr[i14] - jArr[i12]);
jArr2[i12] = jArr3[i14] - jArr3[i12];
i12 = i14;
}
iArr[i11] = (int) ((this.f26589w + this.f26588v) - jArr[i11]);
long j11 = this.f26592z - jArr3[i11];
jArr2[i11] = j11;
if (j11 <= 0) {
q.c("MatroskaExtractor", "Discarding last cue point with unexpected duration: " + j11);
iArr = Arrays.copyOf(iArr, i11);
jArr = Arrays.copyOf(jArr, i11);
jArr2 = Arrays.copyOf(jArr2, i11);
jArr3 = Arrays.copyOf(jArr3, i11);
}
return new com.applovin.exoplayer2.e.c(iArr, jArr, jArr2, jArr3);
}
return new v.b(this.f26592z);
}
private boolean a(com.applovin.exoplayer2.e.u uVar, long j11) {
if (this.E) {
this.G = j11;
uVar.f27352a = this.F;
this.E = false;
return true;
}
if (this.B) {
long j12 = this.G;
if (j12 != -1) {
uVar.f27352a = j12;
this.G = -1L;
return true;
}
}
return false;
}
private long a(long j11) throws com.applovin.exoplayer2.ai {
long j12 = this.f26590x;
if (j12 != C.TIME_UNSET) {
return ai.d(j11, j12, 1000L);
}
throw com.applovin.exoplayer2.ai.b("Can't scale timecode prior to timecodeScale being set.", null);
}
private static boolean a(String str) {
str.hashCode();
char c11 = 65535;
switch (str.hashCode()) {
case -2095576542:
if (str.equals("V_MPEG4/ISO/AP")) {
c11 = 0;
break;
}
break;
case -2095575984:
if (str.equals("V_MPEG4/ISO/SP")) {
c11 = 1;
break;
}
break;
case -1985379776:
if (str.equals("A_MS/ACM")) {
c11 = 2;
break;
}
break;
case -1784763192:
if (str.equals("A_TRUEHD")) {
c11 = 3;
break;
}
break;
case -1730367663:
if (str.equals("A_VORBIS")) {
c11 = 4;
break;
}
break;
case -1482641358:
if (str.equals("A_MPEG/L2")) {
c11 = 5;
break;
}
break;
case -1482641357:
if (str.equals("A_MPEG/L3")) {
c11 = 6;
break;
}
break;
case -1373388978:
if (str.equals("V_MS/VFW/FOURCC")) {
c11 = 7;
break;
}
break;
case -933872740:
if (str.equals("S_DVBSUB")) {
c11 = '\b';
break;
}
break;
case -538363189:
if (str.equals("V_MPEG4/ISO/ASP")) {
c11 = '\t';
break;
}
break;
case -538363109:
if (str.equals("V_MPEG4/ISO/AVC")) {
c11 = '\n';
break;
}
break;
case -425012669:
if (str.equals("S_VOBSUB")) {
c11 = 11;
break;
}
break;
case -356037306:
if (str.equals("A_DTS/LOSSLESS")) {
c11 = '\f';
break;
}
break;
case 62923557:
if (str.equals("A_AAC")) {
c11 = '\r';
break;
}
break;
case 62923603:
if (str.equals("A_AC3")) {
c11 = 14;
break;
}
break;
case 62927045:
if (str.equals("A_DTS")) {
c11 = 15;
break;
}
break;
case 82318131:
if (str.equals("V_AV1")) {
c11 = 16;
break;
}
break;
case 82338133:
if (str.equals("V_VP8")) {
c11 = 17;
break;
}
break;
case 82338134:
if (str.equals("V_VP9")) {
c11 = 18;
break;
}
break;
case 99146302:
if (str.equals("S_HDMV/PGS")) {
c11 = 19;
break;
}
break;
case 444813526:
if (str.equals("V_THEORA")) {
c11 = 20;
break;
}
break;
case 542569478:
if (str.equals("A_DTS/EXPRESS")) {
c11 = 21;
break;
}
break;
case 635596514:
if (str.equals("A_PCM/FLOAT/IEEE")) {
c11 = 22;
break;
}
break;
case 725948237:
if (str.equals("A_PCM/INT/BIG")) {
c11 = 23;
break;
}
break;
case 725957860:
if (str.equals("A_PCM/INT/LIT")) {
c11 = 24;
break;
}
break;
case 738597099:
if (str.equals("S_TEXT/ASS")) {
c11 = 25;
break;
}
break;
case 855502857:
if (str.equals("V_MPEGH/ISO/HEVC")) {
c11 = 26;
break;
}
break;
case 1422270023:
if (str.equals("S_TEXT/UTF8")) {
c11 = 27;
break;
}
break;
case 1809237540:
if (str.equals("V_MPEG2")) {
c11 = 28;
break;
}
break;
case 1950749482:
if (str.equals("A_EAC3")) {
c11 = 29;
break;
}
break;
case 1950789798:
if (str.equals("A_FLAC")) {
c11 = 30;
break;
}
break;
case 1951062397:
if (str.equals("A_OPUS")) {
c11 = 31;
break;
}
break;
}
switch (c11) {
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:
return true;
default:
return false;
}
}
private static int[] a(@Nullable int[] iArr, int i11) {
if (iArr == null) {
return new int[i11];
}
return iArr.length >= i11 ? iArr : new int[Math.max(iArr.length * 2, i11)];
}
}