Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f

以下内容为反编译后的 v80.java 源代码,内容仅作参考


package com.yandex.mobile.ads.impl;

import android.net.Uri;
import android.util.Pair;
import android.util.SparseArray;
import androidx.annotation.CallSuper;
import androidx.annotation.Nullable;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import com.yandex.mobile.ads.exo.drm.DrmInitData;
import com.yandex.mobile.ads.impl.d;
import com.yandex.mobile.ads.impl.h51;
import com.yandex.mobile.ads.impl.py0;
import com.yandex.mobile.ads.impl.qu;
import com.yandex.mobile.ads.impl.ue;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;

public final class v80 implements ls {

    private static final byte[] f70528c0;

    private static final byte[] f70529d0;

    private static final byte[] f70530e0;

    private static final byte[] f70531f0;

    private static final UUID f70532g0;

    private static final Map<String, Integer> f70533h0;
    private long A;
    private long B;

    @Nullable
    private z70 C;

    @Nullable
    private z70 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 cq f70534a;

    private boolean f70535a0;

    private final k81 f70536b;

    private ns f70537b0;

    private final SparseArray<b> f70538c;

    private final boolean f70539d;

    private final vn0 f70540e;

    private final vn0 f70541f;

    private final vn0 f70542g;

    private final vn0 f70543h;

    private final vn0 f70544i;

    private final vn0 f70545j;

    private final vn0 f70546k;

    private final vn0 f70547l;

    private final vn0 f70548m;

    private final vn0 f70549n;

    private ByteBuffer f70550o;

    private long f70551p;

    private long f70552q;

    private long f70553r;

    private long f70554s;

    private long f70555t;

    @Nullable
    private b f70556u;

    private boolean f70557v;

    private int f70558w;

    private long f70559x;

    private boolean f70560y;

    private long f70561z;

    public final class a implements bq {
        private a() {
        }

        public final boolean a(int i11) {
            v80.this.getClass();
            if (i11 != 357149030 && i11 != 524531317 && i11 != 475249515 && i11 != 374648427) {
                return false;
            }
            return true;
        }

        public a(v80 v80Var, int i11) {
            this();
        }
    }

    public static final class b {
        public byte[] N;
        public i61 T;
        public boolean U;
        public h51 X;
        public int Y;

        public String f70563a;

        public String f70564b;

        public int f70565c;

        public int f70566d;

        public int f70567e;

        public int f70568f;

        private int f70569g;

        public boolean f70570h;

        public byte[] f70571i;

        public h51.a f70572j;

        public byte[] f70573k;

        public DrmInitData f70574l;

        public int f70575m = -1;

        public int f70576n = -1;

        public int f70577o = -1;

        public int f70578p = -1;

        public int f70579q = 0;

        public int f70580r = -1;

        public float f70581s = 0.0f;

        public float f70582t = 0.0f;

        public float f70583u = 0.0f;

        public byte[] f70584v = null;

        public int f70585w = -1;

        public boolean f70586x = false;

        public int f70587y = -1;

        public int f70588z = -1;
        public int A = -1;
        public int B = 1000;
        public int C = 200;
        public float D = -1.0f;
        public float E = -1.0f;
        public float F = -1.0f;
        public float G = -1.0f;
        public float H = -1.0f;
        public float I = -1.0f;
        public float J = -1.0f;
        public float K = -1.0f;
        public float L = -1.0f;
        public float M = -1.0f;
        public 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";

