package defpackage;

import j$.util.concurrent.ConcurrentHashMap;
import java.util.Iterator;
import java.util.Map;

/* renamed from: ᵫﾞˌ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4002 {

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public static final C4471 f15045;

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final long f15046;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final ConcurrentHashMap f15047;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final int f15048;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final long f15049;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final long f15050;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C0872 f15051;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final long f15052;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public long f15053;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3254 f15054;

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final long f15055;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final boolean f15056;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public final AbstractC1530 f15057;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4479 f15058;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final long f15059;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final long f15060;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final long f15061;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final long f15062;

    static {
        C4421 c4421 = AbstractC2692.f10429;
        Object[] objArr = {"file", "content", "data", "android.resource", "rawresource", "asset"};
        ᵕˏᵛ.ᵻᵢﹳᵰ(6, objArr);
        f15045 = AbstractC2692.m6695(6, objArr);
    }

    public C4002(C0872 c0872, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8, boolean z, Map map) {
        m8842(i5, 0, "bufferForPlaybackMs", "0");
        m8842(i6, 0, "bufferForPlaybackForLocalPlaybackMs", "0");
        m8842(i7, 0, "bufferForPlaybackAfterRebufferMs", "0");
        m8842(i8, 0, "bufferForPlaybackAfterRebufferForLocalPlaybackMs", "0");
        m8842(i, i5, "minBufferMs", "bufferForPlaybackMs");
        m8842(i2, i6, "minBufferForLocalPlaybackMs", "bufferForPlaybackForLocalPlaybackMs");
        m8842(i, i7, "minBufferMs", "bufferForPlaybackAfterRebufferMs");
        m8842(i2, i8, "minBufferForLocalPlaybackMs", "bufferForPlaybackAfterRebufferForLocalPlaybackMs");
        m8842(i3, i, "maxBufferMs", "minBufferMs");
        m8842(i4, i2, "maxBufferForLocalPlaybackMs", "minBufferForLocalPlaybackMs");
        m8842(0, 0, "backBufferDurationMs", "0");
        this.f15054 = new C3254();
        this.f15058 = new C4479();
        this.f15051 = c0872;
        this.f15062 = AbstractC3558.m8133(i);
        this.f15046 = AbstractC3558.m8133(i2);
        this.f15050 = AbstractC3558.m8133(i3);
        this.f15049 = AbstractC3558.m8133(i4);
        this.f15061 = AbstractC3558.m8133(i5);
        this.f15052 = AbstractC3558.m8133(i6);
        this.f15059 = AbstractC3558.m8133(i7);
        this.f15060 = AbstractC3558.m8133(i8);
        this.f15048 = -1;
        this.f15056 = z;
        this.f15055 = AbstractC3558.m8133(0L);
        this.f15047 = new ConcurrentHashMap();
        this.f15057 = AbstractC1530.m4456(map);
        this.f15053 = -1L;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static void m8842(int i, int i2, String str, String str2) {
        ᵛᵾˏ.ˌʾˀ(i >= i2, "%s cannot be less than %s", str, str2);
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void m8843() {
        boolean zIsEmpty = this.f15047.isEmpty();
        C0872 c0872 = this.f15051;
        int i = 0;
        if (zIsEmpty) {
            synchronized (c0872) {
                if (c0872.f3967) {
                    c0872.m2996(0);
                }
            }
        } else {
            Iterator it = this.f15047.values().iterator();
            while (it.hasNext()) {
                i += ((C0067) it.next()).f1300;
            }
            c0872.m2996(i);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:22:0x0074  */
    /* 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 boolean m8844(defpackage.C2284 r15) {
        /*
            r14 = this;
            ˋᵺᵣ r0 = r15.f8932
            long r1 = r15.f8934
            j$.util.concurrent.ConcurrentHashMap r3 = r14.f15047
            java.lang.Object r3 = r3.get(r0)
            ʽʠːᵣ r3 = (defpackage.C0067) r3
            r3.getClass()
            j$.util.concurrent.ConcurrentHashMap r4 = r14.f15047
            java.lang.Object r4 = r4.get(r0)
            ʽʠːᵣ r4 = (defpackage.C0067) r4
            r4.getClass()
            monitor-enter(r4)
            int r5 = r4.f1303     // Catch: java.lang.Throwable -> Lc4
            monitor-exit(r4)
            ˆᵩᵡ r4 = r14.f15051
            int r4 = r4.f3970
            int r5 = r5 * r4
            j$.util.concurrent.ConcurrentHashMap r4 = r14.f15047
            java.lang.Object r4 = r4.get(r0)
            ʽʠːᵣ r4 = (defpackage.C0067) r4
            r4.getClass()
            int r4 = r4.f1300
            r6 = 0
            r7 = 1
            if (r5 < r4) goto L36
            r4 = r7
            goto L37
        L36:
            r4 = r6
        L37:
            ˋᵺᵣ r5 = defpackage.C1545.f6172
            boolean r0 = r0.equals(r5)
            if (r0 == 0) goto L42
            r14 = r4 ^ 1
            return r14
        L42:
            ʿᵿᵛᵠ r0 = r15.f8933
            ᵗᵱ r5 = r15.f8931
            java.lang.Object r5 = r5.f9683
            ᵲˊʿ r8 = r14.f15058
            ᵲˊʿ r5 = r0.mo2117(r5, r8)
            int r5 = r5.f16708
            ᵢʾˁ r8 = r14.f15054
            r9 = 0
            ᵢʾˁ r0 = r0.mo2123(r5, r8, r9)
            ʾᵿˉ r0 = r0.f12265
            ᵸˉᐧ r0 = r0.f2063
            if (r0 != 0) goto L5f
            goto L74
        L5f:
            android.net.Uri r0 = r0.f18441
            java.lang.String r0 = r0.getScheme()
            boolean r5 = android.text.TextUtils.isEmpty(r0)
            if (r5 != 0) goto L76
            ᵲˁᵔ r5 = defpackage.C4002.f15045
            boolean r0 = r5.contains(r0)
            if (r0 == 0) goto L74
            goto L76
        L74:
            r0 = r6
            goto L77
        L76:
            r0 = r7
        L77:
            if (r0 == 0) goto L7c
            long r8 = r14.f15046
            goto L7e
        L7c:
            long r8 = r14.f15062
        L7e:
            if (r0 == 0) goto L83
            long r10 = r14.f15049
            goto L85
        L83:
            long r10 = r14.f15050
        L85:
            float r15 = r15.f8930
            r5 = 1065353216(0x3f800000, float:1.0)
            int r5 = (r15 > r5 ? 1 : (r15 == r5 ? 0 : -1))
            if (r5 <= 0) goto L95
            long r8 = defpackage.AbstractC3558.m8122(r8, r15)
            long r8 = java.lang.Math.min(r8, r10)
        L95:
            r12 = 500000(0x7a120, double:2.47033E-318)
            long r8 = java.lang.Math.max(r8, r12)
            int r15 = (r1 > r8 ? 1 : (r1 == r8 ? 0 : -1))
            if (r15 >= 0) goto Lb9
            if (r0 == 0) goto La5
            boolean r14 = r14.f15056
            goto La6
        La5:
            r14 = r6
        La6:
            if (r14 != 0) goto Laa
            if (r4 != 0) goto Lab
        Laa:
            r6 = r7
        Lab:
            r3.f1302 = r6
            if (r6 != 0) goto Lc1
            int r14 = (r1 > r12 ? 1 : (r1 == r12 ? 0 : -1))
            if (r14 >= 0) goto Lc1
            java.lang.String r14 = "Target buffer size reached with less than 500ms of buffered media data."
            ᵳʿˉ.ᵶʔᵢˊ(r14)
            goto Lc1
        Lb9:
            int r14 = (r1 > r10 ? 1 : (r1 == r10 ? 0 : -1))
            if (r14 >= 0) goto Lbf
            if (r4 == 0) goto Lc1
        Lbf:
            r3.f1302 = r6
        Lc1:
            boolean r14 = r3.f1302
            return r14
        Lc4:
            r14 = move-exception
            monitor-exit(r4)     // Catch: java.lang.Throwable -> Lc4
            throw r14
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C4002.m8844(ᵕˊʛˀ):boolean");
    }
}
