Recover Files v1.3.9版本的 MD5 值为:27a8b2c239c6cb7111d74d6bb07d21b2
以下内容为反编译后的 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 b7.m;
import ci.p;
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.davemorrissey.labs.subscaleview.SubsamplingScaleImageView;
import com.google.android.exoplayer2.util.MimeTypes;
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 f5744a = new l() {
@Override
public h[] a(Uri uri, Map map) {
return c0.a(this, uri, map);
}
@Override
public final h[] createExtractors() {
h[] h10;
h10 = d.h();
return h10;
}
};
private static final byte[] f5745b = {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[] f5746c = ai.c("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
private static final byte[] f5747d = {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 f5748e = new UUID(72057594037932032L, -9223371306706625679L);
private static final Map<String, Integer> f5749f;
@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 f5750aa;
private boolean f5751ab;
private boolean f5752ac;
private int f5753ad;
private byte f5754ae;
private boolean f5755af;
private j f5756ag;
private final com.applovin.exoplayer2.e.e.c f5757g;
private final f f5758h;
private final SparseArray<b> f5759i;
private final boolean f5760j;
private final y f5761k;
private final y f5762l;
private final y f5763m;
private final y f5764n;
private final y f5765o;
private final y f5766p;
private final y f5767q;
private final y f5768r;
private final y f5769s;
private final y f5770t;
private ByteBuffer f5771u;
private long f5772v;
private long f5773w;
private long f5774x;
private long f5775y;
private long f5776z;
public final class a implements com.applovin.exoplayer2.e.e.b {
private a() {
}
@Override
public int a(int i10) {
return d.this.a(i10);
}
@Override
public boolean b(int i10) {
return d.this.b(i10);
}
@Override
public void c(int i10) throws com.applovin.exoplayer2.ai {
d.this.c(i10);
}
@Override
public void a(int i10, long j10, long j11) throws com.applovin.exoplayer2.ai {
d.this.a(i10, j10, j11);
}
@Override
public void a(int i10, long j10) throws com.applovin.exoplayer2.ai {
d.this.a(i10, j10);
}
@Override
public void a(int i10, double d10) throws com.applovin.exoplayer2.ai {
d.this.a(i10, d10);
}
@Override
public void a(int i10, String str) throws com.applovin.exoplayer2.ai {
d.this.a(i10, str);
}
@Override
public void a(int i10, int i11, i iVar) throws IOException {
d.this.a(i10, i11, 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 f5778a;
public String f5779b;
public int f5780c;
public int f5781d;
public int f5782e;
public int f5783f;
public boolean f5784g;
public byte[] f5785h;
public x.a f5786i;
public byte[] f5787j;
public com.applovin.exoplayer2.d.e f5788k;
public int f5789l;
public int f5790m;
public int f5791n;
public int f5792o;
public int f5793p;
public int f5794q;
public float f5795r;
public float f5796s;
public float f5797t;
public byte[] f5798u;
public int f5799v;
public boolean f5800w;
public int f5801x;
public int f5802y;
public int f5803z;
private b() {
this.f5789l = -1;
this.f5790m = -1;
this.f5791n = -1;
this.f5792o = -1;
this.f5793p = 0;
this.f5794q = -1;
this.f5795r = 0.0f;
this.f5796s = 0.0f;
this.f5797t = 0.0f;
this.f5798u = null;
this.f5799v = -1;
this.f5800w = false;
this.f5801x = -1;
this.f5802y = -1;
this.f5803z = -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 j10 = yVar.j();
if (j10 == 1) {
return true;
}
if (j10 != 65534) {
return false;
}
yVar.d(24);
if (yVar.s() == d.f5748e.getMostSignificantBits()) {
if (yVar.s() == d.f5748e.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 i10) throws com.applovin.exoplayer2.ai {
char c10;
String str;
int i11;
List<byte[]> list;
String str2;
int i12;
List<byte[]> list2;
String str3;
List<byte[]> list3;
List<byte[]> list4;
List<byte[]> list5;
byte[] bArr;
String str4;
v.a aVar;
int i13;
int i14;
com.applovin.exoplayer2.m.c a10;
List<byte[]> list6;
String str5 = this.f5779b;
str5.getClass();
int i15 = 4;
int i16 = 3;
int i17 = 0;
switch (str5.hashCode()) {
case -2095576542:
if (str5.equals("V_MPEG4/ISO/AP")) {
c10 = 0;
break;
}
c10 = 65535;
break;
case -2095575984:
if (str5.equals("V_MPEG4/ISO/SP")) {
c10 = 1;
break;
}
c10 = 65535;
break;
case -1985379776:
if (str5.equals("A_MS/ACM")) {
c10 = 2;
break;
}
c10 = 65535;
break;
case -1784763192:
if (str5.equals("A_TRUEHD")) {
c10 = 3;
break;
}
c10 = 65535;
break;
case -1730367663:
if (str5.equals("A_VORBIS")) {
c10 = 4;
break;
}
c10 = 65535;
break;
case -1482641358:
if (str5.equals("A_MPEG/L2")) {
c10 = 5;
break;
}
c10 = 65535;
break;
case -1482641357:
if (str5.equals("A_MPEG/L3")) {
c10 = 6;
break;
}
c10 = 65535;
break;
case -1373388978:
if (str5.equals("V_MS/VFW/FOURCC")) {
c10 = 7;
break;
}
c10 = 65535;
break;
case -933872740:
if (str5.equals("S_DVBSUB")) {
c10 = '\b';
break;
}
c10 = 65535;
break;
case -538363189:
if (str5.equals("V_MPEG4/ISO/ASP")) {
c10 = '\t';
break;
}
c10 = 65535;
break;
case -538363109:
if (str5.equals("V_MPEG4/ISO/AVC")) {
c10 = '\n';
break;
}
c10 = 65535;
break;
case -425012669:
if (str5.equals("S_VOBSUB")) {
c10 = 11;
break;
}
c10 = 65535;
break;
case -356037306:
if (str5.equals("A_DTS/LOSSLESS")) {
c10 = '\f';
break;
}
c10 = 65535;
break;
case 62923557:
if (str5.equals("A_AAC")) {
c10 = '\r';
break;
}
c10 = 65535;
break;
case 62923603:
if (str5.equals("A_AC3")) {
c10 = 14;
break;
}
c10 = 65535;
break;
case 62927045:
if (str5.equals("A_DTS")) {
c10 = 15;
break;
}
c10 = 65535;
break;
case 82318131:
if (str5.equals("V_AV1")) {
c10 = 16;
break;
}
c10 = 65535;
break;
case 82338133:
if (str5.equals("V_VP8")) {
c10 = 17;
break;
}
c10 = 65535;
break;
case 82338134:
if (str5.equals("V_VP9")) {
c10 = 18;
break;
}
c10 = 65535;
break;
case 99146302:
if (str5.equals("S_HDMV/PGS")) {
c10 = 19;
break;
}
c10 = 65535;
break;
case 444813526:
if (str5.equals("V_THEORA")) {
c10 = 20;
break;
}
c10 = 65535;
break;
case 542569478:
if (str5.equals("A_DTS/EXPRESS")) {
c10 = 21;
break;
}
c10 = 65535;
break;
case 635596514:
if (str5.equals("A_PCM/FLOAT/IEEE")) {
c10 = 22;
break;
}
c10 = 65535;
break;
case 725948237:
if (str5.equals("A_PCM/INT/BIG")) {
c10 = 23;
break;
}
c10 = 65535;
break;
case 725957860:
if (str5.equals("A_PCM/INT/LIT")) {
c10 = 24;
break;
}
c10 = 65535;
break;
case 738597099:
if (str5.equals("S_TEXT/ASS")) {
c10 = 25;
break;
}
c10 = 65535;
break;
case 855502857:
if (str5.equals("V_MPEGH/ISO/HEVC")) {
c10 = 26;
break;
}
c10 = 65535;
break;
case 1422270023:
if (str5.equals("S_TEXT/UTF8")) {
c10 = 27;
break;
}
c10 = 65535;
break;
case 1809237540:
if (str5.equals("V_MPEG2")) {
c10 = w9.b.f40805n;
break;
}
c10 = 65535;
break;
case 1950749482:
if (str5.equals("A_EAC3")) {
c10 = w9.b.f40806o;
break;
}
c10 = 65535;
break;
case 1950789798:
if (str5.equals("A_FLAC")) {
c10 = w9.b.f40807p;
break;
}
c10 = 65535;
break;
case 1951062397:
if (str5.equals("A_OPUS")) {
c10 = y6.c.f41315b;
break;
}
c10 = 65535;
break;
default:
c10 = 65535;
break;
}
String str6 = "audio/raw";
switch (c10) {
case 0:
case 1:
case '\t':
str = "application/pgs";
byte[] bArr2 = this.f5787j;
str6 = "video/mp4v-es";
list5 = bArr2 == null ? null : Collections.singletonList(bArr2);
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
bArr = this.M;
if (bArr != null && (a10 = com.applovin.exoplayer2.m.c.a(new y(bArr))) != null) {
str2 = a10.f8170c;
str6 = MimeTypes.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.f5793p == 0) {
int i19 = this.f5791n;
i13 = -1;
if (i19 == -1) {
i19 = this.f5789l;
}
this.f5791n = i19;
int i20 = this.f5792o;
if (i20 == -1) {
i20 = this.f5790m;
}
this.f5792o = i20;
} else {
i13 = -1;
}
float f10 = (this.f5791n == i13 || (i14 = this.f5792o) == i13) ? -1.0f : (this.f5790m * r2) / (this.f5789l * i14);
com.applovin.exoplayer2.m.b bVar = this.f5800w ? new com.applovin.exoplayer2.m.b(this.f5801x, this.f5803z, this.f5802y, c()) : null;
if (this.f5778a != null && d.f5749f.containsKey(this.f5778a)) {
i13 = ((Integer) d.f5749f.get(this.f5778a)).intValue();
}
if (this.f5794q == 0 && Float.compare(this.f5795r, 0.0f) == 0 && Float.compare(this.f5796s, 0.0f) == 0) {
if (Float.compare(this.f5797t, 0.0f) != 0) {
if (Float.compare(this.f5796s, 90.0f) == 0) {
i17 = 90;
} else if (Float.compare(this.f5796s, -180.0f) == 0 || Float.compare(this.f5796s, 180.0f) == 0) {
i17 = 180;
} else if (Float.compare(this.f5796s, -90.0f) == 0) {
i17 = SubsamplingScaleImageView.ORIENTATION_270;
}
}
aVar.g(this.f5789l).h(this.f5790m).b(f10).i(i17).a(this.f5798u).j(this.f5799v).a(bVar);
i16 = 2;
}
i17 = i13;
aVar.g(this.f5789l).h(this.f5790m).b(f10).i(i17).a(this.f5798u).j(this.f5799v).a(bVar);
i16 = 2;
} else if (!"application/x-subrip".equals(str4) && !"text/x-ssa".equals(str4) && !"application/vobsub".equals(str4) && !str.equals(str4) && !"application/dvbsubs".equals(str4)) {
throw com.applovin.exoplayer2.ai.b("Unexpected MIME type.", null);
}
if (this.f5778a != null && !d.f5749f.containsKey(this.f5778a)) {
aVar.b(this.f5778a);
}
v a11 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18).a(list4).d(str2).a(this.f5788k).a();
x a12 = jVar.a(this.f5780c, i16);
this.V = a12;
a12.a(a11);
return;
case 2:
str = "application/pgs";
if (b(new y(a(this.f5779b)))) {
i15 = ai.c(this.O);
if (i15 == 0) {
q.c("MatroskaExtractor", "Unsupported PCM bit depth: " + this.O + ". Setting mimeType to audio/x-unknown");
}
list4 = null;
str2 = null;
i12 = -1;
bArr = this.M;
if (bArr != null) {
str2 = a10.f8170c;
str6 = MimeTypes.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.f5778a != null) {
aVar.b(this.f5778a);
break;
}
v a112 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182).a(list4).d(str2).a(this.f5788k).a();
x a122 = jVar.a(this.f5780c, i16);
this.V = a122;
a122.a(a112);
return;
}
q.c("MatroskaExtractor", "Non-PCM MS/ACM is unsupported. Setting mimeType to audio/x-unknown");
list3 = null;
str2 = null;
str6 = "audio/x-unknown";
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822).a(list4).d(str2).a(this.f5788k).a();
x a1222 = jVar.a(this.f5780c, i16);
this.V = a1222;
a1222.a(a1122);
return;
case 3:
str = "application/pgs";
this.S = new c();
str6 = "audio/true-hd";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222).a(list4).d(str2).a(this.f5788k).a();
x a12222 = jVar.a(this.f5780c, i16);
this.V = a12222;
a12222.a(a11222);
return;
case 4:
str = "application/pgs";
str6 = "audio/vorbis";
i11 = 8192;
list6 = a(a(this.f5779b));
i12 = i11;
str2 = null;
list = list6;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222).a(list4).d(str2).a(this.f5788k).a();
x a122222 = jVar.a(this.f5780c, i16);
this.V = a122222;
a122222.a(a112222);
return;
case 5:
str = "application/pgs";
str6 = "audio/mpeg-L2";
list = null;
str2 = null;
i12 = 4096;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222).a(list4).d(str2).a(this.f5788k).a();
x a1222222 = jVar.a(this.f5780c, i16);
this.V = a1222222;
a1222222.a(a1122222);
return;
case 6:
str = "application/pgs";
str6 = "audio/mpeg";
list = null;
str2 = null;
i12 = 4096;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222 = jVar.a(this.f5780c, i16);
this.V = a12222222;
a12222222.a(a11222222);
return;
case 7:
str = "application/pgs";
Pair<String, List<byte[]>> a13 = a(new y(a(this.f5779b)));
str6 = (String) a13.first;
list5 = (List) a13.second;
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222 = jVar.a(this.f5780c, i16);
this.V = a122222222;
a122222222.a(a112222222);
return;
case '\b':
str = "application/pgs";
byte[] bArr3 = new byte[4];
System.arraycopy(a(this.f5779b), 0, bArr3, 0, 4);
str6 = "application/dvbsubs";
list5 = s.a(bArr3);
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222;
a1222222222.a(a1122222222);
return;
case '\n':
str = "application/pgs";
com.applovin.exoplayer2.m.a a14 = com.applovin.exoplayer2.m.a.a(new y(a(this.f5779b)));
list2 = a14.f8102a;
this.W = a14.f8103b;
str3 = a14.f8107f;
str6 = "video/avc";
i12 = -1;
i15 = -1;
List<byte[]> list7 = list2;
str2 = str3;
list4 = list7;
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.f5778a != null) {
}
v a11222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222;
a12222222222.a(a11222222222);
return;
case 11:
str = "application/pgs";
str6 = "application/vobsub";
list5 = s.a(a(this.f5779b));
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222;
a122222222222.a(a112222222222);
return;
case '\f':
str = "application/pgs";
str6 = "audio/vnd.dts.hd";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222;
a1222222222222.a(a1122222222222);
return;
case '\r':
str = "application/pgs";
List<byte[]> singletonList = Collections.singletonList(a(this.f5779b));
a.C0054a a15 = com.applovin.exoplayer2.b.a.a(this.f5787j);
this.P = a15.f4797a;
this.N = a15.f4798b;
str2 = a15.f4799c;
str6 = "audio/mp4a-latm";
list3 = singletonList;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222;
a12222222222222.a(a11222222222222);
return;
case 14:
str = "application/pgs";
str6 = "audio/ac3";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222;
a122222222222222.a(a112222222222222);
return;
case 15:
case 21:
str = "application/pgs";
str6 = "audio/vnd.dts";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222;
a1222222222222222.a(a1122222222222222);
return;
case 16:
str = "application/pgs";
str6 = MimeTypes.VIDEO_AV1;
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222;
a12222222222222222.a(a11222222222222222);
return;
case 17:
str = "application/pgs";
str6 = "video/x-vnd.on2.vp8";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222;
a122222222222222222.a(a112222222222222222);
return;
case 18:
str = "application/pgs";
str6 = "video/x-vnd.on2.vp9";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222;
a1222222222222222222.a(a1122222222222222222);
return;
case 19:
str = "application/pgs";
list3 = null;
str2 = null;
str6 = str;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222222;
a12222222222222222222.a(a11222222222222222222);
return;
case 20:
str = "application/pgs";
str6 = "video/x-unknown";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222222;
a122222222222222222222.a(a112222222222222222222);
return;
case 22:
str = "application/pgs";
if (this.O != 32) {
q.c("MatroskaExtractor", "Unsupported floating point PCM bit depth: " + this.O + ". Setting mimeType to audio/x-unknown");
list3 = null;
str2 = null;
str6 = "audio/x-unknown";
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222222;
a1222222222222222222222.a(a1122222222222222222222);
return;
}
list4 = 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.f5778a != null) {
}
v a11222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222222222;
a12222222222222222222222.a(a11222222222222222222222);
return;
case 23:
str = "application/pgs";
int i21 = this.O;
if (i21 == 8) {
i15 = 3;
} else {
if (i21 != 16) {
q.c("MatroskaExtractor", "Unsupported big endian PCM bit depth: " + this.O + ". Setting mimeType to audio/x-unknown");
list3 = null;
str2 = null;
str6 = "audio/x-unknown";
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222222222;
a122222222222222222222222.a(a112222222222222222222222);
return;
}
i15 = 268435456;
}
list4 = null;
str2 = null;
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.f5778a != null) {
}
v a1122222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222222222;
a1222222222222222222222222.a(a1122222222222222222222222);
return;
case 24:
str = "application/pgs";
i15 = ai.c(this.O);
if (i15 == 0) {
q.c("MatroskaExtractor", "Unsupported little endian PCM bit depth: " + this.O + ". Setting mimeType to audio/x-unknown");
list3 = null;
str2 = null;
str6 = "audio/x-unknown";
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222222222222;
a12222222222222222222222222.a(a11222222222222222222222222);
return;
}
list4 = null;
str2 = null;
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.f5778a != null) {
}
v a112222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222222222222;
a122222222222222222222222222.a(a112222222222222222222222222);
return;
case 25:
str = "application/pgs";
str6 = "text/x-ssa";
list5 = s.a(d.f5746c, a(this.f5779b));
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222222222222;
a1222222222222222222222222222.a(a1122222222222222222222222222);
return;
case 26:
str = "application/pgs";
com.applovin.exoplayer2.m.f a16 = com.applovin.exoplayer2.m.f.a(new y(a(this.f5779b)));
list2 = a16.f8199a;
this.W = a16.f8200b;
str3 = a16.f8201c;
str6 = "video/hevc";
i12 = -1;
i15 = -1;
List<byte[]> list72 = list2;
str2 = str3;
list4 = list72;
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.f5778a != null) {
}
v a11222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222222222222222;
a12222222222222222222222222222.a(a11222222222222222222222222222);
return;
case 27:
str = "application/pgs";
str6 = "application/x-subrip";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222222222222222;
a122222222222222222222222222222.a(a112222222222222222222222222222);
return;
case 28:
str = "application/pgs";
str6 = "video/mpeg2";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222222222222222;
a1222222222222222222222222222222.a(a1122222222222222222222222222222);
return;
case 29:
str = "application/pgs";
str6 = "audio/eac3";
list3 = null;
str2 = null;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a11222222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i18222222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a12222222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a12222222222222222222222222222222;
a12222222222222222222222222222222.a(a11222222222222222222222222222222);
return;
case 30:
str = "application/pgs";
str6 = "audio/flac";
list5 = Collections.singletonList(a(this.f5779b));
str2 = null;
list3 = list5;
i12 = -1;
list = list3;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a112222222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i182222222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a122222222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a122222222222222222222222222222222;
a122222222222222222222222222222222.a(a112222222222222222222222222222222);
return;
case 31:
ArrayList arrayList = new ArrayList(3);
arrayList.add(a(this.f5779b));
ByteBuffer allocate = ByteBuffer.allocate(8);
ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
str = "application/pgs";
arrayList.add(allocate.order(byteOrder).putLong(this.Q).array());
arrayList.add(ByteBuffer.allocate(8).order(byteOrder).putLong(this.R).array());
str6 = "audio/opus";
i11 = 5760;
list6 = arrayList;
i12 = i11;
str2 = null;
list = list6;
i15 = -1;
list4 = list;
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.f5778a != null) {
}
v a1122222222222222222222222222222222 = aVar.a(i10).f(str4).f(i12).c(this.Y).b(i1822222222222222222222222222222222).a(list4).d(str2).a(this.f5788k).a();
x a1222222222222222222222222222222222 = jVar.a(this.f5780c, i16);
this.V = a1222222222222222222222222222222222;
a1222222222222222222222222222222222.a(a1122222222222222222222222222222222);
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 p10 = yVar.p();
if (p10 == 1482049860) {
return new Pair<>(MimeTypes.VIDEO_DIVX, null);
}
if (p10 == 859189832) {
return new Pair<>("video/3gpp", null);
}
if (p10 == 826496599) {
byte[] d10 = yVar.d();
for (int c10 = yVar.c() + 20; c10 < d10.length - 4; c10++) {
if (d10[c10] == 0 && d10[c10 + 1] == 0 && d10[c10 + 2] == 1 && d10[c10 + 3] == 15) {
return new Pair<>("video/wvc1", Collections.singletonList(Arrays.copyOfRange(d10, c10, d10.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<>("video/x-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 i10;
int i11;
try {
if (bArr[0] == 2) {
int i12 = 0;
int i13 = 1;
while (true) {
i10 = bArr[i13];
if ((i10 & 255) != 255) {
break;
}
i12 += 255;
i13++;
}
int i14 = i13 + 1;
int i15 = i12 + (i10 & 255);
int i16 = 0;
while (true) {
i11 = bArr[i14];
if ((i11 & 255) != 255) {
break;
}
i16 += 255;
i14++;
}
int i17 = i14 + 1;
int i18 = i16 + (i11 & 255);
if (bArr[i17] == 1) {
byte[] bArr2 = new byte[i15];
System.arraycopy(bArr, i17, bArr2, 0, i15);
int i19 = i17 + i15;
if (bArr[i19] == 3) {
int i20 = i19 + i18;
if (bArr[i20] == 5) {
byte[] bArr3 = new byte[bArr.length - i20];
System.arraycopy(bArr, i20, bArr3, 0, bArr.length - i20);
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.f5787j;
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", Integer.valueOf(SubsamplingScaleImageView.ORIENTATION_270));
f5749f = Collections.unmodifiableMap(hashMap);
}
public d() {
this(0);
}
private void e(int i10) throws com.applovin.exoplayer2.ai {
if (this.I == null || this.J == null) {
throw com.applovin.exoplayer2.ai.b("Element " + i10 + " must be in a Cues", null);
}
}
private b f(int i10) throws com.applovin.exoplayer2.ai {
d(i10);
return this.A;
}
private void g() {
com.applovin.exoplayer2.l.a.a(this.f5756ag);
}
public static h[] h() {
return new h[]{new d()};
}
@CallSuper
public int a(int i10) {
switch (i10) {
case ci.y.f2020q2:
case ci.y.f2045v2:
case 155:
case ci.y.S2:
case ci.y.f1986j3:
case ci.y.f2001m3:
case ci.y.f2036t3:
case ci.j.P0:
case 231:
case 238:
case 241:
case p.f1834o:
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 134:
case m.f935v:
case 21358:
case 2274716:
return 3;
case ci.y.T2:
case ci.y.Z2:
case ci.y.f1976h3:
case ci.y.f2021q3:
case ci.y.f2041u3:
case 224:
case p3.p.f37099m:
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 ci.y.U2:
case ci.y.W2:
case ci.y.Y2:
case 16877:
case 16981:
case 18402:
case 21419:
case 25506:
case 30322:
return 4;
case ci.y.f2011o3:
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 i10) {
return i10 == 357149030 || i10 == 524531317 || i10 == 475249515 || i10 == 374648427;
}
@Override
public final void c() {
}
public static final class c {
private final byte[] f5804a = new byte[10];
private boolean f5805b;
private int f5806c;
private long f5807d;
private int f5808e;
private int f5809f;
private int f5810g;
public void a() {
this.f5805b = false;
this.f5806c = 0;
}
public void a(i iVar) throws IOException {
if (this.f5805b) {
return;
}
iVar.d(this.f5804a, 0, 10);
iVar.a();
if (com.applovin.exoplayer2.b.b.b(this.f5804a) == 0) {
return;
}
this.f5805b = true;
}
public void a(b bVar, long j10, int i10, int i11, int i12) {
if (this.f5805b) {
int i13 = this.f5806c;
int i14 = i13 + 1;
this.f5806c = i14;
if (i13 == 0) {
this.f5807d = j10;
this.f5808e = i10;
this.f5809f = 0;
}
this.f5809f += i11;
this.f5810g = i12;
if (i14 >= 16) {
a(bVar);
}
}
}
public void a(b bVar) {
if (this.f5806c > 0) {
bVar.V.a(this.f5807d, this.f5808e, this.f5809f, this.f5810g, bVar.f5786i);
this.f5806c = 0;
}
}
}
public d(int i10) {
this(new com.applovin.exoplayer2.e.e.a(), i10);
}
private void d(int i10) throws com.applovin.exoplayer2.ai {
if (this.A != null) {
return;
}
throw com.applovin.exoplayer2.ai.b("Element " + i10 + " must be in a TrackEntry", null);
}
@CallSuper
public void c(int i10) throws com.applovin.exoplayer2.ai {
g();
if (i10 == 160) {
if (this.M != 2) {
return;
}
int i11 = 0;
for (int i12 = 0; i12 < this.Q; i12++) {
i11 += this.R[i12];
}
b bVar = this.f5759i.get(this.S);
bVar.d();
for (int i13 = 0; i13 < this.Q; i13++) {
long j10 = ((bVar.f5782e * i13) / 1000) + this.N;
int i14 = this.U;
if (i13 == 0 && !this.W) {
i14 |= 1;
}
int i15 = this.R[i13];
i11 -= i15;
a(bVar, j10, i14, i15, i11);
}
this.M = 0;
return;
}
if (i10 == 174) {
b bVar2 = (b) com.applovin.exoplayer2.l.a.a(this.A);
String str = bVar2.f5779b;
if (str != null) {
if (a(str)) {
bVar2.a(this.f5756ag, bVar2.f5780c);
this.f5759i.put(bVar2.f5780c, bVar2);
}
this.A = null;
return;
}
throw com.applovin.exoplayer2.ai.b("CodecId is missing in TrackEntry element", null);
}
if (i10 == 19899) {
int i16 = this.C;
if (i16 != -1) {
long j11 = this.D;
if (j11 != -1) {
if (i16 == 475249515) {
this.F = j11;
return;
}
return;
}
}
throw com.applovin.exoplayer2.ai.b("Mandatory element SeekID or SeekPosition not found", null);
}
if (i10 == 25152) {
d(i10);
b bVar3 = this.A;
if (bVar3.f5784g) {
if (bVar3.f5786i != null) {
bVar3.f5788k = new com.applovin.exoplayer2.d.e(new e.a(com.applovin.exoplayer2.h.f6864a, "video/webm", this.A.f5786i.f6545b));
return;
}
throw com.applovin.exoplayer2.ai.b("Encrypted Track found but ContentEncKeyID was not found", null);
}
return;
}
if (i10 == 28032) {
d(i10);
b bVar4 = this.A;
if (bVar4.f5784g && bVar4.f5785h != null) {
throw com.applovin.exoplayer2.ai.b("Combining encryption and compression is not supported", null);
}
return;
}
if (i10 == 357149030) {
if (this.f5774x == -9223372036854775807L) {
this.f5774x = 1000000L;
}
long j12 = this.f5775y;
if (j12 != -9223372036854775807L) {
this.f5776z = a(j12);
return;
}
return;
}
if (i10 == 374648427) {
if (this.f5759i.size() != 0) {
this.f5756ag.a();
return;
}
throw com.applovin.exoplayer2.ai.b("No valid tracks were found", null);
}
if (i10 != 475249515) {
return;
}
if (!this.B) {
this.f5756ag.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 i10) {
this.f5773w = -1L;
this.f5774x = -9223372036854775807L;
this.f5775y = -9223372036854775807L;
this.f5776z = -9223372036854775807L;
this.F = -1L;
this.G = -1L;
this.H = -9223372036854775807L;
this.f5757g = cVar;
cVar.a(new a());
this.f5760j = (i10 & 1) == 0;
this.f5758h = new f();
this.f5759i = new SparseArray<>();
this.f5763m = new y(4);
this.f5764n = new y(ByteBuffer.allocate(4).putInt(-1).array());
this.f5765o = new y(4);
this.f5761k = new y(com.applovin.exoplayer2.l.v.f8056a);
this.f5762l = new y(4);
this.f5766p = new y();
this.f5767q = new y();
this.f5768r = new y(8);
this.f5769s = new y();
this.f5770t = new y();
this.R = new int[1];
}
private int e() {
int i10 = this.Y;
f();
return i10;
}
private void f() {
this.X = 0;
this.Y = 0;
this.Z = 0;
this.f5750aa = false;
this.f5751ab = false;
this.f5752ac = false;
this.f5753ad = 0;
this.f5754ae = (byte) 0;
this.f5755af = false;
this.f5766p.a(0);
}
@Override
public final boolean a(i iVar) throws IOException {
return new e().a(iVar);
}
@Override
public final void a(j jVar) {
this.f5756ag = jVar;
}
@Override
@CallSuper
public void a(long j10, long j11) {
this.H = -9223372036854775807L;
this.M = 0;
this.f5757g.a();
this.f5758h.a();
f();
for (int i10 = 0; i10 < this.f5759i.size(); i10++) {
this.f5759i.valueAt(i10).b();
}
}
@Override
public final int a(i iVar, com.applovin.exoplayer2.e.u uVar) throws IOException {
this.L = false;
boolean z10 = true;
while (z10 && !this.L) {
z10 = this.f5757g.a(iVar);
if (z10 && a(uVar, iVar.c())) {
return 1;
}
}
if (z10) {
return 0;
}
for (int i10 = 0; i10 < this.f5759i.size(); i10++) {
b valueAt = this.f5759i.valueAt(i10);
valueAt.d();
valueAt.a();
}
return -1;
}
@CallSuper
public void a(int i10, long j10, long j11) throws com.applovin.exoplayer2.ai {
g();
if (i10 == 160) {
this.W = false;
return;
}
if (i10 == 174) {
this.A = new b();
return;
}
if (i10 == 187) {
this.K = false;
return;
}
if (i10 == 19899) {
this.C = -1;
this.D = -1L;
return;
}
if (i10 == 20533) {
f(i10).f5784g = true;
return;
}
if (i10 == 21968) {
f(i10).f5800w = true;
return;
}
if (i10 == 408125543) {
long j12 = this.f5773w;
if (j12 != -1 && j12 != j10) {
throw com.applovin.exoplayer2.ai.b("Multiple Segment elements not supported", null);
}
this.f5773w = j10;
this.f5772v = j11;
return;
}
if (i10 != 475249515) {
if (i10 == 524531317 && !this.B) {
if (this.f5760j && this.F != -1) {
this.E = true;
return;
} else {
this.f5756ag.a(new v.b(this.f5776z));
this.B = true;
return;
}
}
return;
}
this.I = new r();
this.J = new r();
}
@CallSuper
public void a(int i10, long j10) throws com.applovin.exoplayer2.ai {
if (i10 == 20529) {
if (j10 == 0) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncodingOrder " + j10 + " not supported", null);
}
if (i10 == 20530) {
if (j10 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncodingScope " + j10 + " not supported", null);
}
switch (i10) {
case ci.y.f2020q2:
f(i10).f5781d = (int) j10;
return;
case ci.y.f2045v2:
f(i10).U = j10 == 1;
return;
case 155:
this.O = a(j10);
return;
case ci.y.S2:
f(i10).N = (int) j10;
return;
case ci.y.f1986j3:
f(i10).f5789l = (int) j10;
return;
case ci.y.f2001m3:
e(i10);
this.I.a(a(j10));
return;
case ci.y.f2036t3:
f(i10).f5790m = (int) j10;
return;
case ci.j.P0:
f(i10).f5780c = (int) j10;
return;
case 231:
this.H = a(j10);
return;
case 238:
this.V = (int) j10;
return;
case 241:
if (this.K) {
return;
}
e(i10);
this.J.a(j10);
this.K = true;
return;
case p.f1834o:
this.W = true;
return;
case 16871:
f(i10).X = (int) j10;
return;
case 16980:
if (j10 == 3) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentCompAlgo " + j10 + " not supported", null);
case 17029:
if (j10 < 1 || j10 > 2) {
throw com.applovin.exoplayer2.ai.b("DocTypeReadVersion " + j10 + " not supported", null);
}
return;
case 17143:
if (j10 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("EBMLReadVersion " + j10 + " not supported", null);
case 18401:
if (j10 == 5) {
return;
}
throw com.applovin.exoplayer2.ai.b("ContentEncAlgo " + j10 + " not supported", null);
case 18408:
if (j10 == 1) {
return;
}
throw com.applovin.exoplayer2.ai.b("AESSettingsCipherMode " + j10 + " not supported", null);
case 21420:
this.D = j10 + this.f5773w;
return;
case 21432:
int i11 = (int) j10;
d(i10);
if (i11 == 0) {
this.A.f5799v = 0;
return;
}
if (i11 == 1) {
this.A.f5799v = 2;
return;
} else if (i11 == 3) {
this.A.f5799v = 1;
return;
} else {
if (i11 != 15) {
return;
}
this.A.f5799v = 3;
return;
}
case 21680:
f(i10).f5791n = (int) j10;
return;
case 21682:
f(i10).f5793p = (int) j10;
return;
case 21690:
f(i10).f5792o = (int) j10;
return;
case 21930:
f(i10).T = j10 == 1;
return;
case 21998:
f(i10).f5783f = (int) j10;
return;
case 22186:
f(i10).Q = j10;
return;
case 22203:
f(i10).R = j10;
return;
case 25188:
f(i10).O = (int) j10;
return;
case 30321:
d(i10);
int i12 = (int) j10;
if (i12 == 0) {
this.A.f5794q = 0;
return;
}
if (i12 == 1) {
this.A.f5794q = 1;
return;
} else if (i12 == 2) {
this.A.f5794q = 2;
return;
} else {
if (i12 != 3) {
return;
}
this.A.f5794q = 3;
return;
}
case 2352003:
f(i10).f5782e = (int) j10;
return;
case 2807729:
this.f5774x = j10;
return;
default:
switch (i10) {
case 21945:
d(i10);
int i13 = (int) j10;
if (i13 == 1) {
this.A.f5803z = 2;
return;
} else {
if (i13 != 2) {
return;
}
this.A.f5803z = 1;
return;
}
case 21946:
d(i10);
int b10 = com.applovin.exoplayer2.m.b.b((int) j10);
if (b10 != -1) {
this.A.f5802y = b10;
return;
}
return;
case 21947:
d(i10);
this.A.f5800w = true;
int a10 = com.applovin.exoplayer2.m.b.a((int) j10);
if (a10 != -1) {
this.A.f5801x = a10;
return;
}
return;
case 21948:
f(i10).A = (int) j10;
return;
case 21949:
f(i10).B = (int) j10;
return;
default:
return;
}
}
}
@CallSuper
public void a(int i10, double d10) throws com.applovin.exoplayer2.ai {
if (i10 == 181) {
f(i10).P = (int) d10;
return;
}
if (i10 != 17545) {
switch (i10) {
case 21969:
f(i10).C = (float) d10;
return;
case 21970:
f(i10).D = (float) d10;
return;
case 21971:
f(i10).E = (float) d10;
return;
case 21972:
f(i10).F = (float) d10;
return;
case 21973:
f(i10).G = (float) d10;
return;
case 21974:
f(i10).H = (float) d10;
return;
case 21975:
f(i10).I = (float) d10;
return;
case 21976:
f(i10).J = (float) d10;
return;
case 21977:
f(i10).K = (float) d10;
return;
case 21978:
f(i10).L = (float) d10;
return;
default:
switch (i10) {
case 30323:
f(i10).f5795r = (float) d10;
return;
case 30324:
f(i10).f5796s = (float) d10;
return;
case 30325:
f(i10).f5797t = (float) d10;
return;
default:
return;
}
}
}
this.f5775y = (long) d10;
}
@CallSuper
public void a(int i10, String str) throws com.applovin.exoplayer2.ai {
if (i10 == 134) {
f(i10).f5779b = str;
return;
}
if (i10 != 17026) {
if (i10 == 21358) {
f(i10).f5778a = str;
return;
} else {
if (i10 != 2274716) {
return;
}
f(i10).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 i10, int i11, i iVar) throws IOException {
b bVar;
int i12;
b bVar2;
b bVar3;
long j10;
int i13;
int i14;
int i15;
int i16 = 0;
int i17 = 1;
if (i10 != 161 && i10 != 163) {
if (i10 == 165) {
if (this.M != 2) {
return;
}
a(this.f5759i.get(this.S), this.V, iVar, i11);
return;
}
if (i10 == 16877) {
a(f(i10), iVar, i11);
return;
}
if (i10 == 16981) {
d(i10);
byte[] bArr = new byte[i11];
this.A.f5785h = bArr;
iVar.b(bArr, 0, i11);
return;
}
if (i10 == 18402) {
byte[] bArr2 = new byte[i11];
iVar.b(bArr2, 0, i11);
f(i10).f5786i = new x.a(1, bArr2, 0, 0);
return;
}
if (i10 == 21419) {
Arrays.fill(this.f5765o.d(), (byte) 0);
iVar.b(this.f5765o.d(), 4 - i11, i11);
this.f5765o.d(0);
this.C = (int) this.f5765o.o();
return;
}
if (i10 == 25506) {
d(i10);
byte[] bArr3 = new byte[i11];
this.A.f5787j = bArr3;
iVar.b(bArr3, 0, i11);
return;
}
if (i10 == 30322) {
d(i10);
byte[] bArr4 = new byte[i11];
this.A.f5798u = bArr4;
iVar.b(bArr4, 0, i11);
return;
}
throw com.applovin.exoplayer2.ai.b("Unexpected id: " + i10, null);
}
if (this.M == 0) {
this.S = (int) this.f5758h.a(iVar, false, true, 8);
this.T = this.f5758h.b();
this.O = -9223372036854775807L;
this.M = 1;
this.f5763m.a(0);
}
b bVar4 = this.f5759i.get(this.S);
if (bVar4 != null) {
bVar4.d();
if (this.M == 1) {
a(iVar, 3);
int i18 = (this.f5763m.d()[2] & 6) >> 1;
byte b10 = 255;
if (i18 == 0) {
this.Q = 1;
int[] a10 = a(this.R, 1);
this.R = a10;
a10[0] = (i11 - this.T) - 3;
} else {
int i19 = 4;
a(iVar, 4);
int i20 = (this.f5763m.d()[3] & 255) + 1;
this.Q = i20;
int[] a11 = a(this.R, i20);
this.R = a11;
if (i18 == 2) {
int i21 = (i11 - this.T) - 4;
int i22 = this.Q;
Arrays.fill(a11, 0, i22, i21 / i22);
} else if (i18 == 1) {
int i23 = 0;
int i24 = 0;
while (true) {
i13 = this.Q;
if (i23 >= i13 - 1) {
break;
}
this.R[i23] = 0;
do {
i19++;
a(iVar, i19);
i14 = this.f5763m.d()[i19 - 1] & 255;
int[] iArr = this.R;
i15 = iArr[i23] + i14;
iArr[i23] = i15;
} while (i14 == 255);
i24 += i15;
i23++;
}
this.R[i13 - 1] = ((i11 - this.T) - i19) - i24;
} else {
if (i18 != 3) {
throw com.applovin.exoplayer2.ai.b("Unexpected lacing value: " + i18, null);
}
int i25 = 0;
int i26 = 0;
while (true) {
int i27 = this.Q;
if (i25 < i27 - 1) {
this.R[i25] = i16;
i19++;
a(iVar, i19);
int i28 = i19 - 1;
if (this.f5763m.d()[i28] == 0) {
throw com.applovin.exoplayer2.ai.b("No valid varint length mask found", null);
}
int i29 = i16;
while (true) {
if (i29 >= 8) {
bVar3 = bVar4;
j10 = 0;
break;
}
int i30 = i17 << (7 - i29);
if ((this.f5763m.d()[i28] & i30) != 0) {
int i31 = i19 + i29;
a(iVar, i31);
bVar3 = bVar4;
j10 = (~i30) & this.f5763m.d()[i28] & b10;
int i32 = i28 + 1;
while (i32 < i31) {
j10 = (j10 << 8) | (this.f5763m.d()[i32] & b10);
i32++;
i31 = i31;
b10 = 255;
}
int i33 = i31;
if (i25 > 0) {
j10 -= (1 << ((i29 * 7) + 6)) - 1;
}
i19 = i33;
} else {
i29++;
i17 = 1;
b10 = 255;
}
}
if (j10 < -2147483648L || j10 > 2147483647L) {
break;
}
int i34 = (int) j10;
int[] iArr2 = this.R;
if (i25 != 0) {
i34 += iArr2[i25 - 1];
}
iArr2[i25] = i34;
i26 += i34;
i25++;
bVar4 = bVar3;
i16 = 0;
i17 = 1;
b10 = 255;
} else {
bVar2 = bVar4;
this.R[i27 - 1] = ((i11 - this.T) - i19) - i26;
break;
}
}
}
}
bVar2 = bVar4;
this.N = this.H + a((this.f5763m.d()[0] << 8) | (this.f5763m.d()[1] & 255));
bVar = bVar2;
this.U = (bVar.f5781d == 2 || (i10 == 163 && (this.f5763m.d()[2] & 128) == 128)) ? 1 : 0;
this.M = 2;
this.P = 0;
i12 = ci.y.W2;
} else {
bVar = bVar4;
i12 = 163;
}
if (i10 == i12) {
while (true) {
int i35 = this.P;
if (i35 < this.Q) {
a(bVar, ((this.P * bVar.f5782e) / 1000) + this.N, this.U, a(iVar, bVar, this.R[i35]), 0);
this.P++;
} else {
this.M = 0;
return;
}
}
} else {
while (true) {
int i36 = this.P;
if (i36 >= this.Q) {
return;
}
int[] iArr3 = this.R;
iArr3[i36] = a(iVar, bVar, iArr3[i36]);
this.P++;
}
}
} else {
iVar.b(i11 - this.T);
this.M = 0;
}
}
public void a(b bVar, i iVar, int i10) throws IOException {
if (bVar.X != 1685485123 && bVar.X != 1685480259) {
iVar.b(i10);
return;
}
byte[] bArr = new byte[i10];
bVar.M = bArr;
iVar.b(bArr, 0, i10);
}
public void a(b bVar, int i10, i iVar, int i11) throws IOException {
if (i10 == 4 && "V_VP9".equals(bVar.f5779b)) {
this.f5770t.a(i11);
iVar.b(this.f5770t.d(), 0, i11);
} else {
iVar.b(i11);
}
}
private void a(b bVar, long j10, int i10, int i11, int i12) {
c cVar = bVar.S;
if (cVar != null) {
cVar.a(bVar, j10, i10, i11, i12);
} else {
if ("S_TEXT/UTF8".equals(bVar.f5779b) || "S_TEXT/ASS".equals(bVar.f5779b)) {
if (this.Q > 1) {
q.c("MatroskaExtractor", "Skipping subtitle sample in laced block.");
} else {
long j11 = this.O;
if (j11 == -9223372036854775807L) {
q.c("MatroskaExtractor", "Skipping subtitle sample with no duration.");
} else {
a(bVar.f5779b, j11, this.f5767q.d());
int c10 = this.f5767q.c();
while (true) {
if (c10 >= this.f5767q.b()) {
break;
}
if (this.f5767q.d()[c10] == 0) {
this.f5767q.c(c10);
break;
}
c10++;
}
x xVar = bVar.V;
y yVar = this.f5767q;
xVar.a(yVar, yVar.b());
i11 += this.f5767q.b();
}
}
}
if ((268435456 & i10) != 0) {
if (this.Q > 1) {
i10 &= -268435457;
} else {
int b10 = this.f5770t.b();
bVar.V.a(this.f5770t, b10, 2);
i11 += b10;
}
}
bVar.V.a(j10, i10, i11, i12, bVar.f5786i);
}
this.L = true;
}
private void a(i iVar, int i10) throws IOException {
if (this.f5763m.b() >= i10) {
return;
}
if (this.f5763m.e() < i10) {
y yVar = this.f5763m;
yVar.b(Math.max(yVar.e() * 2, i10));
}
iVar.b(this.f5763m.d(), this.f5763m.b(), i10 - this.f5763m.b());
this.f5763m.c(i10);
}
private int a(i iVar, b bVar, int i10) throws IOException {
int i11;
if ("S_TEXT/UTF8".equals(bVar.f5779b)) {
a(iVar, f5745b, i10);
return e();
}
if ("S_TEXT/ASS".equals(bVar.f5779b)) {
a(iVar, f5747d, i10);
return e();
}
x xVar = bVar.V;
if (!this.f5750aa) {
if (bVar.f5784g) {
this.U &= -1073741825;
if (!this.f5751ab) {
iVar.b(this.f5763m.d(), 0, 1);
this.X++;
if ((this.f5763m.d()[0] & 128) != 128) {
this.f5754ae = this.f5763m.d()[0];
this.f5751ab = true;
} else {
throw com.applovin.exoplayer2.ai.b("Extension bit is set in signal byte", null);
}
}
byte b10 = this.f5754ae;
if ((b10 & 1) == 1) {
boolean z10 = (b10 & 2) == 2;
this.U |= 1073741824;
if (!this.f5755af) {
iVar.b(this.f5768r.d(), 0, 8);
this.X += 8;
this.f5755af = true;
this.f5763m.d()[0] = (byte) ((z10 ? 128 : 0) | 8);
this.f5763m.d(0);
xVar.a(this.f5763m, 1, 1);
this.Y++;
this.f5768r.d(0);
xVar.a(this.f5768r, 8, 1);
this.Y += 8;
}
if (z10) {
if (!this.f5752ac) {
iVar.b(this.f5763m.d(), 0, 1);
this.X++;
this.f5763m.d(0);
this.f5753ad = this.f5763m.h();
this.f5752ac = true;
}
int i12 = this.f5753ad * 4;
this.f5763m.a(i12);
iVar.b(this.f5763m.d(), 0, i12);
this.X += i12;
short s10 = (short) ((this.f5753ad / 2) + 1);
int i13 = (s10 * 6) + 2;
ByteBuffer byteBuffer = this.f5771u;
if (byteBuffer == null || byteBuffer.capacity() < i13) {
this.f5771u = ByteBuffer.allocate(i13);
}
this.f5771u.position(0);
this.f5771u.putShort(s10);
int i14 = 0;
int i15 = 0;
while (true) {
i11 = this.f5753ad;
if (i14 >= i11) {
break;
}
int w10 = this.f5763m.w();
if (i14 % 2 == 0) {
this.f5771u.putShort((short) (w10 - i15));
} else {
this.f5771u.putInt(w10 - i15);
}
i14++;
i15 = w10;
}
int i16 = (i10 - this.X) - i15;
if (i11 % 2 == 1) {
this.f5771u.putInt(i16);
} else {
this.f5771u.putShort((short) i16);
this.f5771u.putInt(0);
}
this.f5769s.a(this.f5771u.array(), i13);
xVar.a(this.f5769s, i13, 1);
this.Y += i13;
}
}
} else {
byte[] bArr = bVar.f5785h;
if (bArr != null) {
this.f5766p.a(bArr, bArr.length);
}
}
if (bVar.f5783f > 0) {
this.U |= 268435456;
this.f5770t.a(0);
this.f5763m.a(4);
this.f5763m.d()[0] = (byte) ((i10 >> 24) & 255);
this.f5763m.d()[1] = (byte) ((i10 >> 16) & 255);
this.f5763m.d()[2] = (byte) ((i10 >> 8) & 255);
this.f5763m.d()[3] = (byte) (i10 & 255);
xVar.a(this.f5763m, 4, 2);
this.Y += 4;
}
this.f5750aa = true;
}
int b11 = this.f5766p.b() + i10;
if (!"V_MPEG4/ISO/AVC".equals(bVar.f5779b) && !"V_MPEGH/ISO/HEVC".equals(bVar.f5779b)) {
if (bVar.S != null) {
com.applovin.exoplayer2.l.a.b(this.f5766p.b() == 0);
bVar.S.a(iVar);
}
while (true) {
int i17 = this.X;
if (i17 >= b11) {
break;
}
int a10 = a(iVar, xVar, b11 - i17);
this.X += a10;
this.Y += a10;
}
} else {
byte[] d10 = this.f5762l.d();
d10[0] = 0;
d10[1] = 0;
d10[2] = 0;
int i18 = bVar.W;
int i19 = 4 - i18;
while (this.X < b11) {
int i20 = this.Z;
if (i20 == 0) {
a(iVar, d10, i19, i18);
this.X += i18;
this.f5762l.d(0);
this.Z = this.f5762l.w();
this.f5761k.d(0);
xVar.a(this.f5761k, 4);
this.Y += 4;
} else {
int a11 = a(iVar, xVar, i20);
this.X += a11;
this.Y += a11;
this.Z -= a11;
}
}
}
if ("A_VORBIS".equals(bVar.f5779b)) {
this.f5764n.d(0);
xVar.a(this.f5764n, 4);
this.Y += 4;
}
return e();
}
private void a(i iVar, byte[] bArr, int i10) throws IOException {
int length = bArr.length + i10;
if (this.f5767q.e() < length) {
this.f5767q.a(Arrays.copyOf(bArr, length + i10));
} else {
System.arraycopy(bArr, 0, this.f5767q.d(), 0, bArr.length);
}
iVar.b(this.f5767q.d(), bArr.length, i10);
this.f5767q.d(0);
this.f5767q.c(length);
}
private static void a(String str, long j10, byte[] bArr) {
byte[] a10;
int i10;
str.getClass();
if (str.equals("S_TEXT/ASS")) {
a10 = a(j10, "%01d:%02d:%02d:%02d", 10000L);
i10 = 21;
} else if (str.equals("S_TEXT/UTF8")) {
a10 = a(j10, "%02d:%02d:%02d,%03d", 1000L);
i10 = 19;
} else {
throw new IllegalArgumentException();
}
System.arraycopy(a10, 0, bArr, i10, a10.length);
}
private static byte[] a(long j10, String str, long j11) {
com.applovin.exoplayer2.l.a.a(j10 != -9223372036854775807L);
int i10 = (int) (j10 / 3600000000L);
long j12 = j10 - ((i10 * 3600) * 1000000);
int i11 = (int) (j12 / 60000000);
long j13 = j12 - ((i11 * 60) * 1000000);
int i12 = (int) (j13 / 1000000);
return ai.c(String.format(Locale.US, str, Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf((int) ((j13 - (i12 * 1000000)) / j11))));
}
private void a(i iVar, byte[] bArr, int i10, int i11) throws IOException {
int min = Math.min(i11, this.f5766p.a());
iVar.b(bArr, i10 + min, i11 - min);
if (min > 0) {
this.f5766p.a(bArr, i10, min);
}
}
private int a(i iVar, x xVar, int i10) throws IOException {
int a10 = this.f5766p.a();
if (a10 > 0) {
int min = Math.min(i10, a10);
xVar.a(this.f5766p, min);
return min;
}
return xVar.a((com.applovin.exoplayer2.k.g) iVar, i10, false);
}
private com.applovin.exoplayer2.e.v a(@Nullable r rVar, @Nullable r rVar2) {
int i10;
if (this.f5773w != -1 && this.f5776z != -9223372036854775807L && rVar != null && rVar.a() != 0 && rVar2 != null && rVar2.a() == rVar.a()) {
int a10 = rVar.a();
int[] iArr = new int[a10];
long[] jArr = new long[a10];
long[] jArr2 = new long[a10];
long[] jArr3 = new long[a10];
int i11 = 0;
for (int i12 = 0; i12 < a10; i12++) {
jArr3[i12] = rVar.a(i12);
jArr[i12] = rVar2.a(i12) + this.f5773w;
}
while (true) {
i10 = a10 - 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.f5773w + this.f5772v) - jArr[i10]);
long j10 = this.f5776z - jArr3[i10];
jArr2[i10] = j10;
if (j10 <= 0) {
q.c("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 com.applovin.exoplayer2.e.c(iArr, jArr, jArr2, jArr3);
}
return new v.b(this.f5776z);
}
private boolean a(com.applovin.exoplayer2.e.u uVar, long j10) {
if (this.E) {
this.G = j10;
uVar.f6536a = this.F;
this.E = false;
return true;
}
if (this.B) {
long j11 = this.G;
if (j11 != -1) {
uVar.f6536a = j11;
this.G = -1L;
return true;
}
}
return false;
}
private long a(long j10) throws com.applovin.exoplayer2.ai {
long j11 = this.f5774x;
if (j11 != -9223372036854775807L) {
return ai.d(j10, j11, 1000L);
}
throw com.applovin.exoplayer2.ai.b("Can't scale timecode prior to timecodeScale being set.", null);
}
private static boolean a(String str) {
str.getClass();
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 1422270023:
if (str.equals("S_TEXT/UTF8")) {
c10 = 27;
break;
}
break;
case 1809237540:
if (str.equals("V_MPEG2")) {
c10 = w9.b.f40805n;
break;
}
break;
case 1950749482:
if (str.equals("A_EAC3")) {
c10 = w9.b.f40806o;
break;
}
break;
case 1950789798:
if (str.equals("A_FLAC")) {
c10 = w9.b.f40807p;
break;
}
break;
case 1951062397:
if (str.equals("A_OPUS")) {
c10 = y6.c.f41315b;
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:
return true;
default:
return false;
}
}
private static int[] a(@Nullable int[] iArr, int i10) {
if (iArr == null) {
return new int[i10];
}
return iArr.length >= i10 ? iArr : new int[Math.max(iArr.length * 2, i10)];
}
}