package p138.p176.p177.p190.p217;

import android.net.Uri;
import android.os.Handler;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.source.UnrecognizedInputFormatException;
import com.google.android.exoplayer2.upstream.Loader;
import java.io.EOFException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import p000.p001.p002.p003.p004.C0567;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.C3433;
import p138.p176.p177.p190.C3453;
import p138.p176.p177.p190.p193.C3511;
import p138.p176.p177.p190.p194.InterfaceC3532;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p198.C3570;
import p138.p176.p177.p190.p198.InterfaceC3561;
import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.InterfaceC3571;
import p138.p176.p177.p190.p198.InterfaceC3575;
import p138.p176.p177.p190.p198.p203.C3606;
import p138.p176.p177.p190.p210.C3710;
import p138.p176.p177.p190.p210.p213.C3729;
import p138.p176.p177.p190.p217.C3796;
import p138.p176.p177.p190.p217.C3820;
import p138.p176.p177.p190.p217.InterfaceC3798;
import p138.p176.p177.p190.p217.InterfaceC3803;
import p138.p176.p177.p190.p235.InterfaceC4036;
import p138.p176.p177.p190.p238.C4098;
import p138.p176.p177.p190.p238.C4114;
import p138.p176.p177.p190.p238.InterfaceC4089;
import p138.p176.p177.p190.p238.InterfaceC4095;
import p138.p176.p177.p190.p238.InterfaceC4109;
import p138.p176.p177.p190.p239.C4123;
import p138.p176.p177.p190.p239.C4134;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3809 implements InterfaceC3798, InterfaceC3562, Loader.InterfaceC0319<C3810>, Loader.InterfaceC0323, C3820.InterfaceC3822 {

    /* JADX INFO: renamed from: ࢣ, reason: contains not printable characters */
    public static final Map<String, String> f11641;

    /* JADX INFO: renamed from: ࢤ, reason: contains not printable characters */
    public static final C3431 f11642;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final Uri f11643;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final InterfaceC4095 f11644;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final InterfaceC3532<?> f11645;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final InterfaceC4109 f11646;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final InterfaceC3803.C3804 f11647;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final InterfaceC3812 f11648;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final InterfaceC4089 f11649;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final String f11650;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final long f11651;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final C3811 f11653;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public InterfaceC3798.InterfaceC3799 f11658;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public InterfaceC3571 f11659;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public C3729 f11660;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public boolean f11663;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public boolean f11664;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public C3813 f11665;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public boolean f11666;

    /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
    public boolean f11668;

    /* JADX INFO: renamed from: ޝ, reason: contains not printable characters */
    public boolean f11669;

    /* JADX INFO: renamed from: ޞ, reason: contains not printable characters */
    public boolean f11670;

    /* JADX INFO: renamed from: ޟ, reason: contains not printable characters */
    public int f11671;

    /* JADX INFO: renamed from: ޢ, reason: contains not printable characters */
    public boolean f11674;

    /* JADX INFO: renamed from: ޣ, reason: contains not printable characters */
    public long f11675;

    /* JADX INFO: renamed from: ޥ, reason: contains not printable characters */
    public boolean f11677;

    /* JADX INFO: renamed from: ޱ, reason: contains not printable characters */
    public int f11678;

    /* JADX INFO: renamed from: ࢠ, reason: contains not printable characters */
    public boolean f11679;

    /* JADX INFO: renamed from: ࢢ, reason: contains not printable characters */
    public boolean f11680;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final Loader f11652 = new Loader("Loader:ProgressiveMediaPeriod");

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final C4123 f11654 = new C4123();

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public final Runnable f11655 = new Runnable() { // from class: ދ.ހ.֏.ؠ.ໞ.֏
        @Override // java.lang.Runnable
        public final void run() {
            this.f11573.m6156();
        }
    };

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public final Runnable f11656 = new Runnable() { // from class: ދ.ހ.֏.ؠ.ໞ.ވ
        @Override // java.lang.Runnable
        public final void run() {
            this.f11608.m6155();
        }
    };

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public final Handler f11657 = new Handler();

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public C3815[] f11662 = new C3815[0];

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public C3820[] f11661 = new C3820[0];

    /* JADX INFO: renamed from: ޤ, reason: contains not printable characters */
    public long f11676 = -9223372036854775807L;

    /* JADX INFO: renamed from: ޡ, reason: contains not printable characters */
    public long f11673 = -1;

    /* JADX INFO: renamed from: ޠ, reason: contains not printable characters */
    public long f11672 = -9223372036854775807L;

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public int f11667 = 1;

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$֏, reason: contains not printable characters */
    public final class C3810 implements Loader.InterfaceC0322, C3796.InterfaceC3797 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final Uri f11681;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final C4114 f11682;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final C3811 f11683;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final InterfaceC3562 f11684;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final C4123 f11685;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public volatile boolean f11687;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public long f11689;

        /* JADX INFO: renamed from: މ, reason: contains not printable characters */
        public InterfaceC3575 f11692;

        /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
        public boolean f11693;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final C3570 f11686 = new C3570();

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public boolean f11688 = true;

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public long f11691 = -1;

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public C4098 f11690 = m6159(0);

        public C3810(Uri uri, InterfaceC4095 interfaceC4095, C3811 c3811, InterfaceC3562 interfaceC3562, C4123 c4123) {
            this.f11681 = uri;
            this.f11682 = new C4114(interfaceC4095);
            this.f11683 = c3811;
            this.f11684 = interfaceC3562;
            this.f11685 = c4123;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C4098 m6159(long j) {
            return new C4098(this.f11681, 1, null, j, j, -1L, C3809.this.f11650, 6, C3809.f11641);
        }

        @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0322
        /* JADX INFO: renamed from: ֏ */
        public void mo1299() throws Throwable {
            long j;
            Uri uriMo1284;
            InterfaceC4095 c3796;
            int iMo5886 = 0;
            while (iMo5886 == 0 && !this.f11687) {
                C3558 c3558 = null;
                try {
                    j = this.f11686.f10591;
                    C4098 c4098M6159 = m6159(j);
                    this.f11690 = c4098M6159;
                    long jMo1283 = this.f11682.mo1283(c4098M6159);
                    this.f11691 = jMo1283;
                    if (jMo1283 != -1) {
                        this.f11691 = jMo1283 + j;
                    }
                    uriMo1284 = this.f11682.mo1284();
                    C0567.m1856(uriMo1284);
                    C3809.this.f11660 = C3729.m6066(this.f11682.mo6120());
                    c3796 = this.f11682;
                } catch (Throwable th) {
                    th = th;
                }
                if (C3809.this.f11660 != null && C3809.this.f11660.f11482 != -1) {
                    c3796 = new C3796(this.f11682, C3809.this.f11660.f11482, this);
                    C3809 c3809 = C3809.this;
                    if (c3809 == null) {
                        throw null;
                    }
                    InterfaceC3575 interfaceC3575M6147 = c3809.m6147(new C3815(0, true));
                    this.f11692 = interfaceC3575M6147;
                    interfaceC3575M6147.mo5884(C3809.f11642);
                    if (iMo5886 != 1 && c3558 != null) {
                        this.f11686.f10591 = c3558.f10563;
                    }
                    C4150.m6766((InterfaceC4095) this.f11682);
                    throw th;
                }
                C3558 c35582 = new C3558(c3796, j, this.f11691);
                try {
                    InterfaceC3561 interfaceC3561M6160 = this.f11683.m6160(c35582, this.f11684, uriMo1284);
                    if (C3809.this.f11660 != null && (interfaceC3561M6160 instanceof C3606)) {
                        ((C3606) interfaceC3561M6160).f10825 = true;
                    }
                    if (this.f11688) {
                        interfaceC3561M6160.mo5888(j, this.f11689);
                        this.f11688 = false;
                    }
                    while (iMo5886 == 0 && !this.f11687) {
                        this.f11685.m6626();
                        iMo5886 = interfaceC3561M6160.mo5886(c35582, this.f11686);
                        if (c35582.f10563 > C3809.this.f11651 + j) {
                            j = c35582.f10563;
                            this.f11685.m6627();
                            C3809.this.f11657.post(C3809.this.f11656);
                        }
                    }
                    if (iMo5886 == 1) {
                        iMo5886 = 0;
                    } else {
                        this.f11686.f10591 = c35582.f10563;
                    }
                    C4114 c4114 = this.f11682;
                    if (c4114 != null) {
                        try {
                            c4114.close();
                        } catch (IOException unused) {
                        }
                    }
                } catch (Throwable th2) {
                    th = th2;
                    c3558 = c35582;
                }
            }
        }

        @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0322
        /* JADX INFO: renamed from: ؠ */
        public void mo1300() {
            this.f11687 = true;
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$ؠ, reason: contains not printable characters */
    public static final class C3811 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final InterfaceC3561[] f11695;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public InterfaceC3561 f11696;

        public C3811(InterfaceC3561[] interfaceC3561Arr) {
            this.f11695 = interfaceC3561Arr;
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public InterfaceC3561 m6160(C3558 c3558, InterfaceC3562 interfaceC3562, Uri uri) throws UnrecognizedInputFormatException {
            InterfaceC3561 interfaceC3561 = this.f11696;
            if (interfaceC3561 != null) {
                return interfaceC3561;
            }
            InterfaceC3561[] interfaceC3561Arr = this.f11695;
            if (interfaceC3561Arr.length == 1) {
                this.f11696 = interfaceC3561Arr[0];
            } else {
                int length = interfaceC3561Arr.length;
                int i = 0;
                while (true) {
                    if (i >= length) {
                        break;
                    }
                    InterfaceC3561 interfaceC35612 = interfaceC3561Arr[i];
                    try {
                        if (interfaceC35612.mo5890(c3558)) {
                            this.f11696 = interfaceC35612;
                            c3558.f10565 = 0;
                            break;
                        }
                        continue;
                    } catch (EOFException unused) {
                    } catch (Throwable th) {
                        c3558.f10565 = 0;
                        throw th;
                    }
                    c3558.f10565 = 0;
                    i++;
                }
                if (this.f11696 == null) {
                    throw new UnrecognizedInputFormatException(C2803.m4884(C2803.m4889("None of the available extractors ("), C4150.m6792(this.f11695), ") could read the stream."), uri);
                }
            }
            this.f11696.mo5889(interfaceC3562);
            return this.f11696;
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$ހ, reason: contains not printable characters */
    public interface InterfaceC3812 {
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$ށ, reason: contains not printable characters */
    public static final class C3813 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final InterfaceC3571 f11697;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final C3829 f11698;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final boolean[] f11699;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final boolean[] f11700;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final boolean[] f11701;

        public C3813(InterfaceC3571 interfaceC3571, C3829 c3829, boolean[] zArr) {
            this.f11697 = interfaceC3571;
            this.f11698 = c3829;
            this.f11699 = zArr;
            int i = c3829.f11785;
            this.f11700 = new boolean[i];
            this.f11701 = new boolean[i];
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$ނ, reason: contains not printable characters */
    public final class C3814 implements InterfaceC3823 {

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final int f11702;

        public C3814(int i) {
            this.f11702 = i;
        }

        @Override // p138.p176.p177.p190.p217.InterfaceC3823
        /* JADX INFO: renamed from: ֏ */
        public int mo6116(C3433 c3433, C3511 c3511, boolean z) {
            C3809 c3809 = C3809.this;
            int i = this.f11702;
            if (c3809.m6158()) {
                return -3;
            }
            c3809.m6148(i);
            int iM6173 = c3809.f11661[i].m6173(c3433, c3511, z, c3809.f11679, c3809.f11675);
            if (iM6173 == -3) {
                c3809.m6150(i);
            }
            return iM6173;
        }

        @Override // p138.p176.p177.p190.p217.InterfaceC3823
        /* JADX INFO: renamed from: ֏ */
        public void mo6117() throws IOException {
            C3809 c3809 = C3809.this;
            c3809.f11661[this.f11702].m6203();
            c3809.f11652.m1291(c3809.f11646.mo6614(c3809.f11667));
        }

        @Override // p138.p176.p177.p190.p217.InterfaceC3823
        /* JADX INFO: renamed from: ށ */
        public int mo6118(long j) {
            C3809 c3809 = C3809.this;
            int i = this.f11702;
            if (c3809.m6158()) {
                return 0;
            }
            c3809.m6148(i);
            C3820 c3820 = c3809.f11661[i];
            int iM6172 = (!c3809.f11679 || j <= c3820.m6195()) ? c3820.m6172(j) : c3820.m6170();
            if (iM6172 != 0) {
                return iM6172;
            }
            c3809.m6150(i);
            return iM6172;
        }

        @Override // p138.p176.p177.p190.p217.InterfaceC3823
        /* JADX INFO: renamed from: ރ */
        public boolean mo6119() {
            C3809 c3809 = C3809.this;
            return !c3809.m6158() && c3809.f11661[this.f11702].m6180(c3809.f11679);
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޓ$ރ, reason: contains not printable characters */
    public static final class C3815 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final int f11704;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final boolean f11705;

        public C3815(int i, boolean z) {
            this.f11704 = i;
            this.f11705 = z;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null || C3815.class != obj.getClass()) {
                return false;
            }
            C3815 c3815 = (C3815) obj;
            return this.f11704 == c3815.f11704 && this.f11705 == c3815.f11705;
        }

        public int hashCode() {
            return (this.f11704 * 31) + (this.f11705 ? 1 : 0);
        }
    }

    static {
        HashMap map = new HashMap();
        map.put("Icy-MetaData", "1");
        f11641 = Collections.unmodifiableMap(map);
        f11642 = C3431.m5580("icy", "application/x-icy", Long.MAX_VALUE);
    }

    public C3809(Uri uri, InterfaceC4095 interfaceC4095, InterfaceC3561[] interfaceC3561Arr, InterfaceC3532<?> interfaceC3532, InterfaceC4109 interfaceC4109, InterfaceC3803.C3804 c3804, InterfaceC3812 interfaceC3812, InterfaceC4089 interfaceC4089, String str, int i) {
        this.f11643 = uri;
        this.f11644 = interfaceC4095;
        this.f11645 = interfaceC3532;
        this.f11646 = interfaceC4109;
        this.f11647 = c3804;
        this.f11648 = interfaceC3812;
        this.f11649 = interfaceC4089;
        this.f11650 = str;
        this.f11651 = i;
        this.f11653 = new C3811(interfaceC3561Arr);
        c3804.m6124();
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ֏ */
    public long mo6102(long j, C3453 c3453) {
        InterfaceC3571 interfaceC3571 = m6153().f11697;
        if (!interfaceC3571.mo5858()) {
            return 0L;
        }
        InterfaceC3571.C3572 c3572Mo5857 = interfaceC3571.mo5857(j);
        return C4150.m6752(j, c3453, c3572Mo5857.f10592.f10597, c3572Mo5857.f10593.f10597);
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ֏ */
    public long mo6103(InterfaceC4036[] interfaceC4036Arr, boolean[] zArr, InterfaceC3823[] interfaceC3823Arr, boolean[] zArr2, long j) {
        C3813 c3813M6153 = m6153();
        C3829 c3829 = c3813M6153.f11698;
        boolean[] zArr3 = c3813M6153.f11700;
        int i = this.f11671;
        int i2 = 0;
        for (int i3 = 0; i3 < interfaceC4036Arr.length; i3++) {
            if (interfaceC3823Arr[i3] != null && (interfaceC4036Arr[i3] == null || !zArr[i3])) {
                int i4 = ((C3814) interfaceC3823Arr[i3]).f11702;
                C0567.m1932(zArr3[i4]);
                this.f11671--;
                zArr3[i4] = false;
                interfaceC3823Arr[i3] = null;
            }
        }
        boolean z = !this.f11668 ? j == 0 : i != 0;
        for (int i5 = 0; i5 < interfaceC4036Arr.length; i5++) {
            if (interfaceC3823Arr[i5] == null && interfaceC4036Arr[i5] != null) {
                InterfaceC4036 interfaceC4036 = interfaceC4036Arr[i5];
                C0567.m1932(interfaceC4036.length() == 1);
                C0567.m1932(interfaceC4036.mo6478(0) == 0);
                int iM6209 = c3829.m6209(interfaceC4036.mo6481());
                C0567.m1932(!zArr3[iM6209]);
                this.f11671++;
                zArr3[iM6209] = true;
                interfaceC3823Arr[i5] = new C3814(iM6209);
                zArr2[i5] = true;
                if (!z) {
                    C3820 c3820 = this.f11661[iM6209];
                    z = (c3820.m6179(j, true) || c3820.m6197() == 0) ? false : true;
                }
            }
        }
        if (this.f11671 == 0) {
            this.f11677 = false;
            this.f11669 = false;
            if (this.f11652.m1295()) {
                C3820[] c3820Arr = this.f11661;
                int length = c3820Arr.length;
                while (i2 < length) {
                    c3820Arr[i2].m6192();
                    i2++;
                }
                this.f11652.m1293();
            } else {
                for (C3820 c38202 : this.f11661) {
                    c38202.m6185(false);
                }
            }
        } else if (z) {
            j = mo6111(j);
            while (i2 < interfaceC3823Arr.length) {
                if (interfaceC3823Arr[i2] != null) {
                    zArr2[i2] = true;
                }
                i2++;
            }
        }
        this.f11668 = true;
        return j;
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x0081  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x0086  */
    @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0319
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public Loader.C0320 mo1230(Loader.InterfaceC0322 interfaceC0322, long j, long j2, IOException iOException, int i) {
        Loader.C0320 c0320M1289;
        InterfaceC3571 interfaceC3571;
        C3810 c3810 = (C3810) interfaceC0322;
        if (this.f11673 == -1) {
            this.f11673 = c3810.f11691;
        }
        long jMo6616 = this.f11646.mo6616(this.f11667, j2, iOException, i);
        if (jMo6616 == -9223372036854775807L) {
            c0320M1289 = Loader.f1981;
        } else {
            int iM6151 = m6151();
            boolean z = false;
            boolean z2 = iM6151 > this.f11678;
            if (this.f11673 != -1 || ((interfaceC3571 = this.f11659) != null && interfaceC3571.mo5859() != -9223372036854775807L)) {
                this.f11678 = iM6151;
            } else if (!this.f11664 || m6158()) {
                this.f11669 = this.f11664;
                this.f11675 = 0L;
                this.f11678 = 0;
                for (C3820 c3820 : this.f11661) {
                    c3820.m6185(false);
                }
                c3810.f11686.f10591 = 0L;
                c3810.f11689 = 0L;
                c3810.f11688 = true;
                c3810.f11693 = false;
            } else {
                this.f11677 = true;
                c0320M1289 = !z ? Loader.m1289(z2, jMo6616) : Loader.f1980;
            }
            z = true;
            if (!z) {
            }
        }
        InterfaceC3803.C3804 c3804 = this.f11647;
        C4098 c4098 = c3810.f11690;
        C4114 c4114 = c3810.f11682;
        c3804.m6135(c4098, c4114.f13160, c4114.f13161, 1, -1, null, 0, null, c3810.f11689, this.f11672, j, j2, c4114.f13159, iOException, !c0320M1289.m1296());
        return c0320M1289;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC3575 mo5891(int i, int i2) {
        return m6147(new C3815(i, false));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC3575 m6147(C3815 c3815) {
        int length = this.f11661.length;
        for (int i = 0; i < length; i++) {
            if (c3815.equals(this.f11662[i])) {
                return this.f11661[i];
            }
        }
        C3820 c3820 = new C3820(this.f11649, this.f11645);
        c3820.f11739 = this;
        int i2 = length + 1;
        C3815[] c3815Arr = (C3815[]) Arrays.copyOf(this.f11662, i2);
        c3815Arr[length] = c3815;
        this.f11662 = c3815Arr;
        C3820[] c3820Arr = (C3820[]) Arrays.copyOf(this.f11661, i2);
        c3820Arr[length] = c3820;
        this.f11661 = c3820Arr;
        return c3820;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public void mo5892() {
        this.f11663 = true;
        this.f11657.post(this.f11655);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6148(int i) {
        C3813 c3813M6153 = m6153();
        boolean[] zArr = c3813M6153.f11701;
        if (zArr[i]) {
            return;
        }
        C3431 c3431 = c3813M6153.f11698.f11786[i].f11782[0];
        this.f11647.m6125(C4134.m6655(c3431.f10090), c3431, 0, (Object) null, this.f11675);
        zArr[i] = true;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ֏ */
    public void mo6104(long j, boolean z) {
        if (m6154()) {
            return;
        }
        boolean[] zArr = m6153().f11700;
        int length = this.f11661.length;
        for (int i = 0; i < length; i++) {
            C3820 c3820 = this.f11661[i];
            c3820.f11736.m6164(c3820.m6176(j, z, zArr[i]));
        }
    }

    @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0319
    /* JADX INFO: renamed from: ֏ */
    public void mo1231(Loader.InterfaceC0322 interfaceC0322, long j, long j2) {
        InterfaceC3571 interfaceC3571;
        C3810 c3810 = (C3810) interfaceC0322;
        if (this.f11672 == -9223372036854775807L && (interfaceC3571 = this.f11659) != null) {
            boolean zMo5858 = interfaceC3571.mo5858();
            long jM6152 = m6152();
            long j3 = jM6152 == Long.MIN_VALUE ? 0L : jM6152 + 10000;
            this.f11672 = j3;
            ((C3816) this.f11648).m6162(j3, zMo5858, this.f11674);
        }
        InterfaceC3803.C3804 c3804 = this.f11647;
        C4098 c4098 = c3810.f11690;
        C4114 c4114 = c3810.f11682;
        c3804.m6141(c4098, c4114.f13160, c4114.f13161, 1, -1, null, 0, null, c3810.f11689, this.f11672, j, j2, c4114.f13159);
        if (this.f11673 == -1) {
            this.f11673 = c3810.f11691;
        }
        this.f11679 = true;
        InterfaceC3798.InterfaceC3799 interfaceC3799 = this.f11658;
        C0567.m1856(interfaceC3799);
        interfaceC3799.mo5541(this);
    }

    @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0319
    /* JADX INFO: renamed from: ֏ */
    public void mo1232(Loader.InterfaceC0322 interfaceC0322, long j, long j2, boolean z) {
        C3810 c3810 = (C3810) interfaceC0322;
        InterfaceC3803.C3804 c3804 = this.f11647;
        C4098 c4098 = c3810.f11690;
        C4114 c4114 = c3810.f11682;
        c3804.m6134(c4098, c4114.f13160, c4114.f13161, 1, -1, null, 0, null, c3810.f11689, this.f11672, j, j2, c4114.f13159);
        if (z) {
            return;
        }
        if (this.f11673 == -1) {
            this.f11673 = c3810.f11691;
        }
        for (C3820 c3820 : this.f11661) {
            c3820.m6185(false);
        }
        if (this.f11671 > 0) {
            InterfaceC3798.InterfaceC3799 interfaceC3799 = this.f11658;
            C0567.m1856(interfaceC3799);
            interfaceC3799.mo5541(this);
        }
    }

    @Override // p138.p176.p177.p190.p217.C3820.InterfaceC3822
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo6149(C3431 c3431) {
        this.f11657.post(this.f11655);
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public void mo5893(InterfaceC3571 interfaceC3571) {
        if (this.f11660 != null) {
            interfaceC3571 = new InterfaceC3571.C3573(-9223372036854775807L, 0L);
        }
        this.f11659 = interfaceC3571;
        this.f11657.post(this.f11655);
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ֏ */
    public void mo6105(InterfaceC3798.InterfaceC3799 interfaceC3799, long j) {
        this.f11658 = interfaceC3799;
        this.f11654.m6629();
        m6157();
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798, p138.p176.p177.p190.p217.InterfaceC3824
    /* JADX INFO: renamed from: ֏ */
    public boolean mo6107(long j) {
        if (this.f11679 || this.f11652.m1294() || this.f11677) {
            return false;
        }
        if (this.f11664 && this.f11671 == 0) {
            return false;
        }
        boolean zM6629 = this.f11654.m6629();
        if (this.f11652.m1295()) {
            return zM6629;
        }
        m6157();
        return true;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m6150(int i) {
        boolean[] zArr = m6153().f11699;
        if (this.f11677 && zArr[i] && !this.f11661[i].m6180(false)) {
            this.f11676 = 0L;
            this.f11677 = false;
            this.f11669 = true;
            this.f11675 = 0L;
            this.f11678 = 0;
            for (C3820 c3820 : this.f11661) {
                c3820.m6185(false);
            }
            InterfaceC3798.InterfaceC3799 interfaceC3799 = this.f11658;
            C0567.m1856(interfaceC3799);
            interfaceC3799.mo5541(this);
        }
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798, p138.p176.p177.p190.p217.InterfaceC3824
    /* JADX INFO: renamed from: ؠ */
    public void mo6108(long j) {
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798, p138.p176.p177.p190.p217.InterfaceC3824
    /* JADX INFO: renamed from: ؠ */
    public boolean mo6109() {
        return this.f11652.m1295() && this.f11654.m6628();
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798, p138.p176.p177.p190.p217.InterfaceC3824
    /* JADX INFO: renamed from: ހ */
    public long mo6110() {
        if (this.f11671 == 0) {
            return Long.MIN_VALUE;
        }
        return mo6112();
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ހ */
    public long mo6111(long j) {
        boolean z;
        C3813 c3813M6153 = m6153();
        InterfaceC3571 interfaceC3571 = c3813M6153.f11697;
        boolean[] zArr = c3813M6153.f11699;
        if (!interfaceC3571.mo5858()) {
            j = 0;
        }
        this.f11669 = false;
        this.f11675 = j;
        if (m6154()) {
            this.f11676 = j;
            return j;
        }
        if (this.f11667 != 7) {
            int length = this.f11661.length;
            for (int i = 0; i < length; i++) {
                if (!this.f11661[i].m6179(j, false) && (zArr[i] || !this.f11666)) {
                    z = false;
                    break;
                }
            }
            z = true;
            if (z) {
                return j;
            }
        }
        this.f11677 = false;
        this.f11676 = j;
        this.f11679 = false;
        if (this.f11652.m1295()) {
            this.f11652.m1293();
        } else {
            this.f11652.f1984 = null;
            for (C3820 c3820 : this.f11661) {
                c3820.m6185(false);
            }
        }
        return j;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798, p138.p176.p177.p190.p217.InterfaceC3824
    /* JADX INFO: renamed from: ށ */
    public long mo6112() {
        long jM6152;
        boolean[] zArr = m6153().f11699;
        if (this.f11679) {
            return Long.MIN_VALUE;
        }
        if (m6154()) {
            return this.f11676;
        }
        if (this.f11666) {
            int length = this.f11661.length;
            jM6152 = Long.MAX_VALUE;
            for (int i = 0; i < length; i++) {
                if (zArr[i] && !this.f11661[i].m6202()) {
                    jM6152 = Math.min(jM6152, this.f11661[i].m6195());
                }
            }
        } else {
            jM6152 = Long.MAX_VALUE;
        }
        if (jM6152 == Long.MAX_VALUE) {
            jM6152 = m6152();
        }
        return jM6152 == Long.MIN_VALUE ? this.f11675 : jM6152;
    }

    @Override // com.google.android.exoplayer2.upstream.Loader.InterfaceC0323
    /* JADX INFO: renamed from: ނ */
    public void mo1301() {
        for (C3820 c3820 : this.f11661) {
            c3820.m6206();
        }
        C3811 c3811 = this.f11653;
        InterfaceC3561 interfaceC3561 = c3811.f11696;
        if (interfaceC3561 != null) {
            interfaceC3561.mo5887();
            c3811.f11696 = null;
        }
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final int m6151() {
        int iM6200 = 0;
        for (C3820 c3820 : this.f11661) {
            iM6200 += c3820.m6200();
        }
        return iM6200;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ބ */
    public long mo6113() {
        if (!this.f11670) {
            this.f11647.m6143();
            this.f11670 = true;
        }
        if (!this.f11669) {
            return -9223372036854775807L;
        }
        if (!this.f11679 && m6151() <= this.f11678) {
            return -9223372036854775807L;
        }
        this.f11669 = false;
        return this.f11675;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ޅ */
    public C3829 mo6114() {
        return m6153().f11698;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3798
    /* JADX INFO: renamed from: ކ */
    public void mo6115() throws IOException {
        this.f11652.m1291(this.f11646.mo6614(this.f11667));
        if (this.f11679 && !this.f11664) {
            throw new ParserException("Loading finished before preparation is complete.");
        }
    }

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final long m6152() {
        long jMax = Long.MIN_VALUE;
        for (C3820 c3820 : this.f11661) {
            jMax = Math.max(jMax, c3820.m6195());
        }
        return jMax;
    }

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final C3813 m6153() {
        C3813 c3813 = this.f11665;
        C0567.m1856(c3813);
        return c3813;
    }

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final boolean m6154() {
        return this.f11676 != -9223372036854775807L;
    }

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public /* synthetic */ void m6155() {
        if (this.f11680) {
            return;
        }
        InterfaceC3798.InterfaceC3799 interfaceC3799 = this.f11658;
        C0567.m1856(interfaceC3799);
        interfaceC3799.mo5541(this);
    }

    /* JADX WARN: Removed duplicated region for block: B:42:0x0112 A[PHI: r8
      0x0112: PHI (r8v4 ދ.ހ.֏.ؠ.ޚ) = (r8v3 ދ.ހ.֏.ؠ.ޚ), (r8v7 ދ.ހ.֏.ؠ.ޚ), (r8v7 ދ.ހ.֏.ؠ.ޚ), (r8v7 ދ.ހ.֏.ؠ.ޚ) binds: [B:27:0x0060, B:36:0x0092, B:38:0x0097, B:40:0x009b] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m6156() {
        boolean[] zArr;
        C3431 c3431;
        C3710 c3710;
        int i;
        InterfaceC3571 interfaceC3571 = this.f11659;
        if (this.f11680 || this.f11664 || !this.f11663 || interfaceC3571 == null) {
            return;
        }
        char c = 0;
        for (C3820 c3820 : this.f11661) {
            if (c3820.m6199() == null) {
                return;
            }
        }
        this.f11654.m6627();
        int length = this.f11661.length;
        C3827[] c3827Arr = new C3827[length];
        boolean[] zArr2 = new boolean[length];
        this.f11672 = interfaceC3571.mo5859();
        int i2 = 0;
        while (i2 < length) {
            C3431 c3431M6199 = this.f11661[i2].m6199();
            String str = c3431M6199.f10090;
            boolean zM6657 = C4134.m6657(str);
            boolean z = zM6657 || C4134.m6659(str);
            zArr2[i2] = z;
            this.f11666 = z | this.f11666;
            C3729 c3729 = this.f11660;
            if (c3729 == null) {
                zArr = zArr2;
                c3431 = c3431M6199;
            } else {
                if (zM6657 || this.f11662[i2].f11705) {
                    C3710 c37102 = c3431M6199.f10088;
                    if (c37102 == null) {
                        C3710.InterfaceC3712[] interfaceC3712Arr = new C3710.InterfaceC3712[1];
                        interfaceC3712Arr[c] = c3729;
                        c3710 = new C3710(interfaceC3712Arr);
                    } else {
                        C3710.InterfaceC3712[] interfaceC3712Arr2 = new C3710.InterfaceC3712[1];
                        interfaceC3712Arr2[c] = c3729;
                        c3710 = new C3710((C3710.InterfaceC3712[]) C4150.m6779((Object[]) c37102.f11440, (Object[]) interfaceC3712Arr2));
                    }
                    c3431M6199 = c3431M6199.m5601(c3431M6199.f10093, c3710);
                }
                if (zM6657 && c3431M6199.f10086 == -1 && (i = c3729.f11477) != -1) {
                    zArr = zArr2;
                    c3431 = new C3431(c3431M6199.f10082, c3431M6199.f10083, c3431M6199.f10084, c3431M6199.f10085, i, c3431M6199.f10087, c3431M6199.f10088, c3431M6199.f10089, c3431M6199.f10090, c3431M6199.f10091, c3431M6199.f10092, c3431M6199.f10093, c3431M6199.f10094, c3431M6199.f10095, c3431M6199.f10096, c3431M6199.f10097, c3431M6199.f10098, c3431M6199.f10099, c3431M6199.f10101, c3431M6199.f10100, c3431M6199.f10102, c3431M6199.f10103, c3431M6199.f10104, c3431M6199.f10105, c3431M6199.f10106, c3431M6199.f10107, c3431M6199.f10108, c3431M6199.f10109, c3431M6199.f10110);
                }
            }
            c3827Arr[i2] = new C3827(c3431);
            i2++;
            zArr2 = zArr;
            c = 0;
        }
        boolean[] zArr3 = zArr2;
        boolean z2 = this.f11673 == -1 && interfaceC3571.mo5859() == -9223372036854775807L;
        this.f11674 = z2;
        this.f11667 = z2 ? 7 : 1;
        this.f11665 = new C3813(interfaceC3571, new C3829(c3827Arr), zArr3);
        this.f11664 = true;
        ((C3816) this.f11648).m6162(this.f11672, interfaceC3571.mo5858(), this.f11674);
        InterfaceC3798.InterfaceC3799 interfaceC3799 = this.f11658;
        C0567.m1856(interfaceC3799);
        interfaceC3799.mo5538((InterfaceC3798) this);
    }

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final void m6157() {
        C3810 c3810 = new C3810(this.f11643, this.f11644, this.f11653, this, this.f11654);
        if (this.f11664) {
            InterfaceC3571 interfaceC3571 = m6153().f11697;
            C0567.m1932(m6154());
            long j = this.f11672;
            if (j != -9223372036854775807L && this.f11676 > j) {
                this.f11679 = true;
                this.f11676 = -9223372036854775807L;
                return;
            }
            long j2 = interfaceC3571.mo5857(this.f11676).f10592.f10598;
            long j3 = this.f11676;
            c3810.f11686.f10591 = j2;
            c3810.f11689 = j3;
            c3810.f11688 = true;
            c3810.f11693 = false;
            this.f11676 = -9223372036854775807L;
        }
        this.f11678 = m6151();
        this.f11647.m6132(c3810.f11690, 1, -1, (C3431) null, 0, (Object) null, c3810.f11689, this.f11672, this.f11652.m1290(c3810, this, this.f11646.mo6614(this.f11667)));
    }

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final boolean m6158() {
        return this.f11669 || m6154();
    }
}
