package defpackage;

import android.net.Uri;
import android.os.Handler;
import androidx.media3.common.ParserException;
import j$.util.DesugarCollections;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/* JADX INFO: renamed from: ᵵˈʽ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4708 implements InterfaceC0472, InterfaceC4550, InterfaceC4051, InterfaceC1158, InterfaceC0766 {

    /* JADX INFO: renamed from: ˆʤᵳ, reason: contains not printable characters */
    public static final C5286 f17901;

    /* JADX INFO: renamed from: ᵘᵝ, reason: contains not printable characters */
    public static final Map f17902;

    /* JADX INFO: renamed from: ʽᵡᵢᵾ, reason: contains not printable characters */
    public C0890[] f17903;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final long f17904;

    /* JADX INFO: renamed from: ʿᵿʽᵞ, reason: contains not printable characters */
    public boolean f17905;

    /* JADX INFO: renamed from: ˀᵗ, reason: contains not printable characters */
    public ᵥᵵᵶᵩ f17906;

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final RunnableC2947 f17907;

    /* JADX INFO: renamed from: ˁʢᵛ, reason: contains not printable characters */
    public boolean f17908;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final C2123 f17909;

    /* JADX INFO: renamed from: ˁᵺˈ, reason: contains not printable characters */
    public boolean f17910;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final C4582 f17911;

    /* JADX INFO: renamed from: ˈⁱᵡ, reason: contains not printable characters */
    public C3230[] f17912;

    /* JADX INFO: renamed from: ˉˆᵗ, reason: contains not printable characters */
    public boolean f17913;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final ᵯᵨᵲ f17914;

    /* JADX INFO: renamed from: ˊˌˊ, reason: contains not printable characters */
    public boolean f17915;

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public final Handler f17916;

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final RunnableC2947 f17917;

    /* JADX INFO: renamed from: ˋʿᐧ, reason: contains not printable characters */
    public boolean f17918;

    /* JADX INFO: renamed from: ˋᵯᵩ, reason: contains not printable characters */
    public int f17919;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final Uri f17920;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final ᵣˊˈᵪ f17921;

    /* JADX INFO: renamed from: ˏʜᵪ, reason: contains not printable characters */
    public boolean f17922;

    /* JADX INFO: renamed from: ˏᵩʨ, reason: contains not printable characters */
    public InterfaceC5517 f17923;

    /* JADX INFO: renamed from: ːᵝٴᵶ, reason: contains not printable characters */
    public long f17924;

    /* JADX INFO: renamed from: ˑʢ, reason: contains not printable characters */
    public C0831[] f17925;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final C5286 f17926;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final InterfaceC4636 f17927;

    /* JADX INFO: renamed from: ᵗᵭ, reason: contains not printable characters */
    public long f17928;

    /* JADX INFO: renamed from: ᵛˀˊ, reason: contains not printable characters */
    public long f17929;

    /* JADX INFO: renamed from: ᵛˑﹳ, reason: contains not printable characters */
    public InterfaceC2682 f17930;

    /* JADX INFO: renamed from: ᵜᵤ, reason: contains not printable characters */
    public boolean f17931;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final InterfaceC1070 f17932;

    /* JADX INFO: renamed from: ᵞᵛᵘ, reason: contains not printable characters */
    public boolean f17933;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final ᵣˊˈᵪ f17934;

    /* JADX INFO: renamed from: ᵡᵶ, reason: contains not printable characters */
    public int f17935;

    /* JADX INFO: renamed from: ᵡᵶᵬʤ, reason: contains not printable characters */
    public final long f17936 = Long.MIN_VALUE;

    /* JADX INFO: renamed from: ᵨˈʼﹶ, reason: contains not printable characters */
    public boolean f17937;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final C1013 f17938;

    /* JADX INFO: renamed from: ᵫˈᵹ, reason: contains not printable characters */
    public boolean f17939;

    /* JADX INFO: renamed from: ᵬᵦˋ, reason: contains not printable characters */
    public boolean f17940;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final C1404 f17941;

    /* JADX INFO: renamed from: ᵵᵬᵽ, reason: contains not printable characters */
    public C0550 f17942;

    /* JADX INFO: renamed from: ᵵᵸᵕᵸ, reason: contains not printable characters */
    public int f17943;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final C3317 f17944;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final long f17945;

    static {
        HashMap map = new HashMap();
        map.put("Icy-MetaData", "1");
        f17902 = DesugarCollections.unmodifiableMap(map);
        C4753 c4753 = new C4753();
        c4753.f18121 = "icy";
        c4753.f18101 = AbstractC4208.m9132("application/x-icy");
        f17901 = new C5286(c4753);
    }

    public C4708(Uri uri, InterfaceC1070 interfaceC1070, ᵯᵨᵲ r3, InterfaceC4636 interfaceC4636, C3317 c3317, C1013 c1013, C1404 c1404, C4582 c4582, ᵣˊˈᵪ r9, int i, C5286 c5286, long j, ExecutorC1728 executorC1728) {
        this.f17920 = uri;
        this.f17932 = interfaceC1070;
        this.f17927 = interfaceC4636;
        this.f17944 = c3317;
        this.f17938 = c1013;
        this.f17941 = c1404;
        this.f17911 = c4582;
        this.f17921 = r9;
        this.f17945 = i;
        this.f17926 = c5286;
        this.f17934 = executorC1728 != null ? new ᵣˊˈᵪ(executorC1728) : new ᵣˊˈᵪ(2, "ProgressiveMediaPeriod");
        this.f17914 = r3;
        this.f17904 = j;
        this.f17909 = new C2123();
        this.f17907 = new RunnableC2947(this, 1);
        this.f17917 = new RunnableC2947(this, 2);
        this.f17916 = AbstractC0956.m3260(null);
        this.f17912 = new C3230[0];
        this.f17903 = new C0890[0];
        this.f17925 = new C0831[0];
        this.f17928 = -9223372036854775807L;
        this.f17935 = 1;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m9839() {
        ᵻᵪ.ˌᴵ(this.f17933);
        this.f17906.getClass();
        this.f17923.getClass();
    }

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final boolean m9840() {
        return this.f17913 || m9841();
    }

    @Override // defpackage.InterfaceC4550
    /* JADX INFO: renamed from: ˈᵲᵢ */
    public final void mo2739(InterfaceC5517 interfaceC5517) {
        this.f17916.post(new RunnableC2093(this, 12, interfaceC5517));
    }

    @Override // defpackage.InterfaceC1137
    /* JADX INFO: renamed from: ˉᵲ */
    public final boolean mo3622(C2348 c2348) {
        if (this.f17940) {
            return false;
        }
        ᵣˊˈᵪ r2 = this.f17934;
        if (r2.ˑˊᵲ() || this.f17939) {
            return false;
        }
        if ((this.f17933 || this.f17926 != null) && this.f17919 == 0) {
            return false;
        }
        boolean zM5625 = this.f17909.m5625();
        if (r2.ᵠˏˏ()) {
            return zM5625;
        }
        m9843();
        return true;
    }

    @Override // defpackage.InterfaceC4550
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final void mo2740() {
        this.f17937 = true;
        this.f17916.post(this.f17907);
    }

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public final boolean m9841() {
        return this.f17928 != -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC4051
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final void mo5223(InterfaceC1933 interfaceC1933, long j, long j2, boolean z) {
        C3771 c3771 = (C3771) interfaceC1933;
        C0165 c0165 = c3771.f14354;
        C3622 c3622 = new C3622(c3771.f14352, c0165.f1575, c0165.f1577, j, j2, c0165.f1576);
        this.f17938.getClass();
        this.f17941.m4045(c3622, 1, -1, null, 0, null, c3771.f14359, this.f17929);
        if (z) {
            return;
        }
        for (C0890 c0890 : this.f17903) {
            c0890.m3096(false);
        }
        if (this.f17919 > 0) {
            InterfaceC2682 interfaceC2682 = this.f17930;
            interfaceC2682.getClass();
            interfaceC2682.mo3794(this);
        }
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ˋˈ */
    public final long mo1934() {
        if (this.f17910) {
            this.f17910 = false;
            return this.f17924;
        }
        if (!this.f17913) {
            return -9223372036854775807L;
        }
        if (!this.f17940 && m9848() <= this.f17943) {
            return -9223372036854775807L;
        }
        this.f17913 = false;
        return this.f17924;
    }

    @Override // defpackage.InterfaceC1137
    /* JADX INFO: renamed from: ˌᴵ */
    public final void mo3623(long j) {
        if (this.f17919 <= 0 || m9841()) {
            return;
        }
        int i = 0;
        if (this.f17936 != Long.MIN_VALUE) {
            m9839();
            int i2 = 1;
            while (true) {
                C0890[] c0890Arr = this.f17903;
                if (i >= c0890Arr.length) {
                    break;
                }
                ᵥᵵᵶᵩ r2 = this.f17906;
                if (((boolean[]) r2.ᵨᵼⁱ)[i] && (((boolean[]) r2.ᵔᵖᵹᵫ)[i] || !this.f17915)) {
                    i2 &= c0890Arr[i].m3116() ? 1 : 0;
                }
                i++;
            }
            i = i2;
        }
        if (i != 0) {
            this.f17940 = true;
        }
    }

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final InterfaceC5226 m9842(C3230 c3230) {
        int length = this.f17903.length;
        for (int i = 0; i < length; i++) {
            if (c3230.equals(this.f17912[i])) {
                return this.f17903[i];
            }
        }
        if (this.f17937) {
            ˋˀᵧ.ʿٴˇ("Extractor added new track (id=" + c3230.f12295 + ") after finishing tracks.");
            return new C0406();
        }
        InterfaceC4636 interfaceC4636 = this.f17927;
        interfaceC4636.getClass();
        C0890 c0890 = new C0890(this.f17921, interfaceC4636, this.f17944);
        C0831 c0831 = new C0831(c0890);
        c0890.f3948 = this;
        int i2 = length + 1;
        C3230[] c3230Arr = (C3230[]) Arrays.copyOf(this.f17912, i2);
        c3230Arr[length] = c3230;
        this.f17912 = c3230Arr;
        C0890[] c0890Arr = (C0890[]) Arrays.copyOf(this.f17903, i2);
        c0890Arr[length] = c0890;
        this.f17903 = c0890Arr;
        C0831[] c0831Arr = (C0831[]) Arrays.copyOf(this.f17925, i2);
        c0831Arr[length] = c0831;
        this.f17925 = c0831Arr;
        return c0831;
    }

    @Override // defpackage.InterfaceC1137
    /* JADX INFO: renamed from: ˏːˆ */
    public final long mo3624() {
        long jM9845;
        boolean z;
        m9839();
        if (this.f17940 || this.f17919 == 0) {
            return Long.MIN_VALUE;
        }
        if (m9841()) {
            return this.f17928;
        }
        if (this.f17915) {
            int length = this.f17903.length;
            jM9845 = Long.MAX_VALUE;
            for (int i = 0; i < length; i++) {
                ᵥᵵᵶᵩ r9 = this.f17906;
                if (((boolean[]) r9.ᵔᵖᵹᵫ)[i] && ((boolean[]) r9.ᵨᵼⁱ)[i]) {
                    C0890 c0890 = this.f17903[i];
                    synchronized (c0890) {
                        z = c0890.f3935;
                    }
                    if (!z) {
                        jM9845 = Math.min(jM9845, this.f17903[i].m3095());
                    }
                }
            }
        } else {
            jM9845 = Long.MAX_VALUE;
        }
        if (jM9845 == Long.MAX_VALUE) {
            jM9845 = m9845(false);
        }
        return jM9845 == Long.MIN_VALUE ? this.f17924 : jM9845;
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final long mo1935(long j, C3318 c3318) {
        m9839();
        if (!this.f17923.mo1056()) {
            return 0L;
        }
        C2686 c2686Mo1057 = this.f17923.mo1057(j);
        return c3318.m7597(j, c2686Mo1057.f10354.f10813, c2686Mo1057.f10353.f10813);
    }

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final void m9843() {
        C3771 c3771 = new C3771(this, this.f17920, this.f17932, this.f17914, this, this.f17909);
        if (this.f17933) {
            ᵻᵪ.ˌᴵ(m9841());
            long j = this.f17936;
            if (j == Long.MIN_VALUE) {
                j = this.f17929;
            }
            if (j != -9223372036854775807L && this.f17928 > j) {
                this.f17940 = true;
                this.f17928 = -9223372036854775807L;
                return;
            }
            InterfaceC5517 interfaceC5517 = this.f17923;
            interfaceC5517.getClass();
            long j2 = interfaceC5517.mo1057(this.f17928).f10354.f10812;
            long j3 = this.f17928;
            c3771.f14358.f10317 = j2;
            c3771.f14359 = j3;
            c3771.f14351 = true;
            c3771.f14355 = false;
            for (C0890 c0890 : this.f17903) {
                c0890.f3926 = this.f17928;
            }
            this.f17928 = -9223372036854775807L;
        }
        this.f17943 = m9848();
        this.f17934.ᵵᵬᵽ(c3771, this, this.f17938.m3345(this.f17935));
    }

    @Override // defpackage.InterfaceC4550
    /* JADX INFO: renamed from: ᵔᵖᵹᵫ */
    public final InterfaceC5226 mo2743(int i, int i2) {
        return m9842(new C3230(i, false));
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final void m9844() {
        C1956 c1956M5239;
        long j = this.f17904;
        if (this.f17922 || this.f17933 || !this.f17937 || this.f17923 == null) {
            return;
        }
        char c = 0;
        for (C0890 c0890 : this.f17903) {
            if (c0890.m3113() == null) {
                return;
            }
        }
        C2123 c2123 = this.f17909;
        synchronized (c2123) {
            c2123.f8438 = false;
        }
        int length = this.f17903.length;
        int i = -1;
        int i2 = 0;
        int i3 = 0;
        while (true) {
            char c2 = 1;
            if (i2 >= length) {
                break;
            }
            C5286 c5286M3113 = this.f17903[i2].m3113();
            c5286M3113.getClass();
            int iM9141 = AbstractC4208.m9141(c5286M3113.f19987);
            char c3 = iM9141 != 1 ? iM9141 != 2 ? iM9141 != 3 ? iM9141 != 4 ? (char) 0 : (char) 2 : (char) 1 : (char) 4 : (char) 3;
            if (i == 1) {
                c2 = 3;
            } else if (i == 2) {
                c2 = 4;
            } else if (i != 3) {
                c2 = i != 4 ? (char) 0 : (char) 2;
            }
            if (c3 > c2) {
                i3 = i2;
                i = iM9141;
            }
            i2++;
        }
        C1882[] c1882Arr = new C1882[length];
        boolean[] zArr = new boolean[length];
        int i4 = 0;
        while (i4 < length) {
            C5286 c5286M31132 = this.f17903[i4].m3113();
            c5286M31132.getClass();
            String str = c5286M31132.f19987;
            boolean zM9139 = AbstractC4208.m9139(str);
            boolean z = (zM9139 || AbstractC4208.m9134(str)) ? true : c;
            zArr[i4] = z;
            char c4 = c;
            this.f17915 = (this.f17915 ? 1 : 0) | (z ? 1 : 0);
            this.f17908 = (j != -9223372036854775807L && length == 1 && AbstractC4208.m9131(str)) ? 1 : c4;
            C0550 c0550 = this.f17942;
            if (c0550 != null) {
                int i5 = c0550.f2797;
                if (zM9139 || this.f17912[i4].f12294) {
                    C1956 c1956 = c5286M31132.f19988;
                    if (c1956 == null) {
                        InterfaceC2223[] interfaceC2223Arr = new InterfaceC2223[1];
                        interfaceC2223Arr[c4] = c0550;
                        c1956M5239 = new C1956(interfaceC2223Arr);
                    } else {
                        InterfaceC2223[] interfaceC2223Arr2 = new InterfaceC2223[1];
                        interfaceC2223Arr2[c4] = c0550;
                        c1956M5239 = c1956.m5239(interfaceC2223Arr2);
                    }
                    C4753 c4753M10878 = c5286M31132.m10878();
                    c4753M10878.f18125 = c1956M5239;
                    c5286M31132 = new C5286(c4753M10878);
                }
                if (zM9139 && c5286M31132.f19970 == -1 && c5286M31132.f19999 == -1 && i5 != -1) {
                    C4753 c4753M108782 = c5286M31132.m10878();
                    c4753M108782.f18099 = i5;
                    c5286M31132 = new C5286(c4753M108782);
                }
            }
            int iMo5537 = this.f17927.mo5537(c5286M31132);
            C4753 c4753M108783 = c5286M31132.m10878();
            c4753M108783.f18106 = iMo5537;
            C5286 c5286 = new C5286(c4753M108783);
            if (i4 != i3) {
                C4753 c4753M108784 = c5286.m10878();
                c4753M108784.f18117 = Integer.toString(i3);
                c5286 = new C5286(c4753M108784);
            }
            String string = Integer.toString(i4);
            C5286[] c5286Arr = new C5286[1];
            c5286Arr[c4] = c5286;
            c1882Arr[i4] = new C1882(string, c5286Arr);
            this.f17910 = c5286.f19969 | this.f17910;
            this.f17903[i4].m3098(this.f17936);
            i4++;
            c = c4;
        }
        this.f17906 = new ᵥᵵᵶᵩ(new C5502(c1882Arr), zArr);
        if (this.f17908 && this.f17929 == -9223372036854775807L) {
            this.f17929 = j;
            this.f17923 = new C0205(this, this.f17923);
        }
        this.f17911.m9659(this.f17929, this.f17923, this.f17905);
        this.f17933 = true;
        InterfaceC2682 interfaceC2682 = this.f17930;
        interfaceC2682.getClass();
        interfaceC2682.mo3793(this);
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0017  */
    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long m9845(boolean z) {
        long jMax = Long.MIN_VALUE;
        for (int i = 0; i < this.f17903.length; i++) {
            if (!z) {
                ᵥᵵᵶᵩ r3 = this.f17906;
                r3.getClass();
                if (((boolean[]) r3.ᵨᵼⁱ)[i]) {
                    jMax = Math.max(jMax, this.f17903[i].m3095());
                }
            }
        }
        return jMax;
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public final C5502 mo1936() {
        m9839();
        return (C5502) this.f17906.ᵜᵪʾ;
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵨᵣ */
    public final long mo1937(InterfaceC2380[] interfaceC2380Arr, boolean[] zArr, InterfaceC4833[] interfaceC4833Arr, boolean[] zArr2, long j) {
        InterfaceC2380 interfaceC2380;
        m9839();
        ᵥᵵᵶᵩ r0 = this.f17906;
        C5502 c5502 = (C5502) r0.ᵜᵪʾ;
        boolean[] zArr3 = (boolean[]) r0.ᵨᵼⁱ;
        int i = this.f17919;
        int i2 = 0;
        for (int i3 = 0; i3 < interfaceC2380Arr.length; i3++) {
            InterfaceC4833 interfaceC4833 = interfaceC4833Arr[i3];
            if (interfaceC4833 != null && (interfaceC2380Arr[i3] == null || !zArr[i3])) {
                int i4 = ((C2996) interfaceC4833).f11539;
                ᵻᵪ.ˌᴵ(zArr3[i4]);
                this.f17919--;
                zArr3[i4] = false;
                interfaceC4833Arr[i3] = null;
            }
        }
        boolean z = !this.f17918 ? j == 0 || this.f17908 : i != 0;
        for (int i5 = 0; i5 < interfaceC2380Arr.length; i5++) {
            if (interfaceC4833Arr[i5] == null && (interfaceC2380 = interfaceC2380Arr[i5]) != null) {
                ᵻᵪ.ˌᴵ(interfaceC2380.length() == 1);
                ᵻᵪ.ˌᴵ(interfaceC2380.mo3741(0) == 0);
                int iM11141 = c5502.m11141(interfaceC2380.mo3729());
                ᵻᵪ.ˌᴵ(!zArr3[iM11141]);
                this.f17919++;
                zArr3[iM11141] = true;
                this.f17910 = interfaceC2380.mo3738().f19969 | this.f17910;
                interfaceC4833Arr[i5] = new C2996(this, iM11141);
                zArr2[i5] = true;
                if (!z) {
                    C0890 c0890 = this.f17903[iM11141];
                    z = (c0890.m3103() == 0 || c0890.m3101(true, j)) ? false : true;
                }
            }
        }
        if (this.f17919 == 0) {
            this.f17939 = false;
            this.f17913 = false;
            this.f17910 = false;
            ᵣˊˈᵪ r9 = this.f17934;
            if (r9.ᵠˏˏ()) {
                C0890[] c0890Arr = this.f17903;
                int length = c0890Arr.length;
                while (i2 < length) {
                    c0890Arr[i2].m3115();
                    i2++;
                }
                r9.ᵟᵹᵙ();
            } else {
                this.f17940 = false;
                for (C0890 c08902 : this.f17903) {
                    c08902.m3096(false);
                }
            }
        } else if (z) {
            j = mo1941(j);
            while (i2 < interfaceC4833Arr.length) {
                if (interfaceC4833Arr[i2] != null) {
                    zArr2[i2] = true;
                }
                i2++;
            }
        }
        this.f17918 = true;
        return j;
    }

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final void m9846(int i) {
        m9839();
        ᵥᵵᵶᵩ r0 = this.f17906;
        boolean[] zArr = (boolean[]) r0.ᵯᵷʽ;
        if (zArr[i]) {
            return;
        }
        C5286 c5286 = ((C5502) r0.ᵜᵪʾ).m11142(i).f7463[0];
        this.f17941.m4046(AbstractC4208.m9141(c5286.f19987), c5286, 0, null, this.f17924);
        zArr[i] = true;
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public final void mo1938(InterfaceC2682 interfaceC2682, long j) {
        this.f17930 = interfaceC2682;
        C5286 c5286 = this.f17926;
        if (c5286 == null) {
            this.f17909.m5625();
            m9843();
        } else {
            mo2743(0, 3).mo1742(c5286);
            m9849(new C2665(-9223372036854775807L, new long[]{0}, new long[]{0}));
            mo2740();
            this.f17928 = j;
        }
    }

    @Override // defpackage.InterfaceC1137
    /* JADX INFO: renamed from: ᵮᵣᵗˈ */
    public final boolean mo3625() {
        boolean z;
        if (this.f17940 || !this.f17934.ᵠˏˏ()) {
            return false;
        }
        C2123 c2123 = this.f17909;
        synchronized (c2123) {
            z = c2123.f8438;
        }
        return z;
    }

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final void m9847(int i) {
        m9839();
        if (this.f17939) {
            if ((!this.f17915 || ((boolean[]) this.f17906.ᵔᵖᵹᵫ)[i]) && !this.f17903[i].m3119(false)) {
                this.f17928 = 0L;
                this.f17939 = false;
                this.f17913 = true;
                this.f17924 = 0L;
                this.f17943 = 0;
                for (C0890 c0890 : this.f17903) {
                    c0890.m3096(false);
                }
                InterfaceC2682 interfaceC2682 = this.f17930;
                interfaceC2682.getClass();
                interfaceC2682.mo3794(this);
            }
        }
    }

    @Override // defpackage.InterfaceC4051
    /* JADX INFO: renamed from: ᵱʡˏ */
    public final void mo5226(InterfaceC1933 interfaceC1933, long j, long j2) {
        C3771 c3771 = (C3771) interfaceC1933;
        if (this.f17929 == -9223372036854775807L && this.f17923 != null) {
            long jM9845 = m9845(true);
            long j3 = jM9845 == Long.MIN_VALUE ? 0L : jM9845 + 10000;
            this.f17929 = j3;
            this.f17911.m9659(j3, this.f17923, this.f17905);
        }
        C0165 c0165 = c3771.f14354;
        C3622 c3622 = new C3622(c3771.f14352, c0165.f1575, c0165.f1577, j, j2, c0165.f1576);
        this.f17938.getClass();
        this.f17941.m4028(c3622, 1, -1, null, 0, null, c3771.f14359, this.f17929);
        this.f17940 = true;
        InterfaceC2682 interfaceC2682 = this.f17930;
        interfaceC2682.getClass();
        interfaceC2682.mo3794(this);
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵱᵽʡᵚ */
    public final void mo1939(long j) throws Throwable {
        if (this.f17908) {
            return;
        }
        m9839();
        if (m9841()) {
            return;
        }
        boolean[] zArr = (boolean[]) this.f17906.ᵨᵼⁱ;
        int length = this.f17903.length;
        for (int i = 0; i < length; i++) {
            this.f17903[i].m3120(zArr[i], j);
        }
    }

    @Override // defpackage.InterfaceC0766
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2755() {
        this.f17916.post(this.f17907);
    }

    @Override // defpackage.InterfaceC4051
    /* JADX INFO: renamed from: ᵵᵬᵽ */
    public final C0655 mo5228(InterfaceC1933 interfaceC1933, long j, long j2, IOException iOException, int i) {
        C0655 c0655;
        InterfaceC5517 interfaceC5517;
        C3771 c3771 = (C3771) interfaceC1933;
        C0165 c0165 = c3771.f14354;
        C3622 c3622 = new C3622(c3771.f14352, c0165.f1575, c0165.f1577, j, j2, c0165.f1576);
        AbstractC0956.m3264(c3771.f14359);
        AbstractC0956.m3264(this.f17929);
        long jM3346 = this.f17938.m3346(new C1785(i, 5, iOException));
        if (jM3346 == -9223372036854775807L) {
            c0655 = ᵣˊˈᵪ.ᵸˆˁ;
        } else {
            int iM9848 = m9848();
            int i2 = iM9848 > this.f17943 ? 1 : 0;
            if (this.f17931 || !((interfaceC5517 = this.f17923) == null || interfaceC5517.mo1058() == -9223372036854775807L)) {
                this.f17943 = iM9848;
            } else if (!this.f17933 || m9840()) {
                this.f17913 = this.f17933;
                this.f17924 = 0L;
                this.f17943 = 0;
                for (C0890 c0890 : this.f17903) {
                    c0890.m3096(false);
                }
                c3771.f14358.f10317 = 0L;
                c3771.f14359 = 0L;
                c3771.f14351 = true;
                c3771.f14355 = false;
            } else {
                this.f17939 = true;
                c0655 = ᵣˊˈᵪ.ˌᵨʠᵫ;
            }
            c0655 = new C0655(i2, jM3346, false);
        }
        this.f17941.m4035(c3622, 1, -1, null, 0, null, c3771.f14359, this.f17929, iOException, !c0655.m2396());
        return c0655;
    }

    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵵᵽ */
    public final void mo1940() throws IOException {
        int iM3345 = this.f17938.m3345(this.f17935);
        ᵣˊˈᵪ r1 = this.f17934;
        IOException iOException = (IOException) r1.ᵨᵼⁱ;
        if (iOException != null) {
            throw iOException;
        }
        HandlerC3257 handlerC3257 = (HandlerC3257) r1.ᵔᵖᵹᵫ;
        if (handlerC3257 != null) {
            if (iM3345 == Integer.MIN_VALUE) {
                iM3345 = handlerC3257.f12392;
            }
            IOException iOException2 = handlerC3257.f12398;
            if (iOException2 != null && handlerC3257.f12399 > iM3345) {
                throw iOException2;
            }
        }
        if (this.f17940 && !this.f17933) {
            throw ParserException.m357("Loading finished before preparation is complete.", null);
        }
    }

    @Override // defpackage.InterfaceC4051
    /* JADX INFO: renamed from: ᵶˇᵱ */
    public final void mo5230(InterfaceC1933 interfaceC1933, long j, long j2, int i) {
        C3771 c3771 = (C3771) interfaceC1933;
        C0165 c0165 = c3771.f14354;
        this.f17941.m4037(i == 0 ? new C3622(c3771.f14352, j) : new C3622(c3771.f14352, c0165.f1575, c0165.f1577, j, j2, c0165.f1576), 1, -1, null, 0, null, c3771.f14359, this.f17929, i);
    }

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final int m9848() {
        int i = 0;
        for (C0890 c0890 : this.f17903) {
            i += c0890.f3939 + c0890.f3932;
        }
        return i;
    }

    @Override // defpackage.InterfaceC1158
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo3639() {
        for (C0890 c0890 : this.f17903) {
            c0890.m3112();
        }
        ᵯᵨᵲ r4 = this.f17914;
        InterfaceC4291 interfaceC4291 = (InterfaceC4291) r4.ᵔᵖᵹᵫ;
        if (interfaceC4291 != null) {
            interfaceC4291.mo1256();
            r4.ᵔᵖᵹᵫ = null;
        }
        r4.ᵨᵼⁱ = null;
    }

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final void m9849(InterfaceC5517 interfaceC5517) {
        this.f17923 = this.f17942 == null ? interfaceC5517 : new C3782(-9223372036854775807L);
        this.f17929 = interfaceC5517.mo1058();
        boolean z = !this.f17931 && interfaceC5517.mo1058() == -9223372036854775807L;
        this.f17905 = z;
        this.f17935 = z ? 7 : 1;
        if (this.f17933) {
            this.f17911.m9659(this.f17929, interfaceC5517, z);
        } else {
            m9844();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:41:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x009b  */
    @Override // defpackage.InterfaceC0472
    /* JADX INFO: renamed from: ᵻʽᵯ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long mo1941(long j) {
        m9839();
        boolean[] zArr = (boolean[]) this.f17906.ᵔᵖᵹᵫ;
        if (!this.f17923.mo1056()) {
            j = 0;
        }
        this.f17913 = false;
        boolean z = this.f17924 == j;
        this.f17924 = j;
        if (m9841()) {
            this.f17928 = j;
            return j;
        }
        int i = this.f17935;
        ᵣˊˈᵪ r5 = this.f17934;
        if (i == 7 || !(this.f17940 || r5.ᵠˏˏ())) {
            this.f17939 = false;
            this.f17928 = j;
            this.f17940 = false;
            this.f17910 = false;
            if (!r5.ᵠˏˏ()) {
                for (C0890 c0890 : this.f17903) {
                    c0890.m3115();
                }
                r5.ᵟᵹᵙ();
                return j;
            }
            r5.ᵨᵼⁱ = null;
            for (C0890 c08902 : this.f17903) {
                c08902.m3096(false);
            }
        } else {
            int length = this.f17903.length;
            for (int i2 = 0; i2 < length; i2++) {
                C0890 c08903 = this.f17903[i2];
                if (this.f17925[i2].f3720.get() == EnumC4432.f16855 && (c08903.m3103() != 0 || !z)) {
                    if (!(this.f17908 ? c08903.m3092(c08903.f3939) : c08903.m3101(this.f17940, j)) && (zArr[i2] || !this.f17915)) {
                        this.f17939 = false;
                        this.f17928 = j;
                        this.f17940 = false;
                        this.f17910 = false;
                        if (!r5.ᵠˏˏ()) {
                        }
                    }
                }
            }
        }
        return j;
    }

    @Override // defpackage.InterfaceC1137
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final long mo3626() {
        return mo3624();
    }
}
