APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:eSamudaay Seller
版本号:0.6.80
包名称:in.foore.mobile

MD5 校验值:63f8e52e07318fa084f03ba71262387f

反编译源代码说明

e.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package a2;

import android.net.Uri;
import android.util.Pair;
import android.util.SparseArray;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.toolbox.i;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import m3.a0;
import m3.n0;
import m3.s;
import m3.v;
import m3.w;
import p1.n1;
import p1.u2;
import r1.a;
import t1.m;
import u1.b0;
import u1.e0;
import u1.f0;
import u1.l;
import u1.m;
import u1.n;
import u1.q;
import u1.r;
import w4.u;

public class e implements l {

    public static final r f24c0 = new r() {
        @Override
        public final l[] a() {
            l[] A;
            A = e.A();
            return A;
        }

        @Override
        public l[] b(Uri uri, Map map) {
            return q.a(this, uri, map);
        }
    };

    private static final byte[] f25d0 = {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[] f26e0 = n0.l0("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");

    private static final byte[] f27f0 = {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 byte[] f28g0 = {87, 69, 66, 86, 84, 84, 10, 10, 48, 48, 58, 48, 48, 58, 48, 48, 46, 48, 48, 48, 32, 45, 45, 62, 32, 48, 48, 58, 48, 48, 58, 48, 48, 46, 48, 48, 48, 10};

    private static final UUID f29h0 = new UUID(72057594037932032L, -9223371306706625679L);

    private static final Map<String, Integer> f30i0;
    private long A;
    private long B;
    private s C;
    private s D;
    private boolean E;
    private boolean F;
    private int G;
    private long H;
    private long I;
    private int J;
    private int K;
    private int[] L;
    private int M;
    private int N;
    private int O;
    private int P;
    private boolean Q;
    private long R;
    private int S;
    private int T;
    private int U;
    private boolean V;
    private boolean W;
    private boolean X;
    private int Y;
    private byte Z;

    private final a2.c f31a;

    private boolean f32a0;

    private final g f33b;

    private n f34b0;

    private final SparseArray<c> f35c;

    private final boolean f36d;

    private final a0 f37e;

    private final a0 f38f;

    private final a0 f39g;

    private final a0 f40h;

    private final a0 f41i;

    private final a0 f42j;

    private final a0 f43k;

    private final a0 f44l;

    private final a0 f45m;

    private final a0 f46n;

    private ByteBuffer f47o;

    private long f48p;

    private long f49q;

    private long f50r;

    private long f51s;

    private long f52t;

    private c f53u;

    private boolean f54v;

    private int f55w;

    private long f56x;

    private boolean f57y;

    private long f58z;

    private final class b implements a2.b {
        private b() {
        }

        @Override
        public void a(int i10) {
            e.this.o(i10);
        }

        @Override
        public int b(int i10) {
            return e.this.u(i10);
        }

        @Override
        public boolean c(int i10) {
            return e.this.z(i10);
        }

        @Override
        public void d(int i10, String str) {
            e.this.H(i10, str);
        }

        @Override
        public void e(int i10, double d10) {
            e.this.r(i10, d10);
        }

        @Override
        public void f(int i10, int i11, m mVar) {
            e.this.l(i10, i11, mVar);
        }

        @Override
        public void g(int i10, long j10, long j11) {
            e.this.G(i10, j10, j11);
        }

        @Override
        public void h(int i10, long j10) {
            e.this.x(i10, j10);
        }
    }

    public static final class c {
        public byte[] N;
        public f0 T;
        public boolean U;
        public e0 X;
        public int Y;

        public String f60a;

        public String f61b;

        public int f62c;

        public int f63d;

        public int f64e;

        public int f65f;

        private int f66g;

        public boolean f67h;

        public byte[] f68i;

        public e0.a f69j;

        public byte[] f70k;

        public t1.m f71l;

        public int f72m = -1;

        public int f73n = -1;

        public int f74o = -1;

        public int f75p = -1;

        public int f76q = 0;

        public int f77r = -1;

        public float f78s = 0.0f;

        public float f79t = 0.0f;

        public float f80u = 0.0f;

        public byte[] f81v = null;

        public int f82w = -1;

        public boolean f83x = false;

        public int f84y = -1;

        public int f85z = -1;
        public int A = -1;
        public int B = i.DEFAULT_IMAGE_TIMEOUT_MS;
        public int C = 200;
        public float D = -1.0f;
        public float E = -1.0f;
        public float F = -1.0f;
        public float G = -1.0f;
        public float H = -1.0f;
        public float I = -1.0f;
        public float J = -1.0f;
        public float K = -1.0f;
        public float L = -1.0f;
        public float M = -1.0f;
        public int O = 1;
        public int P = -1;
        public int Q = 8000;
        public long R = 0;
        public long S = 0;
        public boolean V = true;
        private String W = "eng";

        protected c() {
        }

        public void f() {
            m3.a.e(this.X);
        }

        private byte[] g(String str) {
            byte[] bArr = this.f70k;
            if (bArr != null) {
                return bArr;
            }
            throw u2.a("Missing CodecPrivate for codec " + str, null);
        }

        private byte[] h() {
            if (this.D == -1.0f || this.E == -1.0f || this.F == -1.0f || this.G == -1.0f || this.H == -1.0f || this.I == -1.0f || this.J == -1.0f || this.K == -1.0f || this.L == -1.0f || this.M == -1.0f) {
                return null;
            }
            byte[] bArr = new byte[25];
            ByteBuffer order = ByteBuffer.wrap(bArr).order(ByteOrder.LITTLE_ENDIAN);
            order.put((byte) 0);
            order.putShort((short) ((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 * 50000.0f) + 0.5f));
            order.putShort((short) (this.L + 0.5f));
            order.putShort((short) (this.M + 0.5f));
            order.putShort((short) this.B);
            order.putShort((short) this.C);
            return bArr;
        }

        private static Pair<String, List<byte[]>> k(a0 a0Var) {
            try {
                a0Var.U(16);
                long w10 = a0Var.w();
                if (w10 == 1482049860) {
                    return new Pair<>("video/divx", null);
                }
                if (w10 == 859189832) {
                    return new Pair<>("video/3gpp", null);
                }
                if (w10 != 826496599) {
                    m3.r.i("MatroskaExtractor", "Unknown FourCC. Setting mimeType to video/x-unknown");
                    return new Pair<>("video/x-unknown", null);
                }
                byte[] e10 = a0Var.e();
                for (int f10 = a0Var.f() + 20; f10 < e10.length - 4; f10++) {
                    if (e10[f10] == 0 && e10[f10 + 1] == 0 && e10[f10 + 2] == 1 && e10[f10 + 3] == 15) {
                        return new Pair<>("video/wvc1", Collections.singletonList(Arrays.copyOfRange(e10, f10, e10.length)));
                    }
                }
                throw u2.a("Failed to find FourCC VC1 initialization data", null);
            } catch (ArrayIndexOutOfBoundsException unused) {
                throw u2.a("Error parsing FourCC private data", null);
            }
        }

        private static boolean l(a0 a0Var) {
            try {
                int y10 = a0Var.y();
                if (y10 == 1) {
                    return true;
                }
                if (y10 != 65534) {
                    return false;
                }
                a0Var.T(24);
                if (a0Var.z() == e.f29h0.getMostSignificantBits()) {
                    if (a0Var.z() == e.f29h0.getLeastSignificantBits()) {
                        return true;
                    }
                }
                return false;
            } catch (ArrayIndexOutOfBoundsException unused) {
                throw u2.a("Error parsing MS/ACM codec private", null);
            }
        }

        private static List<byte[]> m(byte[] bArr) {
            try {
                if (bArr[0] != 2) {
                    throw u2.a("Error parsing vorbis codec private", null);
                }
                int i10 = 0;
                int i11 = 1;
                while ((bArr[i11] & 255) == 255) {
                    i10 += 255;
                    i11++;
                }
                int i12 = i11 + 1;
                int i13 = i10 + (bArr[i11] & 255);
                int i14 = 0;
                while ((bArr[i12] & 255) == 255) {
                    i14 += 255;
                    i12++;
                }
                int i15 = i12 + 1;
                int i16 = i14 + (bArr[i12] & 255);
                if (bArr[i15] != 1) {
                    throw u2.a("Error parsing vorbis codec private", null);
                }
                byte[] bArr2 = new byte[i13];
                System.arraycopy(bArr, i15, bArr2, 0, i13);
                int i17 = i15 + i13;
                if (bArr[i17] != 3) {
                    throw u2.a("Error parsing vorbis codec private", null);
                }
                int i18 = i17 + i16;
                if (bArr[i18] != 5) {
                    throw u2.a("Error parsing vorbis codec private", null);
                }
                byte[] bArr3 = new byte[bArr.length - i18];
                System.arraycopy(bArr, i18, bArr3, 0, bArr.length - i18);
                ArrayList arrayList = new ArrayList(2);
                arrayList.add(bArr2);
                arrayList.add(bArr3);
                return arrayList;
            } catch (ArrayIndexOutOfBoundsException unused) {
                throw u2.a("Error parsing vorbis codec private", null);
            }
        }

        public boolean o(boolean z10) {
            return "A_OPUS".equals(this.f61b) ? z10 : this.f65f > 0;
        }

        public void i(n nVar, int i10) {
            char c10;
            List<byte[]> singletonList;
            StringBuilder sb;
            int b02;
            String str;
            String str2;
            List<byte[]> list;
            String str3;
            int i11;
            int i12;
            String str4;
            n1.b bVar;
            int i13;
            int i14;
            int i15;
            n3.d a10;
            String str5 = this.f61b;
            str5.hashCode();
            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 1045209816:
                    if (str5.equals("S_TEXT/WEBVTT")) {
                        c10 = 27;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1422270023:
                    if (str5.equals("S_TEXT/UTF8")) {
                        c10 = 28;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1809237540:
                    if (str5.equals("V_MPEG2")) {
                        c10 = 29;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1950749482:
                    if (str5.equals("A_EAC3")) {
                        c10 = 30;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1950789798:
                    if (str5.equals("A_FLAC")) {
                        c10 = 31;
                        break;
                    }
                    c10 = 65535;
                    break;
                case 1951062397:
                    if (str5.equals("A_OPUS")) {
                        c10 = ' ';
                        break;
                    }
                    c10 = 65535;
                    break;
                default:
                    c10 = 65535;
                    break;
            }
            int i16 = RecyclerView.l.FLAG_APPEARED_IN_PRE_LAYOUT;
            String str6 = "audio/raw";
            switch (c10) {
                case 0:
                case 1:
                case '\t':
                    byte[] bArr = this.f70k;
                    singletonList = bArr == null ? null : Collections.singletonList(bArr);
                    str6 = "video/mp4v-es";
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null && (a10 = n3.d.a(new a0(this.N))) != null) {
                        str2 = a10.f12542c;
                        str6 = "video/dolby-vision";
                    }
                    str4 = str6;
                    int i17 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                        bVar.J(this.O).h0(this.Q).a0(i11);
                        i13 = 1;
                    } else if (v.s(str4)) {
                        if (this.f76q == 0) {
                            int i18 = this.f74o;
                            i14 = -1;
                            if (i18 == -1) {
                                i18 = this.f72m;
                            }
                            this.f74o = i18;
                            int i19 = this.f75p;
                            if (i19 == -1) {
                                i19 = this.f73n;
                            }
                            this.f75p = i19;
                        } else {
                            i14 = -1;
                        }
                        float f10 = -1.0f;
                        if (this.f74o != i14 && (i15 = this.f75p) != i14) {
                            f10 = (this.f73n * r5) / (this.f72m * i15);
                        }
                        n3.c cVar = this.f83x ? new n3.c(this.f84y, this.A, this.f85z, h()) : null;
                        if (this.f60a != null && e.f30i0.containsKey(this.f60a)) {
                            i14 = ((Integer) e.f30i0.get(this.f60a)).intValue();
                        }
                        if (this.f77r == 0 && Float.compare(this.f78s, 0.0f) == 0 && Float.compare(this.f79t, 0.0f) == 0) {
                            if (Float.compare(this.f80u, 0.0f) == 0) {
                                i14 = 0;
                            } else if (Float.compare(this.f79t, 90.0f) == 0) {
                                i14 = 90;
                            } else if (Float.compare(this.f79t, -180.0f) == 0 || Float.compare(this.f79t, 180.0f) == 0) {
                                i14 = 180;
                            } else if (Float.compare(this.f79t, -90.0f) == 0) {
                                i14 = 270;
                            }
                        }
                        bVar.n0(this.f72m).S(this.f73n).c0(f10).f0(i14).d0(this.f81v).j0(this.f82w).L(cVar);
                        i13 = 2;
                    } else {
                        if (!"application/x-subrip".equals(str4) && !"text/x-ssa".equals(str4) && !"text/vtt".equals(str4) && !"application/vobsub".equals(str4) && !"application/pgs".equals(str4) && !"application/dvbsubs".equals(str4)) {
                            throw u2.a("Unexpected MIME type.", null);
                        }
                        i13 = 3;
                    }
                    if (this.f60a != null && !e.f30i0.containsKey(this.f60a)) {
                        bVar.W(this.f60a);
                    }
                    n1 G = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11 = nVar.f(this.f62c, i13);
                    this.X = f11;
                    f11.a(G);
                    return;
                case 2:
                    if (!l(new a0(g(this.f61b)))) {
                        sb = new StringBuilder();
                        sb.append("Non-PCM MS/ACM is unsupported. Setting mimeType to ");
                        sb.append("audio/x-unknown");
                        m3.r.i("MatroskaExtractor", sb.toString());
                        singletonList = null;
                        str2 = null;
                        str6 = "audio/x-unknown";
                        i11 = -1;
                        i12 = -1;
                        if (this.N != null) {
                        }
                        str4 = str6;
                        int i172 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                        }
                        n1 G2 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f112 = nVar.f(this.f62c, i13);
                        this.X = f112;
                        f112.a(G2);
                        return;
                    }
                    b02 = n0.b0(this.P);
                    if (b02 == 0) {
                        sb = new StringBuilder();
                        str = "Unsupported PCM bit depth: ";
                        sb.append(str);
                        sb.append(this.P);
                        sb.append(". Setting mimeType to ");
                        sb.append("audio/x-unknown");
                        m3.r.i("MatroskaExtractor", sb.toString());
                        singletonList = null;
                        str2 = null;
                        str6 = "audio/x-unknown";
                        i11 = -1;
                        i12 = -1;
                        if (this.N != null) {
                            str2 = a10.f12542c;
                            str6 = "video/dolby-vision";
                            break;
                        }
                        str4 = str6;
                        int i1722 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                            bVar.W(this.f60a);
                            break;
                        }
                        n1 G22 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f1122 = nVar.f(this.f62c, i13);
                        this.X = f1122;
                        f1122.a(G22);
                        return;
                    }
                    i11 = b02;
                    singletonList = null;
                    str2 = null;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222 = nVar.f(this.f62c, i13);
                    this.X = f11222;
                    f11222.a(G222);
                    return;
                case 3:
                    this.T = new f0();
                    str6 = "audio/true-hd";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222 = nVar.f(this.f62c, i13);
                    this.X = f112222;
                    f112222.a(G2222);
                    return;
                case 4:
                    i16 = 8192;
                    singletonList = m(g(this.f61b));
                    str6 = "audio/vorbis";
                    str2 = null;
                    i12 = i16;
                    i11 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222 = nVar.f(this.f62c, i13);
                    this.X = f1122222;
                    f1122222.a(G22222);
                    return;
                case 5:
                    str6 = "audio/mpeg-L2";
                    singletonList = null;
                    str2 = null;
                    i12 = i16;
                    i11 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222;
                    f11222222.a(G222222);
                    return;
                case 6:
                    str6 = "audio/mpeg";
                    singletonList = null;
                    str2 = null;
                    i12 = i16;
                    i11 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222;
                    f112222222.a(G2222222);
                    return;
                case 7:
                    Pair<String, List<byte[]>> k10 = k(new a0(g(this.f61b)));
                    str6 = (String) k10.first;
                    singletonList = (List) k10.second;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222;
                    f1122222222.a(G22222222);
                    return;
                case '\b':
                    byte[] bArr2 = new byte[4];
                    System.arraycopy(g(this.f61b), 0, bArr2, 0, 4);
                    singletonList = u.S(bArr2);
                    str6 = "application/dvbsubs";
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222;
                    f11222222222.a(G222222222);
                    return;
                case '\n':
                    n3.a b10 = n3.a.b(new a0(g(this.f61b)));
                    list = b10.f12522a;
                    this.Y = b10.f12523b;
                    str3 = b10.f12527f;
                    str6 = "video/avc";
                    i11 = -1;
                    i12 = -1;
                    List<byte[]> list2 = list;
                    str2 = str3;
                    singletonList = list2;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222;
                    f112222222222.a(G2222222222);
                    return;
                case 11:
                    singletonList = u.S(g(this.f61b));
                    str2 = null;
                    str6 = "application/vobsub";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222;
                    f1122222222222.a(G22222222222);
                    return;
                case '\f':
                    str6 = "audio/vnd.dts.hd";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222;
                    f11222222222222.a(G222222222222);
                    return;
                case '\r':
                    singletonList = Collections.singletonList(g(this.f61b));
                    a.b f12 = r1.a.f(this.f70k);
                    this.Q = f12.f15078a;
                    this.O = f12.f15079b;
                    str2 = f12.f15080c;
                    str6 = "audio/mp4a-latm";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222;
                    f112222222222222.a(G2222222222222);
                    return;
                case 14:
                    str6 = "audio/ac3";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222;
                    f1122222222222222.a(G22222222222222);
                    return;
                case 15:
                case 21:
                    str6 = "audio/vnd.dts";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222222;
                    f11222222222222222.a(G222222222222222);
                    return;
                case 16:
                    str6 = "video/av01";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222;
                    f112222222222222222.a(G2222222222222222);
                    return;
                case 17:
                    str6 = "video/x-vnd.on2.vp8";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222222;
                    f1122222222222222222.a(G22222222222222222);
                    return;
                case 18:
                    str6 = "video/x-vnd.on2.vp9";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222222222;
                    f11222222222222222222.a(G222222222222222222);
                    return;
                case 19:
                    singletonList = null;
                    str2 = null;
                    str6 = "application/pgs";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222;
                    f112222222222222222222.a(G2222222222222222222);
                    return;
                case 20:
                    str6 = "video/x-unknown";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222222222;
                    f1122222222222222222222.a(G22222222222222222222);
                    return;
                case 22:
                    if (this.P == 32) {
                        singletonList = null;
                        str2 = null;
                        i11 = 4;
                        i12 = -1;
                        if (this.N != null) {
                        }
                        str4 = str6;
                        int i17222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                        }
                        n1 G222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f11222222222222222222222 = nVar.f(this.f62c, i13);
                        this.X = f11222222222222222222222;
                        f11222222222222222222222.a(G222222222222222222222);
                        return;
                    }
                    sb = new StringBuilder();
                    str = "Unsupported floating point PCM bit depth: ";
                    sb.append(str);
                    sb.append(this.P);
                    sb.append(". Setting mimeType to ");
                    sb.append("audio/x-unknown");
                    m3.r.i("MatroskaExtractor", sb.toString());
                    singletonList = null;
                    str2 = null;
                    str6 = "audio/x-unknown";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222222;
                    f112222222222222222222222.a(G2222222222222222222222);
                    return;
                case 23:
                    int i20 = this.P;
                    if (i20 == 8) {
                        singletonList = null;
                        str2 = null;
                        i11 = 3;
                        i12 = -1;
                        if (this.N != null) {
                        }
                        str4 = str6;
                        int i1722222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                        }
                        n1 G22222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f1122222222222222222222222 = nVar.f(this.f62c, i13);
                        this.X = f1122222222222222222222222;
                        f1122222222222222222222222.a(G22222222222222222222222);
                        return;
                    }
                    if (i20 == 16) {
                        b02 = 268435456;
                        i11 = b02;
                        singletonList = null;
                        str2 = null;
                        i12 = -1;
                        if (this.N != null) {
                        }
                        str4 = str6;
                        int i17222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                        }
                        n1 G222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f11222222222222222222222222 = nVar.f(this.f62c, i13);
                        this.X = f11222222222222222222222222;
                        f11222222222222222222222222.a(G222222222222222222222222);
                        return;
                    }
                    sb = new StringBuilder();
                    str = "Unsupported big endian PCM bit depth: ";
                    sb.append(str);
                    sb.append(this.P);
                    sb.append(". Setting mimeType to ");
                    sb.append("audio/x-unknown");
                    m3.r.i("MatroskaExtractor", sb.toString());
                    singletonList = null;
                    str2 = null;
                    str6 = "audio/x-unknown";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222222222;
                    f112222222222222222222222222.a(G2222222222222222222222222);
                    return;
                case 24:
                    b02 = n0.b0(this.P);
                    if (b02 == 0) {
                        sb = new StringBuilder();
                        str = "Unsupported little endian PCM bit depth: ";
                        sb.append(str);
                        sb.append(this.P);
                        sb.append(". Setting mimeType to ");
                        sb.append("audio/x-unknown");
                        m3.r.i("MatroskaExtractor", sb.toString());
                        singletonList = null;
                        str2 = null;
                        str6 = "audio/x-unknown";
                        i11 = -1;
                        i12 = -1;
                        if (this.N != null) {
                        }
                        str4 = str6;
                        int i1722222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                        bVar = new n1.b();
                        if (!v.o(str4)) {
                        }
                        if (this.f60a != null) {
                        }
                        n1 G22222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                        e0 f1122222222222222222222222222 = nVar.f(this.f62c, i13);
                        this.X = f1122222222222222222222222222;
                        f1122222222222222222222222222.a(G22222222222222222222222222);
                        return;
                    }
                    i11 = b02;
                    singletonList = null;
                    str2 = null;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222222222222222222;
                    f11222222222222222222222222222.a(G222222222222222222222222222);
                    return;
                case 25:
                    singletonList = u.T(e.f26e0, g(this.f61b));
                    str2 = null;
                    str6 = "text/x-ssa";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222222222222;
                    f112222222222222222222222222222.a(G2222222222222222222222222222);
                    return;
                case 26:
                    n3.f a11 = n3.f.a(new a0(g(this.f61b)));
                    list = a11.f12557a;
                    this.Y = a11.f12558b;
                    str3 = a11.f12565i;
                    str6 = "video/hevc";
                    i11 = -1;
                    i12 = -1;
                    List<byte[]> list22 = list;
                    str2 = str3;
                    singletonList = list22;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222222222222222222;
                    f1122222222222222222222222222222.a(G22222222222222222222222222222);
                    return;
                case 27:
                    singletonList = null;
                    str2 = null;
                    str6 = "text/vtt";
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222222222222222222222;
                    f11222222222222222222222222222222.a(G222222222222222222222222222222);
                    return;
                case 28:
                    str6 = "application/x-subrip";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222222222222222;
                    f112222222222222222222222222222222.a(G2222222222222222222222222222222);
                    return;
                case 29:
                    str6 = "video/mpeg2";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222222222222222222222;
                    f1122222222222222222222222222222222.a(G22222222222222222222222222222222);
                    return;
                case 30:
                    str6 = "audio/eac3";
                    singletonList = null;
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i17222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i17222222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f11222222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f11222222222222222222222222222222222;
                    f11222222222222222222222222222222222.a(G222222222222222222222222222222222);
                    return;
                case 31:
                    singletonList = Collections.singletonList(g(this.f61b));
                    str6 = "audio/flac";
                    str2 = null;
                    i11 = -1;
                    i12 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i172222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G2222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i172222222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f112222222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f112222222222222222222222222222222222;
                    f112222222222222222222222222222222222.a(G2222222222222222222222222222222222);
                    return;
                case ' ':
                    i16 = 5760;
                    singletonList = new ArrayList<>(3);
                    singletonList.add(g(this.f61b));
                    ByteBuffer allocate = ByteBuffer.allocate(8);
                    ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
                    singletonList.add(allocate.order(byteOrder).putLong(this.R).array());
                    singletonList.add(ByteBuffer.allocate(8).order(byteOrder).putLong(this.S).array());
                    str6 = "audio/opus";
                    str2 = null;
                    i12 = i16;
                    i11 = -1;
                    if (this.N != null) {
                    }
                    str4 = str6;
                    int i1722222222222222222222222222222222222 = (!this.U ? 2 : 0) | (this.V ? 1 : 0) | 0;
                    bVar = new n1.b();
                    if (!v.o(str4)) {
                    }
                    if (this.f60a != null) {
                    }
                    n1 G22222222222222222222222222222222222 = bVar.T(i10).g0(str4).Y(i12).X(this.W).i0(i1722222222222222222222222222222222222).V(singletonList).K(str2).O(this.f71l).G();
                    e0 f1122222222222222222222222222222222222 = nVar.f(this.f62c, i13);
                    this.X = f1122222222222222222222222222222222222;
                    f1122222222222222222222222222222222222.a(G22222222222222222222222222222222222);
                    return;
                default:
                    throw u2.a("Unrecognized codec identifier.", null);
            }
        }

        public void j() {
            f0 f0Var = this.T;
            if (f0Var != null) {
                f0Var.a(this.X, this.f69j);
            }
        }

        public void n() {
            f0 f0Var = this.T;
            if (f0Var != null) {
                f0Var.b();
            }
        }
    }

    static {
        HashMap hashMap = new HashMap();
        hashMap.put("htc_video_rotA-000", 0);
        hashMap.put("htc_video_rotA-090", 90);
        hashMap.put("htc_video_rotA-180", 180);
        hashMap.put("htc_video_rotA-270", 270);
        f30i0 = Collections.unmodifiableMap(hashMap);
    }

    public e() {
        this(0);
    }

    public e(int i10) {
        this(new a2.a(), i10);
    }

    e(a2.c cVar, int i10) {
        this.f49q = -1L;
        this.f50r = -9223372036854775807L;
        this.f51s = -9223372036854775807L;
        this.f52t = -9223372036854775807L;
        this.f58z = -1L;
        this.A = -1L;
        this.B = -9223372036854775807L;
        this.f31a = cVar;
        cVar.c(new b());
        this.f36d = (i10 & 1) == 0;
        this.f33b = new g();
        this.f35c = new SparseArray<>();
        this.f39g = new a0(4);
        this.f40h = new a0(ByteBuffer.allocate(4).putInt(-1).array());
        this.f41i = new a0(4);
        this.f37e = new a0(w.f12369a);
        this.f38f = new a0(4);
        this.f42j = new a0();
        this.f43k = new a0();
        this.f44l = new a0(8);
        this.f45m = new a0();
        this.f46n = new a0();
        this.L = new int[1];
    }

    public static l[] A() {
        return new l[]{new e()};
    }

    private boolean B(u1.a0 a0Var, long j10) {
        if (this.f57y) {
            this.A = j10;
            a0Var.f16795a = this.f58z;
            this.f57y = false;
            return true;
        }
        if (this.f54v) {
            long j11 = this.A;
            if (j11 != -1) {
                a0Var.f16795a = j11;
                this.A = -1L;
                return true;
            }
        }
        return false;
    }

    private void C(m mVar, int i10) {
        if (this.f39g.g() >= i10) {
            return;
        }
        if (this.f39g.b() < i10) {
            a0 a0Var = this.f39g;
            a0Var.c(Math.max(a0Var.b() * 2, i10));
        }
        mVar.readFully(this.f39g.e(), this.f39g.g(), i10 - this.f39g.g());
        this.f39g.S(i10);
    }

    private void D() {
        this.S = 0;
        this.T = 0;
        this.U = 0;
        this.V = false;
        this.W = false;
        this.X = false;
        this.Y = 0;
        this.Z = (byte) 0;
        this.f32a0 = false;
        this.f42j.P(0);
    }

    private long E(long j10) {
        long j11 = this.f50r;
        if (j11 != -9223372036854775807L) {
            return n0.N0(j10, j11, 1000L);
        }
        throw u2.a("Can't scale timecode prior to timecodeScale being set.", null);
    }

    private static void F(String str, long j10, byte[] bArr) {
        byte[] s10;
        int i10;
        str.hashCode();
        char c10 = 65535;
        switch (str.hashCode()) {
            case 738597099:
                if (str.equals("S_TEXT/ASS")) {
                    c10 = 0;
                    break;
                }
                break;
            case 1045209816:
                if (str.equals("S_TEXT/WEBVTT")) {
                    c10 = 1;
                    break;
                }
                break;
            case 1422270023:
                if (str.equals("S_TEXT/UTF8")) {
                    c10 = 2;
                    break;
                }
                break;
        }
        switch (c10) {
            case 0:
                s10 = s(j10, "%01d:%02d:%02d:%02d", 10000L);
                i10 = 21;
                break;
            case 1:
                s10 = s(j10, "%02d:%02d:%02d.%03d", 1000L);
                i10 = 25;
                break;
            case 2:
                s10 = s(j10, "%02d:%02d:%02d,%03d", 1000L);
                i10 = 19;
                break;
            default:
                throw new IllegalArgumentException();
        }
        System.arraycopy(s10, 0, bArr, i10, s10.length);
    }

    private int I(m mVar, c cVar, int i10, boolean z10) {
        int i11;
        if ("S_TEXT/UTF8".equals(cVar.f61b)) {
            J(mVar, f25d0, i10);
        } else if ("S_TEXT/ASS".equals(cVar.f61b)) {
            J(mVar, f27f0, i10);
        } else {
            if (!"S_TEXT/WEBVTT".equals(cVar.f61b)) {
                e0 e0Var = cVar.X;
                if (!this.V) {
                    if (cVar.f67h) {
                        this.O &= -1073741825;
                        if (!this.W) {
                            mVar.readFully(this.f39g.e(), 0, 1);
                            this.S++;
                            if ((this.f39g.e()[0] & 128) == 128) {
                                throw u2.a("Extension bit is set in signal byte", null);
                            }
                            this.Z = this.f39g.e()[0];
                            this.W = true;
                        }
                        byte b10 = this.Z;
                        if ((b10 & 1) == 1) {
                            boolean z11 = (b10 & 2) == 2;
                            this.O |= 1073741824;
                            if (!this.f32a0) {
                                mVar.readFully(this.f44l.e(), 0, 8);
                                this.S += 8;
                                this.f32a0 = true;
                                this.f39g.e()[0] = (byte) ((z11 ? 128 : 0) | 8);
                                this.f39g.T(0);
                                e0Var.e(this.f39g, 1, 1);
                                this.T++;
                                this.f44l.T(0);
                                e0Var.e(this.f44l, 8, 1);
                                this.T += 8;
                            }
                            if (z11) {
                                if (!this.X) {
                                    mVar.readFully(this.f39g.e(), 0, 1);
                                    this.S++;
                                    this.f39g.T(0);
                                    this.Y = this.f39g.G();
                                    this.X = true;
                                }
                                int i12 = this.Y * 4;
                                this.f39g.P(i12);
                                mVar.readFully(this.f39g.e(), 0, i12);
                                this.S += i12;
                                short s10 = (short) ((this.Y / 2) + 1);
                                int i13 = (s10 * 6) + 2;
                                ByteBuffer byteBuffer = this.f47o;
                                if (byteBuffer == null || byteBuffer.capacity() < i13) {
                                    this.f47o = ByteBuffer.allocate(i13);
                                }
                                this.f47o.position(0);
                                this.f47o.putShort(s10);
                                int i14 = 0;
                                int i15 = 0;
                                while (true) {
                                    i11 = this.Y;
                                    if (i14 >= i11) {
                                        break;
                                    }
                                    int K = this.f39g.K();
                                    if (i14 % 2 == 0) {
                                        this.f47o.putShort((short) (K - i15));
                                    } else {
                                        this.f47o.putInt(K - i15);
                                    }
                                    i14++;
                                    i15 = K;
                                }
                                int i16 = (i10 - this.S) - i15;
                                int i17 = i11 % 2;
                                ByteBuffer byteBuffer2 = this.f47o;
                                if (i17 == 1) {
                                    byteBuffer2.putInt(i16);
                                } else {
                                    byteBuffer2.putShort((short) i16);
                                    this.f47o.putInt(0);
                                }
                                this.f45m.R(this.f47o.array(), i13);
                                e0Var.e(this.f45m, i13, 1);
                                this.T += i13;
                            }
                        }
                    } else {
                        byte[] bArr = cVar.f68i;
                        if (bArr != null) {
                            this.f42j.R(bArr, bArr.length);
                        }
                    }
                    if (cVar.o(z10)) {
                        this.O |= 268435456;
                        this.f46n.P(0);
                        int g10 = (this.f42j.g() + i10) - this.S;
                        this.f39g.P(4);
                        this.f39g.e()[0] = (byte) ((g10 >> 24) & 255);
                        this.f39g.e()[1] = (byte) ((g10 >> 16) & 255);
                        this.f39g.e()[2] = (byte) ((g10 >> 8) & 255);
                        this.f39g.e()[3] = (byte) (g10 & 255);
                        e0Var.e(this.f39g, 4, 2);
                        this.T += 4;
                    }
                    this.V = true;
                }
                int g11 = i10 + this.f42j.g();
                if (!"V_MPEG4/ISO/AVC".equals(cVar.f61b) && !"V_MPEGH/ISO/HEVC".equals(cVar.f61b)) {
                    if (cVar.T != null) {
                        m3.a.f(this.f42j.g() == 0);
                        cVar.T.d(mVar);
                    }
                    while (true) {
                        int i18 = this.S;
                        if (i18 >= g11) {
                            break;
                        }
                        int K2 = K(mVar, e0Var, g11 - i18);
                        this.S += K2;
                        this.T += K2;
                    }
                } else {
                    byte[] e10 = this.f38f.e();
                    e10[0] = 0;
                    e10[1] = 0;
                    e10[2] = 0;
                    int i19 = cVar.Y;
                    int i20 = 4 - i19;
                    while (this.S < g11) {
                        int i21 = this.U;
                        if (i21 == 0) {
                            L(mVar, e10, i20, i19);
                            this.S += i19;
                            this.f38f.T(0);
                            this.U = this.f38f.K();
                            this.f37e.T(0);
                            e0Var.c(this.f37e, 4);
                            this.T += 4;
                        } else {
                            int K3 = K(mVar, e0Var, i21);
                            this.S += K3;
                            this.T += K3;
                            this.U -= K3;
                        }
                    }
                }
                if ("A_VORBIS".equals(cVar.f61b)) {
                    this.f40h.T(0);
                    e0Var.c(this.f40h, 4);
                    this.T += 4;
                }
                return q();
            }
            J(mVar, f28g0, i10);
        }
        return q();
    }

    private void J(m mVar, byte[] bArr, int i10) {
        int length = bArr.length + i10;
        if (this.f43k.b() < length) {
            this.f43k.Q(Arrays.copyOf(bArr, length + i10));
        } else {
            System.arraycopy(bArr, 0, this.f43k.e(), 0, bArr.length);
        }
        mVar.readFully(this.f43k.e(), bArr.length, i10);
        this.f43k.T(0);
        this.f43k.S(length);
    }

    private int K(m mVar, e0 e0Var, int i10) {
        int a10 = this.f42j.a();
        if (a10 <= 0) {
            return e0Var.f(mVar, i10, false);
        }
        int min = Math.min(i10, a10);
        e0Var.c(this.f42j, min);
        return min;
    }

    private void L(m mVar, byte[] bArr, int i10, int i11) {
        int min = Math.min(i11, this.f42j.a());
        mVar.readFully(bArr, i10 + min, i11 - min);
        if (min > 0) {
            this.f42j.l(bArr, i10, min);
        }
    }

    private void h(int i10) {
        if (this.C == null || this.D == null) {
            throw u2.a("Element " + i10 + " must be in a Cues", null);
        }
    }

    private void j(int i10) {
        if (this.f53u != null) {
            return;
        }
        throw u2.a("Element " + i10 + " must be in a TrackEntry", null);
    }

    private void k() {
        m3.a.h(this.f34b0);
    }

    private b0 m(s sVar, s sVar2) {
        int i10;
        if (this.f49q == -1 || this.f52t == -9223372036854775807L || sVar == null || sVar.c() == 0 || sVar2 == null || sVar2.c() != sVar.c()) {
            return new b0.b(this.f52t);
        }
        int c10 = sVar.c();
        int[] iArr = new int[c10];
        long[] jArr = new long[c10];
        long[] jArr2 = new long[c10];
        long[] jArr3 = new long[c10];
        int i11 = 0;
        for (int i12 = 0; i12 < c10; i12++) {
            jArr3[i12] = sVar.b(i12);
            jArr[i12] = this.f49q + sVar2.b(i12);
        }
        while (true) {
            i10 = c10 - 1;
            if (i11 >= i10) {
                break;
            }
            int i13 = i11 + 1;
            iArr[i11] = (int) (jArr[i13] - jArr[i11]);
            jArr2[i11] = jArr3[i13] - jArr3[i11];
            i11 = i13;
        }
        iArr[i10] = (int) ((this.f49q + this.f48p) - jArr[i10]);
        jArr2[i10] = this.f52t - jArr3[i10];
        long j10 = jArr2[i10];
        if (j10 <= 0) {
            m3.r.i("MatroskaExtractor", "Discarding last cue point with unexpected duration: " + j10);
            iArr = Arrays.copyOf(iArr, i10);
            jArr = Arrays.copyOf(jArr, i10);
            jArr2 = Arrays.copyOf(jArr2, i10);
            jArr3 = Arrays.copyOf(jArr3, i10);
        }
        return new u1.d(iArr, jArr, jArr2, jArr3);
    }

    private void n(c cVar, long j10, int i10, int i11, int i12) {
        String str;
        f0 f0Var = cVar.T;
        if (f0Var != null) {
            f0Var.c(cVar.X, j10, i10, i11, i12, cVar.f69j);
        } else {
            if ("S_TEXT/UTF8".equals(cVar.f61b) || "S_TEXT/ASS".equals(cVar.f61b) || "S_TEXT/WEBVTT".equals(cVar.f61b)) {
                if (this.K > 1) {
                    str = "Skipping subtitle sample in laced block.";
                } else {
                    long j11 = this.I;
                    if (j11 == -9223372036854775807L) {
                        str = "Skipping subtitle sample with no duration.";
                    } else {
                        F(cVar.f61b, j11, this.f43k.e());
                        int f10 = this.f43k.f();
                        while (true) {
                            if (f10 >= this.f43k.g()) {
                                break;
                            }
                            if (this.f43k.e()[f10] == 0) {
                                this.f43k.S(f10);
                                break;
                            }
                            f10++;
                        }
                        e0 e0Var = cVar.X;
                        a0 a0Var = this.f43k;
                        e0Var.c(a0Var, a0Var.g());
                        i11 += this.f43k.g();
                    }
                }
                m3.r.i("MatroskaExtractor", str);
            }
            if ((268435456 & i10) != 0) {
                if (this.K > 1) {
                    this.f46n.P(0);
                } else {
                    int g10 = this.f46n.g();
                    cVar.X.e(this.f46n, g10, 2);
                    i11 += g10;
                }
            }
            cVar.X.b(j10, i10, i11, i12, cVar.f69j);
        }
        this.F = true;
    }

    private static int[] p(int[] iArr, int i10) {
        return iArr == null ? new int[i10] : iArr.length >= i10 ? iArr : new int[Math.max(iArr.length * 2, i10)];
    }

    private int q() {
        int i10 = this.T;
        D();
        return i10;
    }

    private static byte[] s(long j10, String str, long j11) {
        m3.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 n0.l0(String.format(Locale.US, str, Integer.valueOf(i10), Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf((int) ((j13 - (i12 * 1000000)) / j11))));
    }

    private static boolean y(String str) {
        str.hashCode();
        char c10 = 65535;
        switch (str.hashCode()) {
            case -2095576542:
                if (str.equals("V_MPEG4/ISO/AP")) {
                    c10 = 0;
                    break;
                }
                break;
            case -2095575984:
                if (str.equals("V_MPEG4/ISO/SP")) {
                    c10 = 1;
                    break;
                }
                break;
            case -1985379776:
                if (str.equals("A_MS/ACM")) {
                    c10 = 2;
                    break;
                }
                break;
            case -1784763192:
                if (str.equals("A_TRUEHD")) {
                    c10 = 3;
                    break;
                }
                break;
            case -1730367663:
                if (str.equals("A_VORBIS")) {
                    c10 = 4;
                    break;
                }
                break;
            case -1482641358:
                if (str.equals("A_MPEG/L2")) {
                    c10 = 5;
                    break;
                }
                break;
            case -1482641357:
                if (str.equals("A_MPEG/L3")) {
                    c10 = 6;
                    break;
                }
                break;
            case -1373388978:
                if (str.equals("V_MS/VFW/FOURCC")) {
                    c10 = 7;
                    break;
                }
                break;
            case -933872740:
                if (str.equals("S_DVBSUB")) {
                    c10 = '\b';
                    break;
                }
                break;
            case -538363189:
                if (str.equals("V_MPEG4/ISO/ASP")) {
                    c10 = '\t';
                    break;
                }
                break;
            case -538363109:
                if (str.equals("V_MPEG4/ISO/AVC")) {
                    c10 = '\n';
                    break;
                }
                break;
            case -425012669:
                if (str.equals("S_VOBSUB")) {
                    c10 = 11;
                    break;
                }
                break;
            case -356037306:
                if (str.equals("A_DTS/LOSSLESS")) {
                    c10 = '\f';
                    break;
                }
                break;
            case 62923557:
                if (str.equals("A_AAC")) {
                    c10 = '\r';
                    break;
                }
                break;
            case 62923603:
                if (str.equals("A_AC3")) {
                    c10 = 14;
                    break;
                }
                break;
            case 62927045:
                if (str.equals("A_DTS")) {
                    c10 = 15;
                    break;
                }
                break;
            case 82318131:
                if (str.equals("V_AV1")) {
                    c10 = 16;
                    break;
                }
                break;
            case 82338133:
                if (str.equals("V_VP8")) {
                    c10 = 17;
                    break;
                }
                break;
            case 82338134:
                if (str.equals("V_VP9")) {
                    c10 = 18;
                    break;
                }
                break;
            case 99146302:
                if (str.equals("S_HDMV/PGS")) {
                    c10 = 19;
                    break;
                }
                break;
            case 444813526:
                if (str.equals("V_THEORA")) {
                    c10 = 20;
                    break;
                }
                break;
            case 542569478:
                if (str.equals("A_DTS/EXPRESS")) {
                    c10 = 21;
                    break;
                }
                break;
            case 635596514:
                if (str.equals("A_PCM/FLOAT/IEEE")) {
                    c10 = 22;
                    break;
                }
                break;
            case 725948237:
                if (str.equals("A_PCM/INT/BIG")) {
                    c10 = 23;
                    break;
                }
                break;
            case 725957860:
                if (str.equals("A_PCM/INT/LIT")) {
                    c10 = 24;
                    break;
                }
                break;
            case 738597099:
                if (str.equals("S_TEXT/ASS")) {
                    c10 = 25;
                    break;
                }
                break;
            case 855502857:
                if (str.equals("V_MPEGH/ISO/HEVC")) {
                    c10 = 26;
                    break;
                }
                break;
            case 1045209816:
                if (str.equals("S_TEXT/WEBVTT")) {
                    c10 = 27;
                    break;
                }
                break;
            case 1422270023:
                if (str.equals("S_TEXT/UTF8")) {
                    c10 = 28;
                    break;
                }
                break;
            case 1809237540:
                if (str.equals("V_MPEG2")) {
                    c10 = 29;
                    break;
                }
                break;
            case 1950749482:
                if (str.equals("A_EAC3")) {
                    c10 = 30;
                    break;
                }
                break;
            case 1950789798:
                if (str.equals("A_FLAC")) {
                    c10 = 31;
                    break;
                }
                break;
            case 1951062397:
                if (str.equals("A_OPUS")) {
                    c10 = ' ';
                    break;
                }
                break;
        }
        switch (c10) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case '\b':
            case '\t':
            case '\n':
            case 11:
            case '\f':
            case '\r':
            case 14:
            case 15:
            case 16:
            case 17:
            case 18:
            case 19:
            case 20:
            case 21:
            case 22:
            case 23:
            case 24:
            case 25:
            case 26:
            case 27:
            case 28:
            case 29:
            case 30:
            case 31:
            case ' ':
                return true;
            default:
                return false;
        }
    }

    protected void G(int i10, long j10, long j11) {
        k();
        if (i10 == 160) {
            this.Q = false;
            this.R = 0L;
            return;
        }
        if (i10 == 174) {
            this.f53u = new c();
            return;
        }
        if (i10 == 187) {
            this.E = false;
            return;
        }
        if (i10 == 19899) {
            this.f55w = -1;
            this.f56x = -1L;
            return;
        }
        if (i10 == 20533) {
            t(i10).f67h = true;
            return;
        }
        if (i10 == 21968) {
            t(i10).f83x = true;
            return;
        }
        if (i10 == 408125543) {
            long j12 = this.f49q;
            if (j12 != -1 && j12 != j10) {
                throw u2.a("Multiple Segment elements not supported", null);
            }
            this.f49q = j10;
            this.f48p = j11;
            return;
        }
        if (i10 == 475249515) {
            this.C = new s();
            this.D = new s();
        } else if (i10 == 524531317 && !this.f54v) {
            if (this.f36d && this.f58z != -1) {
                this.f57y = true;
            } else {
                this.f34b0.l(new b0.b(this.f52t));
                this.f54v = true;
            }
        }
    }

    protected void H(int i10, String str) {
        if (i10 == 134) {
            t(i10).f61b = str;
            return;
        }
        if (i10 != 17026) {
            if (i10 == 21358) {
                t(i10).f60a = str;
                return;
            } else {
                if (i10 != 2274716) {
                    return;
                }
                t(i10).W = str;
                return;
            }
        }
        if ("webm".equals(str) || "matroska".equals(str)) {
            return;
        }
        throw u2.a("DocType " + str + " not supported", null);
    }

    @Override
    public void b(long j10, long j11) {
        this.B = -9223372036854775807L;
        this.G = 0;
        this.f31a.b();
        this.f33b.e();
        D();
        for (int i10 = 0; i10 < this.f35c.size(); i10++) {
            this.f35c.valueAt(i10).n();
        }
    }

    @Override
    public final void c(n nVar) {
        this.f34b0 = nVar;
    }

    @Override
    public final int e(m mVar, u1.a0 a0Var) {
        this.F = false;
        boolean z10 = true;
        while (z10 && !this.F) {
            z10 = this.f31a.a(mVar);
            if (z10 && B(a0Var, mVar.d())) {
                return 1;
            }
        }
        if (z10) {
            return 0;
        }
        for (int i10 = 0; i10 < this.f35c.size(); i10++) {
            c valueAt = this.f35c.valueAt(i10);
            valueAt.f();
            valueAt.j();
        }
        return -1;
    }

    @Override
    public final boolean i(m mVar) {
        return new f().b(mVar);
    }

    protected void l(int i10, int i11, m mVar) {
        c cVar;
        int i12;
        c cVar2;
        c cVar3;
        long j10;
        long j11;
        int i13;
        int i14;
        int[] iArr;
        int i15 = 0;
        int i16 = 1;
        if (i10 != 161 && i10 != 163) {
            if (i10 == 165) {
                if (this.G != 2) {
                    return;
                }
                w(this.f35c.get(this.M), this.P, mVar, i11);
                return;
            }
            if (i10 == 16877) {
                v(t(i10), mVar, i11);
                return;
            }
            if (i10 == 16981) {
                j(i10);
                byte[] bArr = new byte[i11];
                this.f53u.f68i = bArr;
                mVar.readFully(bArr, 0, i11);
                return;
            }
            if (i10 == 18402) {
                byte[] bArr2 = new byte[i11];
                mVar.readFully(bArr2, 0, i11);
                t(i10).f69j = new e0.a(1, bArr2, 0, 0);
                return;
            }
            if (i10 == 21419) {
                Arrays.fill(this.f41i.e(), (byte) 0);
                mVar.readFully(this.f41i.e(), 4 - i11, i11);
                this.f41i.T(0);
                this.f55w = (int) this.f41i.I();
                return;
            }
            if (i10 == 25506) {
                j(i10);
                byte[] bArr3 = new byte[i11];
                this.f53u.f70k = bArr3;
                mVar.readFully(bArr3, 0, i11);
                return;
            }
            if (i10 != 30322) {
                throw u2.a("Unexpected id: " + i10, null);
            }
            j(i10);
            byte[] bArr4 = new byte[i11];
            this.f53u.f81v = bArr4;
            mVar.readFully(bArr4, 0, i11);
            return;
        }
        if (this.G == 0) {
            this.M = (int) this.f33b.d(mVar, false, true, 8);
            this.N = this.f33b.b();
            this.I = -9223372036854775807L;
            this.G = 1;
            this.f39g.P(0);
        }
        c cVar4 = this.f35c.get(this.M);
        if (cVar4 == null) {
            mVar.n(i11 - this.N);
            this.G = 0;
            return;
        }
        cVar4.f();
        if (this.G == 1) {
            C(mVar, 3);
            int i17 = (this.f39g.e()[2] & 6) >> 1;
            byte b10 = 255;
            if (i17 == 0) {
                this.K = 1;
                int[] p10 = p(this.L, 1);
                this.L = p10;
                p10[0] = (i11 - this.N) - 3;
            } else {
                int i18 = 4;
                C(mVar, 4);
                int i19 = (this.f39g.e()[3] & 255) + 1;
                this.K = i19;
                int[] p11 = p(this.L, i19);
                this.L = p11;
                if (i17 == 2) {
                    int i20 = (i11 - this.N) - 4;
                    int i21 = this.K;
                    Arrays.fill(p11, 0, i21, i20 / i21);
                } else if (i17 == 1) {
                    int i22 = 0;
                    int i23 = 0;
                    while (true) {
                        i13 = this.K;
                        if (i22 >= i13 - 1) {
                            break;
                        }
                        this.L[i22] = 0;
                        do {
                            i18++;
                            C(mVar, i18);
                            i14 = this.f39g.e()[i18 - 1] & 255;
                            iArr = this.L;
                            iArr[i22] = iArr[i22] + i14;
                        } while (i14 == 255);
                        i23 += iArr[i22];
                        i22++;
                    }
                    this.L[i13 - 1] = ((i11 - this.N) - i18) - i23;
                } else {
                    if (i17 != 3) {
                        throw u2.a("Unexpected lacing value: " + i17, null);
                    }
                    int i24 = 0;
                    int i25 = 0;
                    while (true) {
                        int i26 = this.K;
                        if (i24 >= i26 - 1) {
                            cVar2 = cVar4;
                            this.L[i26 - 1] = ((i11 - this.N) - i18) - i25;
                            break;
                        }
                        this.L[i24] = i15;
                        i18++;
                        C(mVar, i18);
                        int i27 = i18 - 1;
                        if (this.f39g.e()[i27] == 0) {
                            throw u2.a("No valid varint length mask found", null);
                        }
                        int i28 = i15;
                        while (true) {
                            if (i28 >= 8) {
                                cVar3 = cVar4;
                                j10 = 0;
                                break;
                            }
                            int i29 = i16 << (7 - i28);
                            if ((this.f39g.e()[i27] & i29) != 0) {
                                int i30 = i18 + i28;
                                C(mVar, i30);
                                cVar3 = cVar4;
                                long j12 = (~i29) & this.f39g.e()[i27] & b10;
                                int i31 = i27 + 1;
                                while (true) {
                                    j11 = j12;
                                    if (i31 >= i30) {
                                        break;
                                    }
                                    j12 = (j11 << 8) | (this.f39g.e()[i31] & b10);
                                    i31++;
                                    i30 = i30;
                                    b10 = 255;
                                }
                                int i32 = i30;
                                if (i24 > 0) {
                                    j11 -= (1 << ((i28 * 7) + 6)) - 1;
                                }
                                j10 = j11;
                                i18 = i32;
                            } else {
                                i28++;
                                i16 = 1;
                                b10 = 255;
                            }
                        }
                        if (j10 < -2147483648L || j10 > 2147483647L) {
                            break;
                        }
                        int i33 = (int) j10;
                        int[] iArr2 = this.L;
                        if (i24 != 0) {
                            i33 += iArr2[i24 - 1];
                        }
                        iArr2[i24] = i33;
                        i25 += iArr2[i24];
                        i24++;
                        cVar4 = cVar3;
                        i15 = 0;
                        i16 = 1;
                        b10 = 255;
                    }
                }
            }
            cVar2 = cVar4;
            this.H = this.B + E((this.f39g.e()[0] << 8) | (this.f39g.e()[1] & 255));
            cVar = cVar2;
            this.O = (cVar.f63d == 2 || (i10 == 163 && (this.f39g.e()[2] & 128) == 128)) ? 1 : 0;
            this.G = 2;
            this.J = 0;
            i12 = 163;
        } else {
            cVar = cVar4;
            i12 = 163;
        }
        if (i10 == i12) {
            while (true) {
                int i34 = this.J;
                if (i34 >= this.K) {
                    this.G = 0;
                    return;
                } else {
                    n(cVar, ((this.J * cVar.f64e) / i.DEFAULT_IMAGE_TIMEOUT_MS) + this.H, this.O, I(mVar, cVar, this.L[i34], false), 0);
                    this.J++;
                }
            }
        } else {
            while (true) {
                int i35 = this.J;
                if (i35 >= this.K) {
                    return;
                }
                int[] iArr3 = this.L;
                iArr3[i35] = I(mVar, cVar, iArr3[i35], true);
                this.J++;
            }
        }
    }

    protected void o(int i10) {
        k();
        if (i10 == 160) {
            if (this.G != 2) {
                return;
            }
            c cVar = this.f35c.get(this.M);
            cVar.f();
            if (this.R > 0 && "A_OPUS".equals(cVar.f61b)) {
                this.f46n.Q(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(this.R).array());
            }
            int i11 = 0;
            for (int i12 = 0; i12 < this.K; i12++) {
                i11 += this.L[i12];
            }
            int i13 = 0;
            while (i13 < this.K) {
                long j10 = this.H + ((cVar.f64e * i13) / i.DEFAULT_IMAGE_TIMEOUT_MS);
                int i14 = this.O;
                if (i13 == 0 && !this.Q) {
                    i14 |= 1;
                }
                int i15 = this.L[i13];
                int i16 = i11 - i15;
                n(cVar, j10, i14, i15, i16);
                i13++;
                i11 = i16;
            }
            this.G = 0;
            return;
        }
        if (i10 == 174) {
            c cVar2 = (c) m3.a.h(this.f53u);
            String str = cVar2.f61b;
            if (str == null) {
                throw u2.a("CodecId is missing in TrackEntry element", null);
            }
            if (y(str)) {
                cVar2.i(this.f34b0, cVar2.f62c);
                this.f35c.put(cVar2.f62c, cVar2);
            }
            this.f53u = null;
            return;
        }
        if (i10 == 19899) {
            int i17 = this.f55w;
            if (i17 != -1) {
                long j11 = this.f56x;
                if (j11 != -1) {
                    if (i17 == 475249515) {
                        this.f58z = j11;
                        return;
                    }
                    return;
                }
            }
            throw u2.a("Mandatory element SeekID or SeekPosition not found", null);
        }
        if (i10 == 25152) {
            j(i10);
            c cVar3 = this.f53u;
            if (cVar3.f67h) {
                if (cVar3.f69j == null) {
                    throw u2.a("Encrypted Track found but ContentEncKeyID was not found", null);
                }
                cVar3.f71l = new t1.m(new m.b(p1.i.f13529a, "video/webm", this.f53u.f69j.f16817b));
                return;
            }
            return;
        }
        if (i10 == 28032) {
            j(i10);
            c cVar4 = this.f53u;
            if (cVar4.f67h && cVar4.f68i != null) {
                throw u2.a("Combining encryption and compression is not supported", null);
            }
            return;
        }
        if (i10 == 357149030) {
            if (this.f50r == -9223372036854775807L) {
                this.f50r = 1000000L;
            }
            long j12 = this.f51s;
            if (j12 != -9223372036854775807L) {
                this.f52t = E(j12);
                return;
            }
            return;
        }
        if (i10 == 374648427) {
            if (this.f35c.size() == 0) {
                throw u2.a("No valid tracks were found", null);
            }
            this.f34b0.o();
        } else {
            if (i10 != 475249515) {
                return;
            }
            if (!this.f54v) {
                this.f34b0.l(m(this.C, this.D));
                this.f54v = true;
            }
            this.C = null;
            this.D = null;
        }
    }

    protected void r(int i10, double d10) {
        if (i10 == 181) {
            t(i10).Q = (int) d10;
            return;
        }
        if (i10 == 17545) {
            this.f51s = (long) d10;
            return;
        }
        switch (i10) {
            case 21969:
                t(i10).D = (float) d10;
                return;
            case 21970:
                t(i10).E = (float) d10;
                return;
            case 21971:
                t(i10).F = (float) d10;
                return;
            case 21972:
                t(i10).G = (float) d10;
                return;
            case 21973:
                t(i10).H = (float) d10;
                return;
            case 21974:
                t(i10).I = (float) d10;
                return;
            case 21975:
                t(i10).J = (float) d10;
                return;
            case 21976:
                t(i10).K = (float) d10;
                return;
            case 21977:
                t(i10).L = (float) d10;
                return;
            case 21978:
                t(i10).M = (float) d10;
                return;
            default:
                switch (i10) {
                    case 30323:
                        t(i10).f78s = (float) d10;
                        return;
                    case 30324:
                        t(i10).f79t = (float) d10;
                        return;
                    case 30325:
                        t(i10).f80u = (float) d10;
                        return;
                    default:
                        return;
                }
        }
    }

    @Override
    public final void release() {
    }

    protected c t(int i10) {
        j(i10);
        return this.f53u;
    }

    protected int u(int i10) {
        switch (i10) {
            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 30114:
            case 30321:
            case 2352003:
            case 2807729:
                return 2;
            case 134:
            case 17026:
            case 21358:
            case 2274716:
                return 3;
            case 160:
            case 166:
            case 174:
            case 183:
            case 187:
            case 224:
            case 225:
            case 16868:
            case 18407:
            case 19899:
            case 20532:
            case 20533:
            case 21936:
            case 21968:
            case 25152:
            case 28032:
            case 30113:
            case 30320:
            case 290298740:
            case 357149030:
            case 374648427:
            case 408125543:
            case 440786851:
            case 475249515:
            case 524531317:
                return 1;
            case 161:
            case 163:
            case 165:
            case 16877:
            case 16981:
            case 18402:
            case 21419:
            case 25506:
            case 30322:
                return 4;
            case 181:
            case 17545:
            case 21969:
            case 21970:
            case 21971:
            case 21972:
            case 21973:
            case 21974:
            case 21975:
            case 21976:
            case 21977:
            case 21978:
            case 30323:
            case 30324:
            case 30325:
                return 5;
            default:
                return 0;
        }
    }

    protected void v(c cVar, u1.m mVar, int i10) {
        if (cVar.f66g != 1685485123 && cVar.f66g != 1685480259) {
            mVar.n(i10);
            return;
        }
        byte[] bArr = new byte[i10];
        cVar.N = bArr;
        mVar.readFully(bArr, 0, i10);
    }

    protected void w(c cVar, int i10, u1.m mVar, int i11) {
        if (i10 != 4 || !"V_VP9".equals(cVar.f61b)) {
            mVar.n(i11);
        } else {
            this.f46n.P(i11);
            mVar.readFully(this.f46n.e(), 0, i11);
        }
    }

    protected void x(int i10, long j10) {
        if (i10 == 20529) {
            if (j10 == 0) {
                return;
            }
            throw u2.a("ContentEncodingOrder " + j10 + " not supported", null);
        }
        if (i10 == 20530) {
            if (j10 == 1) {
                return;
            }
            throw u2.a("ContentEncodingScope " + j10 + " not supported", null);
        }
        switch (i10) {
            case 131:
                t(i10).f63d = (int) j10;
                return;
            case 136:
                t(i10).V = j10 == 1;
                return;
            case 155:
                this.I = E(j10);
                return;
            case 159:
                t(i10).O = (int) j10;
                return;
            case 176:
                t(i10).f72m = (int) j10;
                return;
            case 179:
                h(i10);
                this.C.a(E(j10));
                return;
            case 186:
                t(i10).f73n = (int) j10;
                return;
            case 215:
                t(i10).f62c = (int) j10;
                return;
            case 231:
                this.B = E(j10);
                return;
            case 238:
                this.P = (int) j10;
                return;
            case 241:
                if (this.E) {
                    return;
                }
                h(i10);
                this.D.a(j10);
                this.E = true;
                return;
            case 251:
                this.Q = true;
                return;
            case 16871:
                t(i10).f66g = (int) j10;
                return;
            case 16980:
                if (j10 == 3) {
                    return;
                }
                throw u2.a("ContentCompAlgo " + j10 + " not supported", null);
            case 17029:
                if (j10 < 1 || j10 > 2) {
                    throw u2.a("DocTypeReadVersion " + j10 + " not supported", null);
                }
                return;
            case 17143:
                if (j10 == 1) {
                    return;
                }
                throw u2.a("EBMLReadVersion " + j10 + " not supported", null);
            case 18401:
                if (j10 == 5) {
                    return;
                }
                throw u2.a("ContentEncAlgo " + j10 + " not supported", null);
            case 18408:
                if (j10 == 1) {
                    return;
                }
                throw u2.a("AESSettingsCipherMode " + j10 + " not supported", null);
            case 21420:
                this.f56x = j10 + this.f49q;
                return;
            case 21432:
                int i11 = (int) j10;
                j(i10);
                if (i11 == 0) {
                    this.f53u.f82w = 0;
                    return;
                }
                if (i11 == 1) {
                    this.f53u.f82w = 2;
                    return;
                } else if (i11 == 3) {
                    this.f53u.f82w = 1;
                    return;
                } else {
                    if (i11 != 15) {
                        return;
                    }
                    this.f53u.f82w = 3;
                    return;
                }
            case 21680:
                t(i10).f74o = (int) j10;
                return;
            case 21682:
                t(i10).f76q = (int) j10;
                return;
            case 21690:
                t(i10).f75p = (int) j10;
                return;
            case 21930:
                t(i10).U = j10 == 1;
                return;
            case 21998:
                t(i10).f65f = (int) j10;
                return;
            case 22186:
                t(i10).R = j10;
                return;
            case 22203:
                t(i10).S = j10;
                return;
            case 25188:
                t(i10).P = (int) j10;
                return;
            case 30114:
                this.R = j10;
                return;
            case 30321:
                j(i10);
                int i12 = (int) j10;
                if (i12 == 0) {
                    this.f53u.f77r = 0;
                    return;
                }
                if (i12 == 1) {
                    this.f53u.f77r = 1;
                    return;
                } else if (i12 == 2) {
                    this.f53u.f77r = 2;
                    return;
                } else {
                    if (i12 != 3) {
                        return;
                    }
                    this.f53u.f77r = 3;
                    return;
                }
            case 2352003:
                t(i10).f64e = (int) j10;
                return;
            case 2807729:
                this.f50r = j10;
                return;
            default:
                switch (i10) {
                    case 21945:
                        j(i10);
                        int i13 = (int) j10;
                        if (i13 == 1) {
                            this.f53u.A = 2;
                            return;
                        } else {
                            if (i13 != 2) {
                                return;
                            }
                            this.f53u.A = 1;
                            return;
                        }
                    case 21946:
                        j(i10);
                        int c10 = n3.c.c((int) j10);
                        if (c10 != -1) {
                            this.f53u.f85z = c10;
                            return;
                        }
                        return;
                    case 21947:
                        j(i10);
                        this.f53u.f83x = true;
                        int b10 = n3.c.b((int) j10);
                        if (b10 != -1) {
                            this.f53u.f84y = b10;
                            return;
                        }
                        return;
                    case 21948:
                        t(i10).B = (int) j10;
                        return;
                    case 21949:
                        t(i10).C = (int) j10;
                        return;
                    default:
                        return;
                }
        }
    }

    protected boolean z(int i10) {
        return i10 == 357149030 || i10 == 524531317 || i10 == 475249515 || i10 == 374648427;
    }
}