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;

/* renamed from: ᵤٴ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3425 implements InterfaceC3757, InterfaceC1982, InterfaceC1426, InterfaceC2428, InterfaceC0797 {

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public static final C3446 f12760;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public static final Map f12761;

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public boolean f12762;

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public final long f12763 = Long.MIN_VALUE;

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final C2526 f12764;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public C2237[] f12765;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final RunnableC5409 f12766;

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public boolean f12767;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public boolean f12768;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public InterfaceC5013 f12769;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public boolean f12770;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public C1666[] f12771;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public boolean f12772;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public boolean f12773;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final C3446 f12774;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public long f12775;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public C1744[] f12776;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final long f12777;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final C1790 f12778;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public InterfaceC1727 f12779;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public boolean f12780;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public int f12781;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final ᵧˉʙ f12782;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public C1248 f12783;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public ᵮᵥٴ f12784;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final C2221 f12785;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final InterfaceC2569 f12786;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public boolean f12787;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final C4782 f12788;

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public long f12789;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public boolean f12790;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final ᵧˉʙ f12791;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final Uri f12792;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public boolean f12793;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final long f12794;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public boolean f12795;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final RunnableC5409 f12796;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public boolean f12797;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final ʽᵡ f12798;

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public long f12799;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public int f12800;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final C1899 f12801;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final InterfaceC0687 f12802;

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public int f12803;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final Handler f12804;

    static {
        HashMap map = new HashMap();
        map.put("Icy-MetaData", "1");
        f12761 = DesugarCollections.unmodifiableMap(map);
        C2153 c2153 = new C2153();
        c2153.f8512 = "icy";
        c2153.f8516 = AbstractC2924.m7101("application/x-icy");
        f12760 = new C3446(c2153);
    }

    public C3425(Uri uri, InterfaceC2569 interfaceC2569, ʽᵡ r3, InterfaceC0687 interfaceC0687, C2221 c2221, C1899 c1899, C4782 c4782, C2526 c2526, ᵧˉʙ r9, int i, C3446 c3446, long j, ExecutorC1049 executorC1049) {
        this.f12792 = uri;
        this.f12786 = interfaceC2569;
        this.f12802 = interfaceC0687;
        this.f12785 = c2221;
        this.f12801 = c1899;
        this.f12788 = c4782;
        this.f12764 = c2526;
        this.f12782 = r9;
        this.f12777 = i;
        this.f12774 = c3446;
        this.f12791 = executorC1049 != null ? new ᵧˉʙ(executorC1049) : new ᵧˉʙ(2, "ProgressiveMediaPeriod");
        this.f12798 = r3;
        this.f12794 = j;
        this.f12778 = new C1790();
        this.f12796 = new RunnableC5409(this, 1);
        this.f12766 = new RunnableC5409(this, 2);
        this.f12804 = AbstractC3558.m8130(null);
        this.f12765 = new C2237[0];
        this.f12771 = new C1666[0];
        this.f12776 = new C1744[0];
        this.f12789 = -9223372036854775807L;
        this.f12800 = 1;
    }

    @Override // defpackage.InterfaceC0797
    /* renamed from: ˀᵗᵝᵭ */
    public final void mo2900() {
        this.f12804.post(this.f12796);
    }

    @Override // defpackage.InterfaceC1426
    /* renamed from: ˁˑᵰ */
    public final C3160 mo3510(InterfaceC0452 interfaceC0452, long j, long j2, IOException iOException, int i) {
        C3160 c3160;
        InterfaceC5013 interfaceC5013;
        C4162 c4162 = (C4162) interfaceC0452;
        C0186 c0186 = c4162.f15560;
        C0417 c0417 = new C0417(c4162.f15556, c0186.f1631, c0186.f1630, j, j2, c0186.f1628);
        AbstractC3558.m8161(c4162.f15557);
        AbstractC3558.m8161(this.f12775);
        long jM5318 = this.f12801.m5318(new C2124(i, 5, iOException));
        if (jM5318 == -9223372036854775807L) {
            c3160 = ᵧˉʙ.ˑᵥˁ;
        } else {
            int iM7804 = m7804();
            int i2 = iM7804 > this.f12803 ? 1 : 0;
            if (this.f12762 || !((interfaceC5013 = this.f12769) == null || interfaceC5013.mo1073() == -9223372036854775807L)) {
                this.f12803 = iM7804;
            } else if (!this.f12780 || m7803()) {
                this.f12797 = this.f12780;
                this.f12799 = 0L;
                this.f12803 = 0;
                for (C1666 c1666 : this.f12771) {
                    c1666.m4787(false);
                }
                c4162.f15559.f15658 = 0L;
                c4162.f15557 = 0L;
                c4162.f15558 = true;
                c4162.f15562 = false;
            } else {
                this.f12767 = true;
                c3160 = ᵧˉʙ.ᵡˎ;
            }
            c3160 = new C3160(i2, jM5318, false);
        }
        this.f12788.m10093(c0417, 1, -1, null, 0, null, c4162.f15557, this.f12775, iOException, !c3160.m7518());
        return c3160;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0017  */
    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final long m7794(boolean r6) {
        /*
            r5 = this;
            r0 = -9223372036854775808
            r2 = 0
        L3:
            ˎʔᵳʕ[] r3 = r5.f12771
            int r3 = r3.length
            if (r2 >= r3) goto L26
            if (r6 != 0) goto L17
            ᵮᵥٴ r3 = r5.f12784
            r3.getClass()
            java.lang.Object r3 = r3.ᵾᵬ
            boolean[] r3 = (boolean[]) r3
            boolean r3 = r3[r2]
            if (r3 == 0) goto L23
        L17:
            ˎʔᵳʕ[] r3 = r5.f12771
            r3 = r3[r2]
            long r3 = r3.m4770()
            long r0 = java.lang.Math.max(r0, r3)
        L23:
            int r2 = r2 + 1
            goto L3
        L26:
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3425.m7794(boolean):long");
    }

    @Override // defpackage.InterfaceC1426
    /* renamed from: ˌʾˀ */
    public final void mo3512(InterfaceC0452 interfaceC0452, long j, long j2) {
        C4162 c4162 = (C4162) interfaceC0452;
        if (this.f12775 == -9223372036854775807L && this.f12769 != null) {
            long jM7794 = m7794(true);
            long j3 = jM7794 == Long.MIN_VALUE ? 0L : jM7794 + 10000;
            this.f12775 = j3;
            this.f12764.m6369(j3, this.f12769, this.f12793);
        }
        C0186 c0186 = c4162.f15560;
        C0417 c0417 = new C0417(c4162.f15556, c0186.f1631, c0186.f1630, j, j2, c0186.f1628);
        this.f12801.getClass();
        this.f12788.m10085(c0417, 1, -1, null, 0, null, c4162.f15557, this.f12775);
        this.f12787 = true;
        InterfaceC1727 interfaceC1727 = this.f12779;
        interfaceC1727.getClass();
        interfaceC1727.mo1661(this);
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final boolean m7795() {
        return this.f12789 != -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ˎˏʜʾ */
    public final long mo1662(InterfaceC5264[] interfaceC5264Arr, boolean[] zArr, InterfaceC0772[] interfaceC0772Arr, boolean[] zArr2, long j) {
        InterfaceC5264 interfaceC5264;
        m7801();
        ᵮᵥٴ r0 = this.f12784;
        C0052 c0052 = (C0052) r0.ᵢˇᵭ;
        boolean[] zArr3 = (boolean[]) r0.ᵾᵬ;
        int i = this.f12781;
        int i2 = 0;
        for (int i3 = 0; i3 < interfaceC5264Arr.length; i3++) {
            InterfaceC0772 interfaceC0772 = interfaceC0772Arr[i3];
            if (interfaceC0772 != null && (interfaceC5264Arr[i3] == null || !zArr[i3])) {
                int i4 = ((C3402) interfaceC0772).f12681;
                ᵛᵾˏ.ᵿʗᵝʽ(zArr3[i4]);
                this.f12781--;
                zArr3[i4] = false;
                interfaceC0772Arr[i3] = null;
            }
        }
        boolean z = !this.f12770 ? j == 0 || this.f12795 : i != 0;
        for (int i5 = 0; i5 < interfaceC5264Arr.length; i5++) {
            if (interfaceC0772Arr[i5] == null && (interfaceC5264 = interfaceC5264Arr[i5]) != null) {
                ᵛᵾˏ.ᵿʗᵝʽ(interfaceC5264.length() == 1);
                ᵛᵾˏ.ᵿʗᵝʽ(interfaceC5264.mo5376(0) == 0);
                int iM1104 = c0052.m1104(interfaceC5264.mo5375());
                ᵛᵾˏ.ᵿʗᵝʽ(!zArr3[iM1104]);
                this.f12781++;
                zArr3[iM1104] = true;
                this.f12773 = interfaceC5264.mo5374().f12911 | this.f12773;
                interfaceC0772Arr[i5] = new C3402(this, iM1104);
                zArr2[i5] = true;
                if (!z) {
                    C1666 c1666 = this.f12771[iM1104];
                    z = (c1666.m4777() == 0 || c1666.m4761(true, j)) ? false : true;
                }
            }
        }
        if (this.f12781 == 0) {
            this.f12767 = false;
            this.f12797 = false;
            this.f12773 = false;
            ᵧˉʙ r9 = this.f12791;
            if (r9.ᵧـˌᵎ()) {
                C1666[] c1666Arr = this.f12771;
                int length = c1666Arr.length;
                while (i2 < length) {
                    c1666Arr[i2].m4763();
                    i2++;
                }
                r9.ˌʾˀ();
            } else {
                this.f12787 = false;
                for (C1666 c16662 : this.f12771) {
                    c16662.m4787(false);
                }
            }
        } else if (z) {
            j = mo1672(j);
            while (i2 < interfaceC0772Arr.length) {
                if (interfaceC0772Arr[i2] != null) {
                    zArr2[i2] = true;
                }
                i2++;
            }
        }
        this.f12770 = true;
        return j;
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final void m7796() {
        C4162 c4162 = new C4162(this, this.f12792, this.f12786, this.f12798, this, this.f12778);
        if (this.f12780) {
            ᵛᵾˏ.ᵿʗᵝʽ(m7795());
            long j = this.f12763;
            if (j == Long.MIN_VALUE) {
                j = this.f12775;
            }
            if (j != -9223372036854775807L && this.f12789 > j) {
                this.f12787 = true;
                this.f12789 = -9223372036854775807L;
                return;
            }
            InterfaceC5013 interfaceC5013 = this.f12769;
            interfaceC5013.getClass();
            long j2 = interfaceC5013.mo1072(this.f12789).f3073.f20785;
            long j3 = this.f12789;
            c4162.f15559.f15658 = j2;
            c4162.f15557 = j3;
            c4162.f15558 = true;
            c4162.f15562 = false;
            for (C1666 c1666 : this.f12771) {
                c1666.f6619 = this.f12789;
            }
            this.f12789 = -9223372036854775807L;
        }
        this.f12803 = m7804();
        this.f12791.ᵡᵘˎʽ(c4162, this, this.f12801.m5319(this.f12800));
    }

    @Override // defpackage.InterfaceC1426
    /* renamed from: ˏˋٴ */
    public final void mo3514(InterfaceC0452 interfaceC0452, long j, long j2, boolean z) {
        C4162 c4162 = (C4162) interfaceC0452;
        C0186 c0186 = c4162.f15560;
        C0417 c0417 = new C0417(c4162.f15556, c0186.f1631, c0186.f1630, j, j2, c0186.f1628);
        this.f12801.getClass();
        this.f12788.m10086(c0417, 1, -1, null, 0, null, c4162.f15557, this.f12775);
        if (z) {
            return;
        }
        for (C1666 c1666 : this.f12771) {
            c1666.m4787(false);
        }
        if (this.f12781 > 0) {
            InterfaceC1727 interfaceC1727 = this.f12779;
            interfaceC1727.getClass();
            interfaceC1727.mo1661(this);
        }
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ˏᵙ */
    public final long mo1663(long j, C4110 c4110) {
        m7801();
        if (!this.f12769.mo1074()) {
            return 0L;
        }
        C0611 c0611Mo1072 = this.f12769.mo1072(j);
        return c4110.m8997(j, c0611Mo1072.f3073.f20784, c0611Mo1072.f3074.f20784);
    }

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final void m7797(InterfaceC5013 interfaceC5013) {
        this.f12769 = this.f12783 == null ? interfaceC5013 : new C3300(-9223372036854775807L);
        this.f12775 = interfaceC5013.mo1073();
        boolean z = !this.f12762 && interfaceC5013.mo1073() == -9223372036854775807L;
        this.f12793 = z;
        this.f12800 = z ? 7 : 1;
        if (this.f12780) {
            this.f12764.m6369(this.f12775, interfaceC5013, z);
        } else {
            m7802();
        }
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ˑᵱ */
    public final void mo1664(long j) {
        if (this.f12781 <= 0 || m7795()) {
            return;
        }
        int i = 0;
        if (this.f12763 != Long.MIN_VALUE) {
            m7801();
            int i2 = 1;
            while (true) {
                C1666[] c1666Arr = this.f12771;
                if (i >= c1666Arr.length) {
                    break;
                }
                ᵮᵥٴ r2 = this.f12784;
                if (((boolean[]) r2.ᵾᵬ)[i] && (((boolean[]) r2.ᵿʗᵝʽ)[i] || !this.f12772)) {
                    i2 &= c1666Arr[i].m4775() ? 1 : 0;
                }
                i++;
            }
            i = i2;
        }
        if (i != 0) {
            this.f12787 = true;
        }
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵝᵵᵺ */
    public final void mo1665() throws IOException {
        int iM5319 = this.f12801.m5319(this.f12800);
        ᵧˉʙ r1 = this.f12791;
        IOException iOException = (IOException) r1.ᵾᵬ;
        if (iOException != null) {
            throw iOException;
        }
        HandlerC5173 handlerC5173 = (HandlerC5173) r1.ᵿʗᵝʽ;
        if (handlerC5173 != null) {
            if (iM5319 == Integer.MIN_VALUE) {
                iM5319 = handlerC5173.f19260;
            }
            IOException iOException2 = handlerC5173.f19259;
            if (iOException2 != null && handlerC5173.f19257 > iM5319) {
                throw iOException2;
            }
        }
        if (this.f12787 && !this.f12780) {
            throw ParserException.m356("Loading finished before preparation is complete.", null);
        }
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵞʡ */
    public final void mo4985() {
        this.f12768 = true;
        this.f12804.post(this.f12796);
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵡʠ */
    public final C0052 mo1666() {
        m7801();
        return (C0052) this.f12784.ᵢˇᵭ;
    }

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final InterfaceC2154 m7798(C2237 c2237) {
        int length = this.f12771.length;
        for (int i = 0; i < length; i++) {
            if (c2237.equals(this.f12765[i])) {
                return this.f12771[i];
            }
        }
        if (this.f12768) {
            ᵳʿˉ.ᵶʔᵢˊ("Extractor added new track (id=" + c2237.f8773 + ") after finishing tracks.");
            return new C1706();
        }
        InterfaceC0687 interfaceC0687 = this.f12802;
        interfaceC0687.getClass();
        C1666 c1666 = new C1666(this.f12782, interfaceC0687, this.f12785);
        C1744 c1744 = new C1744(c1666);
        c1666.f6604 = this;
        int i2 = length + 1;
        C2237[] c2237Arr = (C2237[]) Arrays.copyOf(this.f12765, i2);
        c2237Arr[length] = c2237;
        this.f12765 = c2237Arr;
        C1666[] c1666Arr = (C1666[]) Arrays.copyOf(this.f12771, i2);
        c1666Arr[length] = c1666;
        this.f12771 = c1666Arr;
        C1744[] c1744Arr = (C1744[]) Arrays.copyOf(this.f12776, i2);
        c1744Arr[length] = c1744;
        this.f12776 = c1744Arr;
        return c1744;
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵡⁱᵥ */
    public final void mo4987(InterfaceC5013 interfaceC5013) {
        this.f12804.post(new RunnableC5417(this, 12, interfaceC5013));
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final void m7799(int i) {
        m7801();
        ᵮᵥٴ r0 = this.f12784;
        boolean[] zArr = (boolean[]) r0.ᵤᵙᵷ;
        if (zArr[i]) {
            return;
        }
        C3446 c3446 = ((C0052) r0.ᵢˇᵭ).m1103(i).f15079[0];
        this.f12788.m10098(AbstractC2924.m7106(c3446.f12929), c3446, 0, null, this.f12799);
        zArr[i] = true;
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final void m7800(int i) {
        m7801();
        if (this.f12767) {
            if ((!this.f12772 || ((boolean[]) this.f12784.ᵿʗᵝʽ)[i]) && !this.f12771[i].m4773(false)) {
                this.f12789 = 0L;
                this.f12767 = false;
                this.f12797 = true;
                this.f12799 = 0L;
                this.f12803 = 0;
                for (C1666 c1666 : this.f12771) {
                    c1666.m4787(false);
                }
                InterfaceC1727 interfaceC1727 = this.f12779;
                interfaceC1727.getClass();
                interfaceC1727.mo1661(this);
            }
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m7801() {
        ᵛᵾˏ.ᵿʗᵝʽ(this.f12780);
        this.f12784.getClass();
        this.f12769.getClass();
    }

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final void m7802() {
        C3034 c3034M7373;
        long j = this.f12794;
        if (this.f12790 || this.f12780 || !this.f12768 || this.f12769 == null) {
            return;
        }
        boolean z = false;
        for (C1666 c1666 : this.f12771) {
            if (c1666.m4788() == null) {
                return;
            }
        }
        C1790 c1790 = this.f12778;
        synchronized (c1790) {
            c1790.f7196 = false;
        }
        int length = this.f12771.length;
        int i = -1;
        int i2 = 0;
        int i3 = 0;
        while (true) {
            char c = 1;
            if (i2 >= length) {
                break;
            }
            C3446 c3446M4788 = this.f12771[i2].m4788();
            c3446M4788.getClass();
            int iM7106 = AbstractC2924.m7106(c3446M4788.f12929);
            char c2 = iM7106 != 1 ? iM7106 != 2 ? iM7106 != 3 ? iM7106 != 4 ? (char) 0 : (char) 2 : (char) 1 : (char) 4 : (char) 3;
            if (i == 1) {
                c = 3;
            } else if (i == 2) {
                c = 4;
            } else if (i != 3) {
                c = i != 4 ? (char) 0 : (char) 2;
            }
            if (c2 > c) {
                i3 = i2;
                i = iM7106;
            }
            i2++;
        }
        C4010[] c4010Arr = new C4010[length];
        boolean[] zArr = new boolean[length];
        int i4 = 0;
        while (i4 < length) {
            C3446 c3446M47882 = this.f12771[i4].m4788();
            c3446M47882.getClass();
            String str = c3446M47882.f12929;
            boolean zM7113 = AbstractC2924.m7113(str);
            boolean z2 = (zM7113 || AbstractC2924.m7110(str)) ? true : z;
            zArr[i4] = z2;
            boolean z3 = z;
            this.f12772 |= z2;
            this.f12795 = (j != -9223372036854775807L && length == 1 && AbstractC2924.m7109(str)) ? true : z3 ? 1 : 0;
            C1248 c1248 = this.f12783;
            if (c1248 != null) {
                int i5 = c1248.f5214;
                if (zM7113 || this.f12765[i4].f8774) {
                    C3034 c3034 = c3446M47882.f12904;
                    if (c3034 == null) {
                        InterfaceC3080[] interfaceC3080Arr = new InterfaceC3080[1];
                        interfaceC3080Arr[z3 ? 1 : 0] = c1248;
                        c3034M7373 = new C3034(interfaceC3080Arr);
                    } else {
                        InterfaceC3080[] interfaceC3080Arr2 = new InterfaceC3080[1];
                        interfaceC3080Arr2[z3 ? 1 : 0] = c1248;
                        c3034M7373 = c3034.m7373(interfaceC3080Arr2);
                    }
                    C2153 c2153M7829 = c3446M47882.m7829();
                    c2153M7829.f8524 = c3034M7373;
                    c3446M47882 = new C3446(c2153M7829);
                }
                if (zM7113 && c3446M47882.f12935 == -1 && c3446M47882.f12914 == -1 && i5 != -1) {
                    C2153 c2153M78292 = c3446M47882.m7829();
                    c2153M78292.f8525 = i5;
                    c3446M47882 = new C3446(c2153M78292);
                }
            }
            int iMo2671 = this.f12802.mo2671(c3446M47882);
            C2153 c2153M78293 = c3446M47882.m7829();
            c2153M78293.f8499 = iMo2671;
            C3446 c3446 = new C3446(c2153M78293);
            if (i4 != i3) {
                C2153 c2153M78294 = c3446.m7829();
                c2153M78294.f8494 = Integer.toString(i3);
                c3446 = new C3446(c2153M78294);
            }
            String string = Integer.toString(i4);
            C3446[] c3446Arr = new C3446[1];
            c3446Arr[z3 ? 1 : 0] = c3446;
            c4010Arr[i4] = new C4010(string, c3446Arr);
            this.f12773 = c3446.f12911 | this.f12773;
            this.f12771[i4].m4790(this.f12763);
            i4++;
            z = z3 ? 1 : 0;
        }
        this.f12784 = new ᵮᵥٴ(new C0052(c4010Arr), zArr);
        if (this.f12795 && this.f12775 == -9223372036854775807L) {
            this.f12775 = j;
            this.f12769 = new C3992(this, this.f12769);
        }
        this.f12764.m6369(this.f12775, this.f12769, this.f12793);
        this.f12780 = true;
        InterfaceC1727 interfaceC1727 = this.f12779;
        interfaceC1727.getClass();
        interfaceC1727.mo1667(this);
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵨᵳʝ */
    public final long mo1668() {
        long jM7794;
        boolean z;
        m7801();
        if (this.f12787 || this.f12781 == 0) {
            return Long.MIN_VALUE;
        }
        if (m7795()) {
            return this.f12789;
        }
        if (this.f12772) {
            int length = this.f12771.length;
            jM7794 = Long.MAX_VALUE;
            for (int i = 0; i < length; i++) {
                ᵮᵥٴ r9 = this.f12784;
                if (((boolean[]) r9.ᵿʗᵝʽ)[i] && ((boolean[]) r9.ᵾᵬ)[i]) {
                    C1666 c1666 = this.f12771[i];
                    synchronized (c1666) {
                        z = c1666.f6631;
                    }
                    if (!z) {
                        jM7794 = Math.min(jM7794, this.f12771[i].m4770());
                    }
                }
            }
        } else {
            jM7794 = Long.MAX_VALUE;
        }
        if (jM7794 == Long.MAX_VALUE) {
            jM7794 = m7794(false);
        }
        return jM7794 == Long.MIN_VALUE ? this.f12799 : jM7794;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵪʩ */
    public final long mo1669() {
        if (this.f12773) {
            this.f12773 = false;
            return this.f12799;
        }
        if (!this.f12797) {
            return -9223372036854775807L;
        }
        if (!this.f12787 && m7804() <= this.f12803) {
            return -9223372036854775807L;
        }
        this.f12797 = false;
        return this.f12799;
    }

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final boolean m7803() {
        return this.f12797 || m7795();
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵯٴᵦ */
    public final boolean mo1670() {
        boolean z;
        if (this.f12787 || !this.f12791.ᵧـˌᵎ()) {
            return false;
        }
        C1790 c1790 = this.f12778;
        synchronized (c1790) {
            z = c1790.f7196;
        }
        return z;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵳٴᵶ */
    public final void mo1671(InterfaceC1727 interfaceC1727, long j) {
        this.f12779 = interfaceC1727;
        C3446 c3446 = this.f12774;
        if (c3446 == null) {
            this.f12778.m5098();
            m7796();
        } else {
            mo4996(0, 3).mo4407(c3446);
            m7797(new C0708(-9223372036854775807L, new long[]{0}, new long[]{0}));
            mo4985();
            this.f12789 = j;
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int m7804() {
        int i = 0;
        for (C1666 c1666 : this.f12771) {
            i += c1666.f6611 + c1666.f6600;
        }
        return i;
    }

    /* JADX WARN: Removed duplicated region for block: B:41:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x009b  */
    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵶᵷᵕ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final long mo1672(long r10) {
        /*
            r9 = this;
            r9.m7801()
            ᵮᵥٴ r0 = r9.f12784
            java.lang.Object r0 = r0.ᵿʗᵝʽ
            boolean[] r0 = (boolean[]) r0
            ᵹʝ r1 = r9.f12769
            boolean r1 = r1.mo1074()
            if (r1 == 0) goto L12
            goto L14
        L12:
            r10 = 0
        L14:
            r1 = 0
            r9.f12797 = r1
            long r2 = r9.f12799
            int r2 = (r2 > r10 ? 1 : (r2 == r10 ? 0 : -1))
            if (r2 != 0) goto L1f
            r2 = 1
            goto L20
        L1f:
            r2 = r1
        L20:
            r9.f12799 = r10
            boolean r3 = r9.m7795()
            if (r3 == 0) goto L2b
            r9.f12789 = r10
            return r10
        L2b:
            int r3 = r9.f12800
            r4 = 7
            ᵧˉʙ r5 = r9.f12791
            if (r3 == r4) goto L7c
            boolean r3 = r9.f12787
            if (r3 != 0) goto L3c
            boolean r3 = r5.ᵧـˌᵎ()
            if (r3 == 0) goto L7c
        L3c:
            ˎʔᵳʕ[] r3 = r9.f12771
            int r3 = r3.length
            r4 = r1
        L40:
            if (r4 >= r3) goto Lac
            ˎʔᵳʕ[] r6 = r9.f12771
            r6 = r6[r4]
            ˎᵙ[] r7 = r9.f12776
            r7 = r7[r4]
            java.util.concurrent.atomic.AtomicReference r7 = r7.f6958
            java.lang.Object r7 = r7.get()
            ˑᵦᵲ r8 = defpackage.EnumC2086.f8275
            if (r7 != r8) goto L79
            int r7 = r6.m4777()
            if (r7 != 0) goto L5d
            if (r2 == 0) goto L5d
            goto L79
        L5d:
            boolean r7 = r9.f12795
            if (r7 == 0) goto L68
            int r7 = r6.f6611
            boolean r6 = r6.m4783(r7)
            goto L6e
        L68:
            boolean r7 = r9.f12787
            boolean r6 = r6.m4761(r7, r10)
        L6e:
            if (r6 != 0) goto L79
            boolean r6 = r0[r4]
            if (r6 != 0) goto L7c
            boolean r6 = r9.f12772
            if (r6 != 0) goto L79
            goto L7c
        L79:
            int r4 = r4 + 1
            goto L40
        L7c:
            r9.f12767 = r1
            r9.f12789 = r10
            r9.f12787 = r1
            r9.f12773 = r1
            boolean r0 = r5.ᵧـˌᵎ()
            if (r0 == 0) goto L9b
            ˎʔᵳʕ[] r9 = r9.f12771
            int r0 = r9.length
        L8d:
            if (r1 >= r0) goto L97
            r2 = r9[r1]
            r2.m4763()
            int r1 = r1 + 1
            goto L8d
        L97:
            r5.ˌʾˀ()
            return r10
        L9b:
            r0 = 0
            r5.ᵾᵬ = r0
            ˎʔᵳʕ[] r9 = r9.f12771
            int r0 = r9.length
            r2 = r1
        La2:
            if (r2 >= r0) goto Lac
            r3 = r9[r2]
            r3.m4787(r1)
            int r2 = r2 + 1
            goto La2
        Lac:
            return r10
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3425.mo1672(long):long");
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵸʓᵠ */
    public final boolean mo1673(C5196 c5196) {
        if (this.f12787) {
            return false;
        }
        ᵧˉʙ r2 = this.f12791;
        if (r2.ˎˑː() || this.f12767) {
            return false;
        }
        if ((this.f12780 || this.f12774 != null) && this.f12781 == 0) {
            return false;
        }
        boolean zM5098 = this.f12778.m5098();
        if (r2.ᵧـˌᵎ()) {
            return zM5098;
        }
        m7796();
        return true;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵸˑ */
    public final void mo1674(long j) throws Throwable {
        if (this.f12795) {
            return;
        }
        m7801();
        if (m7795()) {
            return;
        }
        boolean[] zArr = (boolean[]) this.f12784.ᵾᵬ;
        int length = this.f12771.length;
        for (int i = 0; i < length; i++) {
            this.f12771[i].m4785(zArr[i], j);
        }
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵹᵝᵶ */
    public final long mo1675() {
        return mo1668();
    }

    @Override // defpackage.InterfaceC2428
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo4995() {
        for (C1666 c1666 : this.f12771) {
            c1666.m4776();
        }
        ʽᵡ r4 = this.f12798;
        InterfaceC2689 interfaceC2689 = (InterfaceC2689) r4.ᵿʗᵝʽ;
        if (interfaceC2689 != null) {
            interfaceC2689.mo1576();
            r4.ᵿʗᵝʽ = null;
        }
        r4.ᵾᵬ = null;
    }

    @Override // defpackage.InterfaceC1982
    /* renamed from: ᵾᵬ */
    public final InterfaceC2154 mo4996(int i, int i2) {
        return m7798(new C2237(i, false));
    }

    @Override // defpackage.InterfaceC1426
    /* renamed from: ᵿʗᵝʽ */
    public final void mo3521(InterfaceC0452 interfaceC0452, long j, long j2, int i) {
        C4162 c4162 = (C4162) interfaceC0452;
        C0186 c0186 = c4162.f15560;
        this.f12788.m10089(i == 0 ? new C0417(c4162.f15556, j) : new C0417(c4162.f15556, c0186.f1631, c0186.f1630, j, j2, c0186.f1628), 1, -1, null, 0, null, c4162.f15557, this.f12775, i);
    }
}