        public final void a(ns nsVar, int i11) throws zn0 {
            char c11;
            String str;
            List<byte[]> singletonList;
            boolean z11;
            String str2;
            int i12;
            String str3;
            List<byte[]> list;
            ArrayList arrayList;
            Pair pair;
            List<byte[]> list2;
            String str4;
            String str5;
            String str6;
            List<byte[]> list3;
            List<byte[]> list4;
            List<byte[]> list5;
            byte[] bArr;
            qu.a aVar;
            int i13;
            int i14;
            hp a11;
            String str7 = this.f70564b;
            str7.getClass();
            int i15 = 4;
            int i16 = 3;
            int i17 = 0;
            switch (str7.hashCode()) {
                case -2095576542:
                    if (str7.equals("V_MPEG4/ISO/AP")) {
                        c11 = 0;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -2095575984:
                    if (str7.equals("V_MPEG4/ISO/SP")) {
                        c11 = 1;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1985379776:
                    if (str7.equals("A_MS/ACM")) {
                        c11 = 2;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1784763192:
                    if (str7.equals("A_TRUEHD")) {
                        c11 = 3;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1730367663:
                    if (str7.equals("A_VORBIS")) {
                        c11 = 4;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1482641358:
                    if (str7.equals("A_MPEG/L2")) {
                        c11 = 5;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1482641357:
                    if (str7.equals("A_MPEG/L3")) {
                        c11 = 6;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1373388978:
                    if (str7.equals("V_MS/VFW/FOURCC")) {
                        c11 = 7;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -933872740:
                    if (str7.equals("S_DVBSUB")) {
                        c11 = '\b';
                        break;
                    }
                    c11 = 65535;
                    break;
                case -538363189:
                    if (str7.equals("V_MPEG4/ISO/ASP")) {
                        c11 = '\t';
                        break;
                    }
                    c11 = 65535;
                    break;
                case -538363109:
                    if (str7.equals("V_MPEG4/ISO/AVC")) {
                        c11 = '\n';
                        break;
                    }
                    c11 = 65535;
                    break;
                case -425012669:
                    if (str7.equals("S_VOBSUB")) {
                        c11 = 11;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -356037306:
                    if (str7.equals("A_DTS/LOSSLESS")) {
                        c11 = '\f';
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62923557:
                    if (str7.equals("A_AAC")) {
                        c11 = '\r';
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62923603:
                    if (str7.equals("A_AC3")) {
                        c11 = 14;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62927045:
                    if (str7.equals("A_DTS")) {
                        c11 = 15;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82318131:
                    if (str7.equals("V_AV1")) {
                        c11 = 16;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82338133:
                    if (str7.equals("V_VP8")) {
                        c11 = 17;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82338134:
                    if (str7.equals("V_VP9")) {
                        c11 = 18;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 99146302:
                    if (str7.equals("S_HDMV/PGS")) {
                        c11 = 19;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 444813526:
                    if (str7.equals("V_THEORA")) {
                        c11 = 20;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 542569478:
                    if (str7.equals("A_DTS/EXPRESS")) {
                        c11 = 21;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 635596514:
                    if (str7.equals("A_PCM/FLOAT/IEEE")) {
                        c11 = 22;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 725948237:
                    if (str7.equals("A_PCM/INT/BIG")) {
                        c11 = 23;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 725957860:
                    if (str7.equals("A_PCM/INT/LIT")) {
                        c11 = 24;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 738597099:
                    if (str7.equals("S_TEXT/ASS")) {
                        c11 = 25;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 855502857:
                    if (str7.equals("V_MPEGH/ISO/HEVC")) {
                        c11 = 26;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1045209816:
                    if (str7.equals("S_TEXT/WEBVTT")) {
                        c11 = 27;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1422270023:
                    if (str7.equals("S_TEXT/UTF8")) {
                        c11 = 28;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1809237540:
                    if (str7.equals("V_MPEG2")) {
                        c11 = 29;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1950749482:
                    if (str7.equals("A_EAC3")) {
                        c11 = 30;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1950789798:
                    if (str7.equals("A_FLAC")) {
                        c11 = 31;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1951062397:
                    if (str7.equals("A_OPUS")) {
                        c11 = ' ';
                        break;
                    }
                    c11 = 65535;
                    break;
                default:
                    c11 = 65535;
                    break;
            }
            String str8 = MimeTypes.AUDIO_RAW;
            mi miVar = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            r11 = null;
            byte[] bArr2 = null;
            switch (c11) {
                case 0:
                case 1:
                case '\t':
                    byte[] bArr3 = this.f70573k;
                    str = MimeTypes.VIDEO_MP4V;
                    singletonList = bArr3 == null ? null : Collections.singletonList(bArr3);
                    i15 = -1;
                    list4 = singletonList;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9 = str5;
                    str2 = str6;
                    str3 = str9;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null && (a11 = hp.a(new vn0(bArr))) != null) {
                        str2 = a11.f66155a;
                        str3 = "video/dolby-vision";
                    }
                    int i18 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                        aVar.c(this.O).n(this.Q).j(i15);
                        i16 = 1;
                    } else if (cd0.d(str3)) {
                        if (this.f70579q == 0) {
                            int i19 = this.f70577o;
                            i13 = -1;
                            if (i19 == -1) {
                                i19 = this.f70575m;
                            }
                            this.f70577o = i19;
                            int i21 = this.f70578p;
                            if (i21 == -1) {
                                i21 = this.f70576n;
                            }
                            this.f70578p = i21;
                        } else {
                            i13 = -1;
                        }
                        float f11 = (this.f70577o == i13 || (i14 = this.f70578p) == i13) ? -1.0f : (this.f70576n * r8) / (this.f70575m * i14);
                        if (this.f70586x) {
                            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) {
                                bArr2 = new byte[25];
                                ByteBuffer order = ByteBuffer.wrap(bArr2).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);
                            }
                            miVar = new mi(this.f70587y, this.A, this.f70588z, bArr2);
                        }
                        int intValue = (this.f70563a == null || !v80.f70533h0.containsKey(this.f70563a)) ? -1 : ((Integer) v80.f70533h0.get(this.f70563a)).intValue();
                        if (this.f70580r == 0 && Float.compare(this.f70581s, 0.0f) == 0 && Float.compare(this.f70582t, 0.0f) == 0) {
                            if (Float.compare(this.f70583u, 0.0f) != 0) {
                                if (Float.compare(this.f70582t, 90.0f) == 0) {
                                    i17 = 90;
                                } else if (Float.compare(this.f70582t, -180.0f) == 0 || Float.compare(this.f70582t, 180.0f) == 0) {
                                    i17 = 180;
                                } else if (Float.compare(this.f70582t, -90.0f) == 0) {
                                    i17 = 270;
                                }
                            }
                            aVar.q(this.f70575m).g(this.f70576n).b(f11).m(i17).a(this.f70584v).p(this.f70585w).a(miVar);
                            i16 = 2;
                        }
                        i17 = intValue;
                        aVar.q(this.f70575m).g(this.f70576n).b(f11).m(i17).a(this.f70584v).p(this.f70585w).a(miVar);
                        i16 = 2;
                    } else if (!MimeTypes.APPLICATION_SUBRIP.equals(str3) && !MimeTypes.TEXT_SSA.equals(str3) && !MimeTypes.TEXT_VTT.equals(str3) && !MimeTypes.APPLICATION_VOBSUB.equals(str3) && !MimeTypes.APPLICATION_PGS.equals(str3) && !MimeTypes.APPLICATION_DVBSUBS.equals(str3)) {
                        throw zn0.a("Unexpected MIME type.", (Exception) null);
                    }
                    if (this.f70563a != null && !v80.f70533h0.containsKey(this.f70563a)) {
                        aVar.d(this.f70563a);
                    }
                    qu a12 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18).a(list).a(str2).a(this.f70574l).a();
                    h51 a13 = nsVar.a(this.f70565c, i16);
                    this.X = a13;
                    a13.a(a12);
                    return;
                case 2:
                    vn0 vn0Var = new vn0(a(this.f70564b));
                    try {
                        int o11 = vn0Var.o();
                        if (o11 != 1) {
                            if (o11 == 65534) {
                                vn0Var.e(24);
                                if (vn0Var.p() == v80.f70532g0.getMostSignificantBits()) {
                                    break;
                                }
                            }
                            z11 = false;
                            if (!z11) {
                                i15 = b81.b(this.P);
                                if (i15 == 0) {
                                    StringBuilder a14 = j50.a("Unsupported PCM bit depth: ");
                                    a14.append(this.P);
                                    a14.append(". Setting mimeType to ");
                                    a14.append(MimeTypes.AUDIO_UNKNOWN);
                                    y70.d("MatroskaExtractor", a14.toString());
                                }
                                list4 = null;
                                str = str8;
                                str5 = str;
                                str6 = null;
                                list3 = list4;
                                i12 = -1;
                                String str92 = str5;
                                str2 = str6;
                                str3 = str92;
                                list = list3;
                                bArr = this.N;
                                if (bArr != null) {
                                    str2 = a11.f66155a;
                                    str3 = "video/dolby-vision";
                                    break;
                                }
                                int i182 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                                aVar = new qu.a();
                                if (!cd0.b(str3)) {
                                }
                                if (this.f70563a != null) {
                                    aVar.d(this.f70563a);
                                    break;
                                }
                                qu a122 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182).a(list).a(str2).a(this.f70574l).a();
                                h51 a132 = nsVar.a(this.f70565c, i16);
                                this.X = a132;
                                a132.a(a122);
                                return;
                            }
                            jg1.a("Non-PCM MS/ACM is unsupported. Setting mimeType to ", MimeTypes.AUDIO_UNKNOWN, "MatroskaExtractor");
                            str8 = MimeTypes.AUDIO_UNKNOWN;
                            i15 = -1;
                            list4 = null;
                            str = str8;
                            str5 = str;
                            str6 = null;
                            list3 = list4;
                            i12 = -1;
                            String str922 = str5;
                            str2 = str6;
                            str3 = str922;
                            list = list3;
                            bArr = this.N;
                            if (bArr != null) {
                            }
                            int i1822 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                            aVar = new qu.a();
                            if (!cd0.b(str3)) {
                            }
                            if (this.f70563a != null) {
                            }
                            qu a1222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822).a(list).a(str2).a(this.f70574l).a();
                            h51 a1322 = nsVar.a(this.f70565c, i16);
                            this.X = a1322;
                            a1322.a(a1222);
                            return;
                        }
                        z11 = true;
                        if (!z11) {
                        }
                        str8 = MimeTypes.AUDIO_UNKNOWN;
                        i15 = -1;
                        list4 = null;
                        str = str8;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str9222 = str5;
                        str2 = str6;
                        str3 = str9222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i18222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a12222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222).a(list).a(str2).a(this.f70574l).a();
                        h51 a13222 = nsVar.a(this.f70565c, i16);
                        this.X = a13222;
                        a13222.a(a12222);
                        return;
                    } catch (ArrayIndexOutOfBoundsException unused) {
                        throw zn0.a("Error parsing MS/ACM codec private", (Exception) null);
                    }
                case 3:
                    this.T = new i61();
                    str8 = MimeTypes.AUDIO_TRUEHD;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222 = str5;
                    str2 = str6;
                    str3 = str92222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222;
                    a132222.a(a122222);
                    return;
                case 4:
                    byte[] a15 = a(this.f70564b);
                    try {
                        if (a15[0] != 2) {
                            throw zn0.a("Error parsing vorbis codec private", (Exception) null);
                        }
                        int i22 = 1;
                        int i23 = 0;
                        while (true) {
                            int i24 = a15[i22] & 255;
                            if (i24 == 255) {
                                i23 += 255;
                                i22++;
                            } else {
                                int i25 = i22 + 1;
                                int i26 = i23 + i24;
                                int i27 = 0;
                                while (true) {
                                    int i28 = a15[i25] & 255;
                                    if (i28 != 255) {
                                        int i29 = i25 + 1;
                                        int i31 = i27 + i28;
                                        if (a15[i29] == 1) {
                                            byte[] bArr4 = new byte[i26];
                                            System.arraycopy(a15, i29, bArr4, 0, i26);
                                            int i32 = i29 + i26;
                                            if (a15[i32] == 3) {
                                                int i33 = i32 + i31;
                                                if (a15[i33] == 5) {
                                                    byte[] bArr5 = new byte[a15.length - i33];
                                                    System.arraycopy(a15, i33, bArr5, 0, a15.length - i33);
                                                    ArrayList arrayList2 = new ArrayList(2);
                                                    arrayList2.add(bArr4);
                                                    arrayList2.add(bArr5);
                                                    str2 = null;
                                                    i12 = 8192;
                                                    i15 = -1;
                                                    str3 = MimeTypes.AUDIO_VORBIS;
                                                    list = arrayList2;
                                                    bArr = this.N;
                                                    if (bArr != null) {
                                                    }
                                                    int i1822222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                                                    aVar = new qu.a();
                                                    if (!cd0.b(str3)) {
                                                    }
                                                    if (this.f70563a != null) {
                                                    }
                                                    qu a1222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222).a(list).a(str2).a(this.f70574l).a();
                                                    h51 a1322222 = nsVar.a(this.f70565c, i16);
                                                    this.X = a1322222;
                                                    a1322222.a(a1222222);
                                                    return;
                                                }
                                                throw zn0.a("Error parsing vorbis codec private", (Exception) null);
                                            }
                                            throw zn0.a("Error parsing vorbis codec private", (Exception) null);
                                        }
                                        throw zn0.a("Error parsing vorbis codec private", (Exception) null);
                                    }
                                    i27 += 255;
                                    i25++;
                                }
                            }
                        }
                    } catch (ArrayIndexOutOfBoundsException unused2) {
                        throw zn0.a("Error parsing vorbis codec private", (Exception) null);
                    }
                    break;
                case 5:
                    str3 = MimeTypes.AUDIO_MPEG_L2;
                    arrayList = null;
                    str2 = null;
                    i12 = 4096;
                    i15 = -1;
                    list = arrayList;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222;
                    a13222222.a(a12222222);
                    return;
                case 6:
                    str3 = MimeTypes.AUDIO_MPEG;
                    arrayList = null;
                    str2 = null;
                    i12 = 4096;
                    i15 = -1;
                    list = arrayList;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222;
                    a132222222.a(a122222222);
                    return;
                case 7:
                    vn0 vn0Var2 = new vn0(a(this.f70564b));
                    try {
                        vn0Var2.f(16);
                        long n11 = vn0Var2.n();
                        if (n11 == 1482049860) {
                            pair = new Pair("video/divx", null);
                        } else if (n11 == 859189832) {
                            pair = new Pair(MimeTypes.VIDEO_H263, null);
                        } else {
                            if (n11 == 826496599) {
                                byte[] c12 = vn0Var2.c();
                                for (int d11 = vn0Var2.d() + 20; d11 < c12.length - 4; d11++) {
                                    if (c12[d11] == 0 && c12[d11 + 1] == 0 && c12[d11 + 2] == 1 && c12[d11 + 3] == 15) {
                                        pair = new Pair(MimeTypes.VIDEO_VC1, Collections.singletonList(Arrays.copyOfRange(c12, d11, c12.length)));
                                    }
                                }
                                throw zn0.a("Failed to find FourCC VC1 initialization data", (Exception) null);
                            }
                            y70.d("MatroskaExtractor", "Unknown FourCC. Setting mimeType to video/x-unknown");
                            pair = new Pair(MimeTypes.VIDEO_UNKNOWN, null);
                        }
                        str = (String) pair.first;
                        list5 = (List) pair.second;
                        singletonList = list5;
                        i15 = -1;
                        list4 = singletonList;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str922222 = str5;
                        str2 = str6;
                        str3 = str922222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i1822222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a1222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222).a(list).a(str2).a(this.f70574l).a();
                        h51 a1322222222 = nsVar.a(this.f70565c, i16);
                        this.X = a1322222222;
                        a1322222222.a(a1222222222);
                        return;
                    } catch (ArrayIndexOutOfBoundsException unused3) {
                        throw zn0.a("Error parsing FourCC private data", (Exception) null);
                    }
                case '\b':
                    byte[] bArr6 = new byte[4];
                    System.arraycopy(a(this.f70564b), 0, bArr6, 0, 4);
                    com.yandex.mobile.ads.embedded.guava.collect.p a16 = com.yandex.mobile.ads.embedded.guava.collect.p.a(bArr6);
                    str = MimeTypes.APPLICATION_DVBSUBS;
                    list5 = a16;
                    singletonList = list5;
                    i15 = -1;
                    list4 = singletonList;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222 = str5;
                    str2 = str6;
                    str3 = str9222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222;
                    a13222222222.a(a12222222222);
                    return;
                case '\n':
                    xb a17 = xb.a(new vn0(a(this.f70564b)));
                    list2 = a17.f71221a;
                    this.Y = a17.f71222b;
                    str4 = a17.f71226f;
                    str5 = "video/avc";
                    i15 = -1;
                    List<byte[]> list6 = list2;
                    str6 = str4;
                    list3 = list6;
                    i12 = -1;
                    String str92222222 = str5;
                    str2 = str6;
                    str3 = str92222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222;
                    a132222222222.a(a122222222222);
                    return;
                case 11:
                    com.yandex.mobile.ads.embedded.guava.collect.p a18 = com.yandex.mobile.ads.embedded.guava.collect.p.a(a(this.f70564b));
                    str = MimeTypes.APPLICATION_VOBSUB;
                    list5 = a18;
                    singletonList = list5;
                    i15 = -1;
                    list4 = singletonList;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str922222222 = str5;
                    str2 = str6;
                    str3 = str922222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222;
                    a1322222222222.a(a1222222222222);
                    return;
                case '\f':
                    str8 = MimeTypes.AUDIO_DTS_HD;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222;
                    a13222222222222.a(a12222222222222);
                    return;
                case '\r':
                    List<byte[]> singletonList2 = Collections.singletonList(a(this.f70564b));
                    byte[] bArr7 = this.f70573k;
                    d.a a19 = d.a(new un0(bArr7.length, bArr7), false);
                    this.Q = a19.f64497a;
                    this.O = a19.f64498b;
                    str6 = a19.f64499c;
                    str5 = MimeTypes.AUDIO_AAC;
                    i15 = -1;
                    list3 = singletonList2;
                    i12 = -1;
                    String str92222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222;
                    a132222222222222.a(a122222222222222);
                    return;
                case 14:
                    str8 = MimeTypes.AUDIO_AC3;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str922222222222 = str5;
                    str2 = str6;
                    str3 = str922222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222;
                    a1322222222222222.a(a1222222222222222);
                    return;
                case 15:
                case 21:
                    str8 = MimeTypes.AUDIO_DTS;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222222;
                    a13222222222222222.a(a12222222222222222);
                    return;
                case 16:
                    str8 = "video/av01";
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222;
                    a132222222222222222.a(a122222222222222222);
                    return;
                case 17:
                    str8 = MimeTypes.VIDEO_VP8;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str922222222222222 = str5;
                    str2 = str6;
                    str3 = str922222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222222;
                    a1322222222222222222.a(a1222222222222222222);
                    return;
                case 18:
                    str8 = MimeTypes.VIDEO_VP9;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222222222;
                    a13222222222222222222.a(a12222222222222222222);
                    return;
                case 19:
                    str8 = MimeTypes.APPLICATION_PGS;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222;
                    a132222222222222222222.a(a122222222222222222222);
                    return;
                case 20:
                    str8 = MimeTypes.VIDEO_UNKNOWN;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str922222222222222222 = str5;
                    str2 = str6;
                    str3 = str922222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222222222;
                    a1322222222222222222222.a(a1222222222222222222222);
                    return;
                case 22:
                    if (this.P != 32) {
                        StringBuilder a21 = j50.a("Unsupported floating point PCM bit depth: ");
                        a21.append(this.P);
                        a21.append(". Setting mimeType to ");
                        a21.append(MimeTypes.AUDIO_UNKNOWN);
                        y70.d("MatroskaExtractor", a21.toString());
                        str8 = MimeTypes.AUDIO_UNKNOWN;
                        i15 = -1;
                        list4 = null;
                        str = str8;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str9222222222222222222 = str5;
                        str2 = str6;
                        str3 = str9222222222222222222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i18222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a12222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                        h51 a13222222222222222222222 = nsVar.a(this.f70565c, i16);
                        this.X = a13222222222222222222222;
                        a13222222222222222222222.a(a12222222222222222222222);
                        return;
                    }
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222222;
                    a132222222222222222222222.a(a122222222222222222222222);
                    return;
                case 23:
                    int i34 = this.P;
                    if (i34 == 8) {
                        i15 = 3;
                        list4 = null;
                        str = str8;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str922222222222222222222 = str5;
                        str2 = str6;
                        str3 = str922222222222222222222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i1822222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a1222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                        h51 a1322222222222222222222222 = nsVar.a(this.f70565c, i16);
                        this.X = a1322222222222222222222222;
                        a1322222222222222222222222.a(a1222222222222222222222222);
                        return;
                    }
                    if (i34 != 16) {
                        StringBuilder a22 = j50.a("Unsupported big endian PCM bit depth: ");
                        a22.append(this.P);
                        a22.append(". Setting mimeType to ");
                        a22.append(MimeTypes.AUDIO_UNKNOWN);
                        y70.d("MatroskaExtractor", a22.toString());
                        str8 = MimeTypes.AUDIO_UNKNOWN;
                        i15 = -1;
                        list4 = null;
                        str = str8;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str9222222222222222222222 = str5;
                        str2 = str6;
                        str3 = str9222222222222222222222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i18222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a12222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                        h51 a13222222222222222222222222 = nsVar.a(this.f70565c, i16);
                        this.X = a13222222222222222222222222;
                        a13222222222222222222222222.a(a12222222222222222222222222);
                        return;
                    }
                    i15 = 268435456;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222222222;
                    a132222222222222222222222222.a(a122222222222222222222222222);
                    return;
                case 24:
                    i15 = b81.b(this.P);
                    if (i15 == 0) {
                        StringBuilder a23 = j50.a("Unsupported little endian PCM bit depth: ");
                        a23.append(this.P);
                        a23.append(". Setting mimeType to ");
                        a23.append(MimeTypes.AUDIO_UNKNOWN);
                        y70.d("MatroskaExtractor", a23.toString());
                        str8 = MimeTypes.AUDIO_UNKNOWN;
                        i15 = -1;
                        list4 = null;
                        str = str8;
                        str5 = str;
                        str6 = null;
                        list3 = list4;
                        i12 = -1;
                        String str922222222222222222222222 = str5;
                        str2 = str6;
                        str3 = str922222222222222222222222;
                        list = list3;
                        bArr = this.N;
                        if (bArr != null) {
                        }
                        int i1822222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                        aVar = new qu.a();
                        if (!cd0.b(str3)) {
                        }
                        if (this.f70563a != null) {
                        }
                        qu a1222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                        h51 a1322222222222222222222222222 = nsVar.a(this.f70565c, i16);
                        this.X = a1322222222222222222222222222;
                        a1322222222222222222222222222.a(a1222222222222222222222222222);
                        return;
                    }
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222222222222222222;
                    a13222222222222222222222222222.a(a12222222222222222222222222222);
                    return;
                case 25:
                    com.yandex.mobile.ads.embedded.guava.collect.p a24 = com.yandex.mobile.ads.embedded.guava.collect.p.a(v80.f70529d0, a(this.f70564b));
                    str = MimeTypes.TEXT_SSA;
                    list5 = a24;
                    singletonList = list5;
                    i15 = -1;
                    list4 = singletonList;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222222222222;
                    a132222222222222222222222222222.a(a122222222222222222222222222222);
                    return;
                case 26:
                    ix a25 = ix.a(new vn0(a(this.f70564b)));
                    list2 = a25.f66484a;
                    this.Y = a25.f66485b;
                    str4 = a25.f66487d;
                    str5 = "video/hevc";
                    i15 = -1;
                    List<byte[]> list62 = list2;
                    str6 = str4;
                    list3 = list62;
                    i12 = -1;
                    String str922222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str922222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222222222222222222;
                    a1322222222222222222222222222222.a(a1222222222222222222222222222222);
                    return;
                case 27:
                    str8 = MimeTypes.TEXT_VTT;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222222222222222222222;
                    a13222222222222222222222222222222.a(a12222222222222222222222222222222);
                    return;
                case 28:
                    str8 = MimeTypes.APPLICATION_SUBRIP;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222222222222222;
                    a132222222222222222222222222222222.a(a122222222222222222222222222222222);
                    return;
                case 29:
                    str8 = MimeTypes.VIDEO_MPEG2;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str922222222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str922222222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222222222222222222222;
                    a1322222222222222222222222222222222.a(a1222222222222222222222222222222222);
                    return;
                case 30:
                    str8 = MimeTypes.AUDIO_E_AC3;
                    i15 = -1;
                    list4 = null;
                    str = str8;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str9222222222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str9222222222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i18222222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a12222222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i18222222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a13222222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a13222222222222222222222222222222222;
                    a13222222222222222222222222222222222.a(a12222222222222222222222222222222222);
                    return;
                case 31:
                    List<byte[]> singletonList3 = Collections.singletonList(a(this.f70564b));
                    str = MimeTypes.AUDIO_FLAC;
                    list5 = singletonList3;
                    singletonList = list5;
                    i15 = -1;
                    list4 = singletonList;
                    str5 = str;
                    str6 = null;
                    list3 = list4;
                    i12 = -1;
                    String str92222222222222222222222222222222 = str5;
                    str2 = str6;
                    str3 = str92222222222222222222222222222222;
                    list = list3;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i182222222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a122222222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i182222222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a132222222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a132222222222222222222222222222222222;
                    a132222222222222222222222222222222222.a(a122222222222222222222222222222222222);
                    return;
                case ' ':
                    ArrayList arrayList3 = new ArrayList(3);
                    arrayList3.add(a(this.f70564b));
                    ByteBuffer allocate = ByteBuffer.allocate(8);
                    ByteOrder byteOrder = ByteOrder.LITTLE_ENDIAN;
                    arrayList3.add(allocate.order(byteOrder).putLong(this.R).array());
                    arrayList3.add(ByteBuffer.allocate(8).order(byteOrder).putLong(this.S).array());
                    str3 = MimeTypes.AUDIO_OPUS;
                    str2 = null;
                    i12 = 5760;
                    arrayList = arrayList3;
                    i15 = -1;
                    list = arrayList;
                    bArr = this.N;
                    if (bArr != null) {
                    }
                    int i1822222222222222222222222222222222222 = (this.V ? 1 : 0) | 0 | (!this.U ? 2 : 0);
                    aVar = new qu.a();
                    if (!cd0.b(str3)) {
                    }
                    if (this.f70563a != null) {
                    }
                    qu a1222222222222222222222222222222222222 = aVar.h(i11).f(str3).i(i12).e(this.W).o(i1822222222222222222222222222222222222).a(list).a(str2).a(this.f70574l).a();
                    h51 a1322222222222222222222222222222222222 = nsVar.a(this.f70565c, i16);
                    this.X = a1322222222222222222222222222222222222;
                    a1322222222222222222222222222222222222.a(a1222222222222222222222222222222222222);
                    return;
                default:
                    throw zn0.a("Unrecognized codec identifier.", (Exception) null);
            }
        }

        public boolean a(boolean z11) {
            return "A_OPUS".equals(this.f70564b) ? z11 : this.f70568f > 0;
        }

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

    static {
        new ps() {
            @Override
            public final ls[] a() {
                ls[] d11;
                d11 = v80.d();
                return d11;
            }

            @Override
            public ls[] a(Uri uri, Map map) {
                return ru1.a(this, uri, map);
            }
        };
        f70528c0 = new byte[]{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};
        f70529d0 = b81.b("Format: Start, End, ReadOrder, Layer, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
        f70530e0 = new byte[]{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};
        f70531f0 = new byte[]{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};
        f70532g0 = new UUID(72057594037932032L, -9223371306706625679L);
        HashMap hashMap = new HashMap();
        u80.a(0, hashMap, "htc_video_rotA-000", 90, "htc_video_rotA-090", 180, "htc_video_rotA-180", 270, "htc_video_rotA-270");
        f70533h0 = Collections.unmodifiableMap(hashMap);
    }

    public v80() {
        this(new sm());
    }

    public static ls[] d() {
        return new ls[]{new v80()};
    }

    private void e() {
        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.f70535a0 = false;
        this.f70545j.c(0);
    }

    public v80(sm smVar) {
        this.f70552q = -1L;
        this.f70553r = C.TIME_UNSET;
        this.f70554s = C.TIME_UNSET;
        this.f70555t = C.TIME_UNSET;
        this.f70561z = -1L;
        this.A = -1L;
        this.B = C.TIME_UNSET;
        this.f70534a = smVar;
        smVar.a(new a(this, 0));
        this.f70539d = true;
        this.f70536b = new k81();
        this.f70538c = new SparseArray<>();
        this.f70542g = new vn0(4);
        this.f70543h = new vn0(ByteBuffer.allocate(4).putInt(-1).array());
        this.f70544i = new vn0(4);
        this.f70540e = new vn0(xf0.f71311a);
        this.f70541f = new vn0(4);
        this.f70545j = new vn0();
        this.f70546k = new vn0();
        this.f70547l = new vn0(8);
        this.f70548m = new vn0();
        this.f70549n = new vn0();
        this.L = new int[1];
    }

    @Override
    public final boolean a(ms msVar) throws IOException {
        return new z01().b((um) msVar);
    }

    @CallSuper
    public final void b(int i11) throws zn0 {
        py0 bVar;
        int i12;
        w9.b(this.f70537b0);
        char c11 = '\b';
        int i13 = 0;
        if (i11 == 160) {
            if (this.G != 2) {
                return;
            }
            b bVar2 = this.f70538c.get(this.M);
            bVar2.X.getClass();
            if (this.R > 0 && "A_OPUS".equals(bVar2.f70564b)) {
                vn0 vn0Var = this.f70549n;
                byte[] array = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(this.R).array();
                vn0Var.getClass();
                vn0Var.a(array.length, array);
            }
            int i14 = 0;
            for (int i15 = 0; i15 < this.K; i15++) {
                i14 += this.L[i15];
            }
            int i16 = 0;
            while (i16 < this.K) {
                long j11 = this.H + ((bVar2.f70567e * i16) / 1000);
                int i17 = this.O;
                if (i16 == 0 && !this.Q) {
                    i17 |= 1;
                }
                int i18 = this.L[i16];
                int i19 = i14 - i18;
                a(bVar2, j11, i17, i18, i19);
                i16++;
                i14 = i19;
            }
            this.G = 0;
            return;
        }
        if (i11 != 174) {
            if (i11 == 19899) {
                int i21 = this.f70558w;
                if (i21 != -1) {
                    long j12 = this.f70559x;
                    if (j12 != -1) {
                        if (i21 == 475249515) {
                            this.f70561z = j12;
                            return;
                        }
                        return;
                    }
                }
                throw zn0.a("Mandatory element SeekID or SeekPosition not found", (Exception) null);
            }
            if (i11 == 25152) {
                a(i11);
                b bVar3 = this.f70556u;
                if (bVar3.f70570h) {
                    h51.a aVar = bVar3.f70572j;
                    if (aVar != null) {
                        bVar3.f70574l = new DrmInitData(new DrmInitData.SchemeData(af.f63739a, null, "video/webm", aVar.f65964b));
                        return;
                    }
                    throw zn0.a("Encrypted Track found but ContentEncKeyID was not found", (Exception) null);
                }
                return;
            }
            if (i11 == 28032) {
                a(i11);
                b bVar4 = this.f70556u;
                if (bVar4.f70570h && bVar4.f70571i != null) {
                    throw zn0.a("Combining encryption and compression is not supported", (Exception) null);
                }
                return;
            }
            if (i11 == 357149030) {
                if (this.f70553r == C.TIME_UNSET) {
                    this.f70553r = 1000000L;
                }
                long j13 = this.f70554s;
                if (j13 != C.TIME_UNSET) {
                    this.f70555t = a(j13);
                    return;
                }
                return;
            }
            if (i11 == 374648427) {
                if (this.f70538c.size() != 0) {
                    this.f70537b0.a();
                    return;
                }
                throw zn0.a("No valid tracks were found", (Exception) null);
            }
            if (i11 != 475249515) {
                return;
            }
            if (!this.f70557v) {
                ns nsVar = this.f70537b0;
                z70 z70Var = this.C;
                z70 z70Var2 = this.D;
                if (this.f70552q != -1 && this.f70555t != C.TIME_UNSET && z70Var != null && z70Var.a() != 0 && z70Var2 != null && z70Var2.a() == z70Var.a()) {
                    int a11 = z70Var.a();
                    int[] iArr = new int[a11];
                    long[] jArr = new long[a11];
                    long[] jArr2 = new long[a11];
                    long[] jArr3 = new long[a11];
                    for (int i22 = 0; i22 < a11; i22++) {
                        jArr3[i22] = z70Var.a(i22);
                        jArr[i22] = z70Var2.a(i22) + this.f70552q;
                    }
                    while (true) {
                        i12 = a11 - 1;
                        if (i13 >= i12) {
                            break;
                        }
                        int i23 = i13 + 1;
                        iArr[i13] = (int) (jArr[i23] - jArr[i13]);
                        jArr2[i13] = jArr3[i23] - jArr3[i13];
                        i13 = i23;
                    }
                    iArr[i12] = (int) ((this.f70552q + this.f70551p) - jArr[i12]);
                    long j14 = this.f70555t - jArr3[i12];
                    jArr2[i12] = j14;
                    if (j14 <= 0) {
                        y70.d("MatroskaExtractor", "Discarding last cue point with unexpected duration: " + j14);
                        iArr = Arrays.copyOf(iArr, i12);
                        jArr = Arrays.copyOf(jArr, i12);
                        jArr2 = Arrays.copyOf(jArr2, i12);
                        jArr3 = Arrays.copyOf(jArr3, i12);
                    }
                    bVar = new pg(iArr, jArr, jArr2, jArr3);
                } else {
                    bVar = new py0.b(this.f70555t, 0L);
                }
                nsVar.a(bVar);
                this.f70557v = true;
            }
            this.C = null;
            this.D = null;
            return;
        }
        b bVar5 = (b) w9.b(this.f70556u);
        String str = bVar5.f70564b;
        if (str != null) {
            switch (str.hashCode()) {
                case -2095576542:
                    if (str.equals("V_MPEG4/ISO/AP")) {
                        c11 = 0;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -2095575984:
                    if (str.equals("V_MPEG4/ISO/SP")) {
                        c11 = 1;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1985379776:
                    if (str.equals("A_MS/ACM")) {
                        c11 = 2;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1784763192:
                    if (str.equals("A_TRUEHD")) {
                        c11 = 3;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1730367663:
                    if (str.equals("A_VORBIS")) {
                        c11 = 4;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1482641358:
                    if (str.equals("A_MPEG/L2")) {
                        c11 = 5;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1482641357:
                    if (str.equals("A_MPEG/L3")) {
                        c11 = 6;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -1373388978:
                    if (str.equals("V_MS/VFW/FOURCC")) {
                        c11 = 7;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -933872740:
                    break;
                case -538363189:
                    if (str.equals("V_MPEG4/ISO/ASP")) {
                        c11 = '\t';
                        break;
                    }
                    c11 = 65535;
                    break;
                case -538363109:
                    if (str.equals("V_MPEG4/ISO/AVC")) {
                        c11 = '\n';
                        break;
                    }
                    c11 = 65535;
                    break;
                case -425012669:
                    if (str.equals("S_VOBSUB")) {
                        c11 = 11;
                        break;
                    }
                    c11 = 65535;
                    break;
                case -356037306:
                    if (str.equals("A_DTS/LOSSLESS")) {
                        c11 = '\f';
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62923557:
                    if (str.equals("A_AAC")) {
                        c11 = '\r';
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62923603:
                    if (str.equals("A_AC3")) {
                        c11 = 14;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 62927045:
                    if (str.equals("A_DTS")) {
                        c11 = 15;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82318131:
                    if (str.equals("V_AV1")) {
                        c11 = 16;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82338133:
                    if (str.equals("V_VP8")) {
                        c11 = 17;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 82338134:
                    if (str.equals("V_VP9")) {
                        c11 = 18;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 99146302:
                    if (str.equals("S_HDMV/PGS")) {
                        c11 = 19;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 444813526:
                    if (str.equals("V_THEORA")) {
                        c11 = 20;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 542569478:
                    if (str.equals("A_DTS/EXPRESS")) {
                        c11 = 21;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 635596514:
                    if (str.equals("A_PCM/FLOAT/IEEE")) {
                        c11 = 22;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 725948237:
                    if (str.equals("A_PCM/INT/BIG")) {
                        c11 = 23;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 725957860:
                    if (str.equals("A_PCM/INT/LIT")) {
                        c11 = 24;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 738597099:
                    if (str.equals("S_TEXT/ASS")) {
                        c11 = 25;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 855502857:
                    if (str.equals("V_MPEGH/ISO/HEVC")) {
                        c11 = 26;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1045209816:
                    if (str.equals("S_TEXT/WEBVTT")) {
                        c11 = 27;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1422270023:
                    if (str.equals("S_TEXT/UTF8")) {
                        c11 = 28;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1809237540:
                    if (str.equals("V_MPEG2")) {
                        c11 = 29;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1950749482:
                    if (str.equals("A_EAC3")) {
                        c11 = 30;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1950789798:
                    if (str.equals("A_FLAC")) {
                        c11 = 31;
                        break;
                    }
                    c11 = 65535;
                    break;
                case 1951062397:
                    if (str.equals("A_OPUS")) {
                        c11 = ' ';
                        break;
                    }
                    c11 = 65535;
                    break;
                default:
                    c11 = 65535;
                    break;
            }
            switch (c11) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case '\b':
                case '\t':
                case '\n':
                case 11:
                case '\f':
                case '\r':
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 26:
                case 27:
                case 28:
                case 29:
                case 30:
                case 31:
                case ' ':
                    i13 = 1;
                    break;
            }
            if (i13 != 0) {
                bVar5.a(this.f70537b0, bVar5.f70565c);
                this.f70538c.put(bVar5.f70565c, bVar5);
            }
            this.f70556u = null;
            return;
        }
        throw zn0.a("CodecId is missing in TrackEntry element", (Exception) null);
    }

    @Override
    public final void a(ns nsVar) {
        this.f70537b0 = nsVar;
    }

    @Override
    @CallSuper
    public final void a(long j11, long j12) {
        this.B = C.TIME_UNSET;
        this.G = 0;
        ((sm) this.f70534a).a();
        this.f70536b.b();
        e();
        for (int i11 = 0; i11 < this.f70538c.size(); i11++) {
            i61 i61Var = this.f70538c.valueAt(i11).T;
            if (i61Var != null) {
                i61Var.a();
            }
        }
    }

    @Override
    public final int a(ms msVar, lq0 lq0Var) throws IOException {
        boolean z11;
        this.F = false;
        boolean z12 = true;
        while (z12 && !this.F) {
            um umVar = (um) msVar;
            z12 = ((sm) this.f70534a).a(umVar);
            if (z12) {
                long position = umVar.getPosition();
                if (this.f70560y) {
                    this.A = position;
                    lq0Var.f67387a = this.f70561z;
                    this.f70560y = false;
                } else {
                    if (this.f70557v) {
                        long j11 = this.A;
                        if (j11 != -1) {
                            lq0Var.f67387a = j11;
                            this.A = -1L;
                        }
                    }
                    z11 = false;
                    if (!z11) {
                        return 1;
                    }
                }
                z11 = true;
                if (!z11) {
                }
            }
        }
        if (z12) {
            return 0;
        }
        for (int i11 = 0; i11 < this.f70538c.size(); i11++) {
            b valueAt = this.f70538c.valueAt(i11);
            valueAt.X.getClass();
            i61 i61Var = valueAt.T;
            if (i61Var != null) {
                i61Var.a(valueAt.X, valueAt.f70572j);
            }
        }
        return -1;
    }

    @Override
    public final void release() {
    }

    @CallSuper
    public final void a(int i11, long j11) throws zn0 {
        z70 z70Var;
        if (i11 == 20529) {
            if (j11 == 0) {
                return;
            }
            throw zn0.a("ContentEncodingOrder " + j11 + " not supported", (Exception) null);
        }
        if (i11 == 20530) {
            if (j11 == 1) {
                return;
            }
            throw zn0.a("ContentEncodingScope " + j11 + " not supported", (Exception) null);
        }
        int i12 = 3;
        int i13 = 2;
        switch (i11) {
            case 131:
                a(i11);
                this.f70556u.f70566d = (int) j11;
                return;
            case 136:
                a(i11);
                this.f70556u.V = j11 == 1;
                return;
            case 155:
                this.I = a(j11);
                return;
            case 159:
                a(i11);
                this.f70556u.O = (int) j11;
                return;
            case 176:
                a(i11);
                this.f70556u.f70575m = (int) j11;
                return;
            case 179:
                z70 z70Var2 = this.C;
                if (z70Var2 != null && this.D != null) {
                    z70Var2.a(a(j11));
                    return;
                }
                throw zn0.a("Element " + i11 + " must be in a Cues", (Exception) null);
            case 186:
                a(i11);
                this.f70556u.f70576n = (int) j11;
                return;
            case 215:
                a(i11);
                this.f70556u.f70565c = (int) j11;
                return;
            case 231:
                this.B = a(j11);
                return;
            case 238:
                this.P = (int) j11;
                return;
            case 241:
                if (this.E) {
                    return;
                }
                if (this.C != null && (z70Var = this.D) != null) {
                    z70Var.a(j11);
                    this.E = true;
                    return;
                } else {
                    throw zn0.a("Element " + i11 + " must be in a Cues", (Exception) null);
                }
            case 251:
                this.Q = true;
                return;
            case 16871:
                a(i11);
                this.f70556u.f70569g = (int) j11;
                return;
            case 16980:
                if (j11 == 3) {
                    return;
                }
                throw zn0.a("ContentCompAlgo " + j11 + " not supported", (Exception) null);
            case 17029:
                if (j11 < 1 || j11 > 2) {
                    throw zn0.a("DocTypeReadVersion " + j11 + " not supported", (Exception) null);
                }
                return;
            case 17143:
                if (j11 == 1) {
                    return;
                }
                throw zn0.a("EBMLReadVersion " + j11 + " not supported", (Exception) null);
            case 18401:
                if (j11 == 5) {
                    return;
                }
                throw zn0.a("ContentEncAlgo " + j11 + " not supported", (Exception) null);
            case 18408:
                if (j11 == 1) {
                    return;
                }
                throw zn0.a("AESSettingsCipherMode " + j11 + " not supported", (Exception) null);
            case 21420:
                this.f70559x = j11 + this.f70552q;
                return;
            case 21432:
                int i14 = (int) j11;
                a(i11);
                if (i14 == 0) {
                    this.f70556u.f70585w = 0;
                    return;
                }
                if (i14 == 1) {
                    this.f70556u.f70585w = 2;
                    return;
                } else if (i14 == 3) {
                    this.f70556u.f70585w = 1;
                    return;
                } else {
                    if (i14 != 15) {
                        return;
                    }
                    this.f70556u.f70585w = 3;
                    return;
                }
            case 21680:
                a(i11);
                this.f70556u.f70577o = (int) j11;
                return;
            case 21682:
                a(i11);
                this.f70556u.f70579q = (int) j11;
                return;
            case 21690:
                a(i11);
                this.f70556u.f70578p = (int) j11;
                return;
            case 21930:
                a(i11);
                this.f70556u.U = j11 == 1;
                return;
            case 21998:
                a(i11);
                this.f70556u.f70568f = (int) j11;
                return;
            case 22186:
                a(i11);
                this.f70556u.R = j11;
                return;
            case 22203:
                a(i11);
                this.f70556u.S = j11;
                return;
            case 25188:
                a(i11);
                this.f70556u.P = (int) j11;
                return;
            case 30114:
                this.R = j11;
                return;
            case 30321:
                a(i11);
                int i15 = (int) j11;
                if (i15 == 0) {
                    this.f70556u.f70580r = 0;
                    return;
                }
                if (i15 == 1) {
                    this.f70556u.f70580r = 1;
                    return;
                } else if (i15 == 2) {
                    this.f70556u.f70580r = 2;
                    return;
                } else {
                    if (i15 != 3) {
                        return;
                    }
                    this.f70556u.f70580r = 3;
                    return;
                }
            case 2352003:
                a(i11);
                this.f70556u.f70567e = (int) j11;
                return;
            case 2807729:
                this.f70553r = j11;
                return;
            default:
                switch (i11) {
                    case 21945:
                        a(i11);
                        int i16 = (int) j11;
                        if (i16 == 1) {
                            this.f70556u.A = 2;
                            return;
                        } else {
                            if (i16 != 2) {
                                return;
                            }
                            this.f70556u.A = 1;
                            return;
                        }
                    case 21946:
                        a(i11);
                        int i17 = (int) j11;
                        ue.a<mi> aVar = mi.f67582f;
                        if (i17 != 1) {
                            if (i17 == 16) {
                                i12 = 6;
                            } else if (i17 == 18) {
                                i12 = 7;
                            } else if (i17 != 6 && i17 != 7) {
                                i12 = -1;
                            }
                        }
                        if (i12 != -1) {
                            this.f70556u.f70588z = i12;
                            return;
                        }
                        return;
                    case 21947:
                        a(i11);
                        b bVar = this.f70556u;
                        bVar.f70586x = true;
                        int i18 = (int) j11;
                        ue.a<mi> aVar2 = mi.f67582f;
                        if (i18 == 1) {
                            i13 = 1;
                        } else if (i18 == 9) {
                            i13 = 6;
                        } else if (i18 != 4 && i18 != 5 && i18 != 6 && i18 != 7) {
                            i13 = -1;
                        }
                        if (i13 != -1) {
                            bVar.f70587y = i13;
                            return;
                        }
                        return;
                    case 21948:
                        a(i11);
                        this.f70556u.B = (int) j11;
                        return;
                    case 21949:
                        a(i11);
                        this.f70556u.C = (int) j11;
                        return;
                    default:
                        return;
                }
        }
    }

    @CallSuper
    public final void a(int i11, int i12, um umVar) throws IOException {
        long j11;
        int i13;
        int i14;
        int i15;
        int i16 = 4;
        int i17 = 1;
        int i18 = 0;
        if (i11 != 161 && i11 != 163) {
            if (i11 == 165) {
                if (this.G != 2) {
                    return;
                }
                b bVar = this.f70538c.get(this.M);
                if (this.P == 4 && "V_VP9".equals(bVar.f70564b)) {
                    this.f70549n.c(i12);
                    umVar.a(this.f70549n.c(), 0, i12, false);
                    return;
                } else {
                    umVar.a(i12);
                    return;
                }
            }
            if (i11 == 16877) {
                a(i11);
                b bVar2 = this.f70556u;
                if (bVar2.f70569g != 1685485123 && bVar2.f70569g != 1685480259) {
                    umVar.a(i12);
                    return;
                }
                byte[] bArr = new byte[i12];
                bVar2.N = bArr;
                umVar.a(bArr, 0, i12, false);
                return;
            }
            if (i11 == 16981) {
                a(i11);
                byte[] bArr2 = new byte[i12];
                this.f70556u.f70571i = bArr2;
                umVar.a(bArr2, 0, i12, false);
                return;
            }
            if (i11 == 18402) {
                byte[] bArr3 = new byte[i12];
                umVar.a(bArr3, 0, i12, false);
                a(i11);
                this.f70556u.f70572j = new h51.a(1, 0, 0, bArr3);
                return;
            }
            if (i11 == 21419) {
                Arrays.fill(this.f70544i.c(), (byte) 0);
                umVar.a(this.f70544i.c(), 4 - i12, i12, false);
                this.f70544i.e(0);
                this.f70558w = (int) this.f70544i.v();
                return;
            }
            if (i11 == 25506) {
                a(i11);
                byte[] bArr4 = new byte[i12];
                this.f70556u.f70573k = bArr4;
                umVar.a(bArr4, 0, i12, false);
                return;
            }
            if (i11 == 30322) {
                a(i11);
                byte[] bArr5 = new byte[i12];
                this.f70556u.f70584v = bArr5;
                umVar.a(bArr5, 0, i12, false);
                return;
            }
            throw zn0.a("Unexpected id: " + i11, (Exception) null);
        }
        if (this.G == 0) {
            this.M = (int) this.f70536b.a(umVar, false, true, 8);
            this.N = this.f70536b.a();
            this.I = C.TIME_UNSET;
            this.G = 1;
            this.f70542g.c(0);
        }
        b bVar3 = this.f70538c.get(this.M);
        if (bVar3 == null) {
            umVar.a(i12 - this.N);
            this.G = 0;
            return;
        }
        bVar3.X.getClass();
        if (this.G == 1) {
            a(umVar, 3);
            int i19 = (this.f70542g.c()[2] & 6) >> 1;
            byte b11 = 255;
            if (i19 == 0) {
                this.K = 1;
                int[] iArr = this.L;
                if (iArr == null) {
                    iArr = new int[1];
                } else if (iArr.length < 1) {
                    iArr = new int[Math.max(iArr.length * 2, 1)];
                }
                this.L = iArr;
                iArr[0] = (i12 - this.N) - 3;
            } else {
                a(umVar, 4);
                int i21 = (this.f70542g.c()[3] & 255) + 1;
                this.K = i21;
                int[] iArr2 = this.L;
                if (iArr2 == null) {
                    iArr2 = new int[i21];
                } else if (iArr2.length < i21) {
                    iArr2 = new int[Math.max(iArr2.length * 2, i21)];
                }
                this.L = iArr2;
                if (i19 == 2) {
                    int i22 = (i12 - this.N) - 4;
                    int i23 = this.K;
                    Arrays.fill(iArr2, 0, i23, i22 / i23);
                } else if (i19 == 1) {
                    int i24 = 0;
                    int i25 = 0;
                    while (true) {
                        i13 = this.K - 1;
                        if (i24 >= i13) {
                            break;
                        }
                        this.L[i24] = 0;
                        do {
                            i16++;
                            a(umVar, i16);
                            i14 = this.f70542g.c()[i16 - 1] & 255;
                            int[] iArr3 = this.L;
                            i15 = iArr3[i24] + i14;
                            iArr3[i24] = i15;
                        } while (i14 == 255);
                        i25 += i15;
                        i24++;
                    }
                    this.L[i13] = ((i12 - this.N) - i16) - i25;
                } else {
                    if (i19 != 3) {
                        throw zn0.a("Unexpected lacing value: " + i19, (Exception) null);
                    }
                    int i26 = 0;
                    int i27 = 0;
                    while (true) {
                        int i28 = this.K - i17;
                        if (i26 < i28) {
                            this.L[i26] = i18;
                            i16++;
                            a(umVar, i16);
                            int i29 = i16 - 1;
                            if (this.f70542g.c()[i29] == 0) {
                                throw zn0.a("No valid varint length mask found", (Exception) null);
                            }
                            int i31 = 0;
                            while (true) {
                                if (i31 >= 8) {
                                    j11 = 0;
                                    break;
                                }
                                int i32 = i17 << (7 - i31);
                                if ((this.f70542g.c()[i29] & i32) != 0) {
                                    i16 += i31;
                                    a(umVar, i16);
                                    j11 = this.f70542g.c()[i29] & b11 & (~i32);
                                    int i33 = i29 + 1;
                                    while (i33 < i16) {
                                        j11 = (j11 << 8) | (this.f70542g.c()[i33] & b11);
                                        i33++;
                                        b11 = 255;
                                    }
                                    if (i26 > 0) {
                                        j11 -= (1 << ((i31 * 7) + 6)) - 1;
                                    }
                                } else {
                                    i31++;
                                    i17 = 1;
                                    b11 = 255;
                                }
                            }
                            if (j11 < -2147483648L || j11 > 2147483647L) {
                                break;
                            }
                            int i34 = (int) j11;
                            int[] iArr4 = this.L;
                            if (i26 != 0) {
                                i34 += iArr4[i26 - 1];
                            }
                            iArr4[i26] = i34;
                            i27 += i34;
                            i26++;
                            i17 = 1;
                            i18 = 0;
                            b11 = 255;
                        } else {
                            this.L[i28] = ((i12 - this.N) - i16) - i27;
                            break;
                        }
                    }
                }
            }
            this.H = this.B + a((this.f70542g.c()[0] << 8) | (this.f70542g.c()[1] & 255));
            this.O = (bVar3.f70566d == 2 || (i11 == 163 && (this.f70542g.c()[2] & com.startapp.b4.f52487d) == 128)) ? 1 : 0;
            this.G = 2;
            this.J = 0;
        }
        if (i11 == 163) {
            while (true) {
                int i35 = this.J;
                if (i35 < this.K) {
                    a(bVar3, ((this.J * bVar3.f70567e) / 1000) + this.H, this.O, a(umVar, bVar3, this.L[i35], false), 0);
                    this.J++;
                } else {
                    this.G = 0;
                    return;
                }
            }
        } else {
            while (true) {
                int i36 = this.J;
                if (i36 >= this.K) {
                    return;
                }
                int[] iArr5 = this.L;
                iArr5[i36] = a(umVar, bVar3, iArr5[i36], true);
                this.J++;
            }
        }
    }

    private void a(int i11) throws zn0 {
        if (this.f70556u != null) {
            return;
        }
        throw zn0.a("Element " + i11 + " must be in a TrackEntry", (Exception) null);
    }

    @CallSuper
    public final void a(int i11, double d11) throws zn0 {
        if (i11 == 181) {
            a(i11);
            this.f70556u.Q = (int) d11;
            return;
        }
        if (i11 != 17545) {
            switch (i11) {
                case 21969:
                    a(i11);
                    this.f70556u.D = (float) d11;
                    return;
                case 21970:
                    a(i11);
                    this.f70556u.E = (float) d11;
                    return;
                case 21971:
                    a(i11);
                    this.f70556u.F = (float) d11;
                    return;
                case 21972:
                    a(i11);
                    this.f70556u.G = (float) d11;
                    return;
                case 21973:
                    a(i11);
                    this.f70556u.H = (float) d11;
                    return;
                case 21974:
                    a(i11);
                    this.f70556u.I = (float) d11;
                    return;
                case 21975:
                    a(i11);
                    this.f70556u.J = (float) d11;
                    return;
                case 21976:
                    a(i11);
                    this.f70556u.K = (float) d11;
                    return;
                case 21977:
                    a(i11);
                    this.f70556u.L = (float) d11;
                    return;
                case 21978:
                    a(i11);
                    this.f70556u.M = (float) d11;
                    return;
                default:
                    switch (i11) {
                        case 30323:
                            a(i11);
                            this.f70556u.f70581s = (float) d11;
                            return;
                        case 30324:
                            a(i11);
                            this.f70556u.f70582t = (float) d11;
                            return;
                        case 30325:
                            a(i11);
                            this.f70556u.f70583u = (float) d11;
                            return;
                        default:
                            return;
                    }
            }
        }
        this.f70554s = (long) d11;
    }

    @CallSuper
    public final void a(int i11, String str) throws zn0 {
        if (i11 == 134) {
            a(i11);
            this.f70556u.f70564b = str;
            return;
        }
        if (i11 == 17026) {
            if ("webm".equals(str) || "matroska".equals(str)) {
                return;
            }
            throw zn0.a("DocType " + str + " not supported", (Exception) null);
        }
        if (i11 == 21358) {
            a(i11);
            this.f70556u.f70563a = str;
        } else {
            if (i11 != 2274716) {
                return;
            }
            a(i11);
            this.f70556u.W = str;
        }
    }

    private void a(b bVar, long j11, int i11, int i12, int i13) {
        byte[] a11;
        int i14;
        int e11;
        i61 i61Var = bVar.T;
        if (i61Var != null) {
            i61Var.a(bVar.X, j11, i11, i12, i13, bVar.f70572j);
        } else {
            if ("S_TEXT/UTF8".equals(bVar.f70564b) || "S_TEXT/ASS".equals(bVar.f70564b) || "S_TEXT/WEBVTT".equals(bVar.f70564b)) {
                if (this.K > 1) {
                    y70.d("MatroskaExtractor", "Skipping subtitle sample in laced block.");
                } else {
                    long j12 = this.I;
                    if (j12 == C.TIME_UNSET) {
                        y70.d("MatroskaExtractor", "Skipping subtitle sample with no duration.");
                    } else {
                        String str = bVar.f70564b;
                        byte[] c11 = this.f70546k.c();
                        str.getClass();
                        char c12 = 65535;
                        switch (str.hashCode()) {
                            case 738597099:
                                if (str.equals("S_TEXT/ASS")) {
                                    c12 = 0;
                                    break;
                                }
                                break;
                            case 1045209816:
                                if (str.equals("S_TEXT/WEBVTT")) {
                                    c12 = 1;
                                    break;
                                }
                                break;
                            case 1422270023:
                                if (str.equals("S_TEXT/UTF8")) {
                                    c12 = 2;
                                    break;
                                }
                                break;
                        }
                        switch (c12) {
                            case 0:
                                a11 = a("%01d:%02d:%02d:%02d", j12, 10000L);
                                i14 = 21;
                                break;
                            case 1:
                                a11 = a("%02d:%02d:%02d.%03d", j12, 1000L);
                                i14 = 25;
                                break;
                            case 2:
                                a11 = a("%02d:%02d:%02d,%03d", j12, 1000L);
                                i14 = 19;
                                break;
                            default:
                                throw new IllegalArgumentException();
                        }
                        System.arraycopy(a11, 0, c11, i14, a11.length);
                        int d11 = this.f70546k.d();
                        while (true) {
                            if (d11 < this.f70546k.e()) {
                                if (this.f70546k.c()[d11] == 0) {
                                    this.f70546k.d(d11);
                                } else {
                                    d11++;
                                }
                            }
                        }
                        h51 h51Var = bVar.X;
                        vn0 vn0Var = this.f70546k;
                        h51Var.a(vn0Var.e(), vn0Var);
                        e11 = this.f70546k.e() + i12;
                        if ((i11 & 268435456) != 0) {
                            if (this.K > 1) {
                                this.f70549n.c(0);
                            } else {
                                int e12 = this.f70549n.e();
                                bVar.X.b(e12, this.f70549n);
                                e11 += e12;
                            }
                        }
                        bVar.X.a(j11, i11, e11, i13, bVar.f70572j);
                    }
                }
            }
            e11 = i12;
            if ((i11 & 268435456) != 0) {
            }
            bVar.X.a(j11, i11, e11, i13, bVar.f70572j);
        }
        this.F = true;
    }

    private void a(um umVar, int i11) throws IOException {
        if (this.f70542g.e() >= i11) {
            return;
        }
        if (this.f70542g.b() < i11) {
            vn0 vn0Var = this.f70542g;
            vn0Var.a(Math.max(vn0Var.b() * 2, i11));
        }
        umVar.a(this.f70542g.c(), this.f70542g.e(), i11 - this.f70542g.e(), false);
        this.f70542g.d(i11);
    }

    private int a(um umVar, b bVar, int i11, boolean z11) throws IOException {
        int b11;
        int b12;
        int i12;
        if ("S_TEXT/UTF8".equals(bVar.f70564b)) {
            a(umVar, f70528c0, i11);
            int i13 = this.T;
            e();
            return i13;
        }
        if ("S_TEXT/ASS".equals(bVar.f70564b)) {
            a(umVar, f70530e0, i11);
            int i14 = this.T;
            e();
            return i14;
        }
        if ("S_TEXT/WEBVTT".equals(bVar.f70564b)) {
            a(umVar, f70531f0, i11);
            int i15 = this.T;
            e();
            return i15;
        }
        h51 h51Var = bVar.X;
        if (!this.V) {
            if (bVar.f70570h) {
                this.O &= -1073741825;
                if (!this.W) {
                    umVar.a(this.f70542g.c(), 0, 1, false);
                    this.S++;
                    if ((this.f70542g.c()[0] & com.startapp.b4.f52487d) != 128) {
                        this.Z = this.f70542g.c()[0];
                        this.W = true;
                    } else {
                        throw zn0.a("Extension bit is set in signal byte", (Exception) null);
                    }
                }
                byte b13 = this.Z;
                if ((b13 & 1) == 1) {
                    boolean z12 = (b13 & 2) == 2;
                    this.O |= 1073741824;
                    if (!this.f70535a0) {
                        umVar.a(this.f70547l.c(), 0, 8, false);
                        this.S += 8;
                        this.f70535a0 = true;
                        this.f70542g.c()[0] = (byte) ((z12 ? 128 : 0) | 8);
                        this.f70542g.e(0);
                        h51Var.b(1, this.f70542g);
                        this.T++;
                        this.f70547l.e(0);
                        h51Var.b(8, this.f70547l);
                        this.T += 8;
                    }
                    if (z12) {
                        if (!this.X) {
                            umVar.a(this.f70542g.c(), 0, 1, false);
                            this.S++;
                            this.f70542g.e(0);
                            this.Y = this.f70542g.t();
                            this.X = true;
                        }
                        int i16 = this.Y * 4;
                        this.f70542g.c(i16);
                        umVar.a(this.f70542g.c(), 0, i16, false);
                        this.S += i16;
                        short s11 = (short) ((this.Y / 2) + 1);
                        int i17 = (s11 * 6) + 2;
                        ByteBuffer byteBuffer = this.f70550o;
                        if (byteBuffer == null || byteBuffer.capacity() < i17) {
                            this.f70550o = ByteBuffer.allocate(i17);
                        }
                        this.f70550o.position(0);
                        this.f70550o.putShort(s11);
                        int i18 = 0;
                        int i19 = 0;
                        while (true) {
                            i12 = this.Y;
                            if (i18 >= i12) {
                                break;
                            }
                            int x11 = this.f70542g.x();
                            if (i18 % 2 == 0) {
                                this.f70550o.putShort((short) (x11 - i19));
                            } else {
                                this.f70550o.putInt(x11 - i19);
                            }
                            i18++;
                            i19 = x11;
                        }
                        int i21 = (i11 - this.S) - i19;
                        if (i12 % 2 == 1) {
                            this.f70550o.putInt(i21);
                        } else {
                            this.f70550o.putShort((short) i21);
                            this.f70550o.putInt(0);
                        }
                        this.f70548m.a(i17, this.f70550o.array());
                        h51Var.b(i17, this.f70548m);
                        this.T += i17;
                    }
                }
            } else {
                byte[] bArr = bVar.f70571i;
                if (bArr != null) {
                    this.f70545j.a(bArr.length, bArr);
                }
            }
            if (bVar.a(z11)) {
                this.O |= 268435456;
                this.f70549n.c(0);
                int e11 = (this.f70545j.e() + i11) - this.S;
                this.f70542g.c(4);
                this.f70542g.c()[0] = (byte) ((e11 >> 24) & 255);
                this.f70542g.c()[1] = (byte) ((e11 >> 16) & 255);
                this.f70542g.c()[2] = (byte) ((e11 >> 8) & 255);
                this.f70542g.c()[3] = (byte) (e11 & 255);
                h51Var.b(4, this.f70542g);
                this.T += 4;
            }
            this.V = true;
        }
        int e12 = this.f70545j.e() + i11;
        if (!"V_MPEG4/ISO/AVC".equals(bVar.f70564b) && !"V_MPEGH/ISO/HEVC".equals(bVar.f70564b)) {
            if (bVar.T != null) {
                w9.b(this.f70545j.e() == 0);
                bVar.T.a(umVar);
            }
            while (true) {
                int i22 = this.S;
                if (i22 >= e12) {
                    break;
                }
                int i23 = e12 - i22;
                int a11 = this.f70545j.a();
                if (a11 > 0) {
                    b12 = Math.min(i23, a11);
                    h51Var.a(b12, this.f70545j);
                } else {
                    b12 = h51Var.b(umVar, i23, false);
                }
                this.S += b12;
                this.T += b12;
            }
        } else {
            byte[] c11 = this.f70541f.c();
            c11[0] = 0;
            c11[1] = 0;
            c11[2] = 0;
            int i24 = bVar.Y;
            int i25 = 4 - i24;
            while (this.S < e12) {
                int i26 = this.U;
                if (i26 == 0) {
                    int min = Math.min(i24, this.f70545j.a());
                    umVar.a(c11, i25 + min, i24 - min, false);
                    if (min > 0) {
                        this.f70545j.a(c11, i25, min);
                    }
                    this.S += i24;
                    this.f70541f.e(0);
                    this.U = this.f70541f.x();
                    this.f70540e.e(0);
                    h51Var.a(4, this.f70540e);
                    this.T += 4;
                } else {
                    int a12 = this.f70545j.a();
                    if (a12 > 0) {
                        b11 = Math.min(i26, a12);
                        h51Var.a(b11, this.f70545j);
                    } else {
                        b11 = h51Var.b(umVar, i26, false);
                    }
                    this.S += b11;
                    this.T += b11;
                    this.U -= b11;
                }
            }
        }
        if ("A_VORBIS".equals(bVar.f70564b)) {
            this.f70543h.e(0);
            h51Var.a(4, this.f70543h);
            this.T += 4;
        }
        int i27 = this.T;
        e();
        return i27;
    }

    private void a(um umVar, byte[] bArr, int i11) throws IOException {
        int length = bArr.length + i11;
        if (this.f70546k.b() < length) {
            vn0 vn0Var = this.f70546k;
            byte[] copyOf = Arrays.copyOf(bArr, length + i11);
            vn0Var.getClass();
            vn0Var.a(copyOf.length, copyOf);
        } else {
            System.arraycopy(bArr, 0, this.f70546k.c(), 0, bArr.length);
        }
        umVar.a(this.f70546k.c(), bArr.length, i11, false);
        this.f70546k.e(0);
        this.f70546k.d(length);
    }

    private static byte[] a(String str, long j11, long j12) {
        w9.a(j11 != C.TIME_UNSET);
        int i11 = (int) (j11 / 3600000000L);
        long j13 = j11 - ((i11 * 3600) * 1000000);
        int i12 = (int) (j13 / 60000000);
        long j14 = j13 - ((i12 * 60) * 1000000);
        int i13 = (int) (j14 / 1000000);
        return b81.b(String.format(Locale.US, str, Integer.valueOf(i11), Integer.valueOf(i12), Integer.valueOf(i13), Integer.valueOf((int) ((j14 - (i13 * 1000000)) / j12))));
    }

    private long a(long j11) throws zn0 {
        long j12 = this.f70553r;
        if (j12 != C.TIME_UNSET) {
            return b81.a(j11, j12, 1000L);
        }
        throw zn0.a("Can't scale timecode prior to timecodeScale being set.", (Exception) null);
    }

    @CallSuper
    public final void a(int i11, long j11, long j12) throws zn0 {
        w9.b(this.f70537b0);
        if (i11 == 160) {
            this.Q = false;
            this.R = 0L;
            return;
        }
        if (i11 == 174) {
            this.f70556u = new b();
            return;
        }
        if (i11 == 187) {
            this.E = false;
            return;
        }
        if (i11 == 19899) {
            this.f70558w = -1;
            this.f70559x = -1L;
            return;
        }
        if (i11 == 20533) {
            a(i11);
            this.f70556u.f70570h = true;
            return;
        }
        if (i11 == 21968) {
            a(i11);
            this.f70556u.f70586x = true;
            return;
        }
        if (i11 == 408125543) {
            long j13 = this.f70552q;
            if (j13 != -1 && j13 != j11) {
                throw zn0.a("Multiple Segment elements not supported", (Exception) null);
            }
            this.f70552q = j11;
            this.f70551p = j12;
            return;
        }
        if (i11 != 475249515) {
            if (i11 == 524531317 && !this.f70557v) {
                if (this.f70539d && this.f70561z != -1) {
                    this.f70560y = true;
                    return;
                } else {
                    this.f70537b0.a(new py0.b(this.f70555t, 0L));
                    this.f70557v = true;
                    return;
                }
            }
            return;
        }
        this.C = new z70(0);
        this.D = new z70(0);
    }
}