package p138.p176.p177.p190.p217;

import android.media.MediaCodec;
import android.os.Looper;
import com.google.android.exoplayer2.drm.DrmSession;
import java.io.EOFException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.C3433;
import p138.p176.p177.p190.p193.C3506;
import p138.p176.p177.p190.p193.C3511;
import p138.p176.p177.p190.p194.C3526;
import p138.p176.p177.p190.p194.InterfaceC3532;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p198.InterfaceC3575;
import p138.p176.p177.p190.p217.C3818;
import p138.p176.p177.p190.p238.C4099;
import p138.p176.p177.p190.p238.InterfaceC4089;
import p138.p176.p177.p190.p239.C4134;
import p138.p176.p177.p190.p239.C4140;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޖ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C3820 implements InterfaceC3575 {

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

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

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public InterfaceC3822 f11739;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public C3431 f11740;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public DrmSession<?> f11741;

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

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

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

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

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

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public C3431 f11759;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public C3431 f11760;

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

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

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

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

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

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C3821 f11737 = new C3821();

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public int f11742 = 1000;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public int[] f11743 = new int[1000];

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public long[] f11744 = new long[1000];

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public long[] f11747 = new long[1000];

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public int[] f11746 = new int[1000];

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public int[] f11745 = new int[1000];

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public InterfaceC3575.C3576[] f11748 = new InterfaceC3575.C3576[1000];

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public C3431[] f11749 = new C3431[1000];

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public long f11754 = Long.MIN_VALUE;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public long f11755 = Long.MIN_VALUE;

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

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

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

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

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

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public InterfaceC3575.C3576 f11768;
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޖ$ؠ, reason: contains not printable characters */
    public interface InterfaceC3822 {
        /* JADX INFO: renamed from: ֏ */
        void mo6149(C3431 c3431);
    }

    public C3820(InterfaceC4089 interfaceC4089, InterfaceC3532<?> interfaceC3532) {
        this.f11736 = new C3818(interfaceC4089);
        this.f11738 = interfaceC3532;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized int m6170() {
        int i;
        i = this.f11750 - this.f11753;
        this.f11753 = this.f11750;
        return i;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m6171(int i, int i2, long j, boolean z) {
        int i3 = -1;
        for (int i4 = 0; i4 < i2 && this.f11747[i] <= j; i4++) {
            if (!z || (this.f11746[i] & 1) != 0) {
                i3 = i4;
            }
            i++;
            if (i == this.f11742) {
                i = 0;
            }
        }
        return i3;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized int m6172(long j) {
        int iM6193 = m6193(this.f11753);
        if (m6201() && j >= this.f11747[iM6193]) {
            int iM6171 = m6171(iM6193, this.f11750 - this.f11753, j, true);
            if (iM6171 == -1) {
                return 0;
            }
            this.f11753 += iM6171;
            return iM6171;
        }
        return 0;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int m6173(C3433 c3433, C3511 c3511, boolean z, boolean z2, long j) {
        int iM6174 = m6174(c3433, c3511, z, z2, j, this.f11737);
        if (iM6174 == -4 && !c3511.m5805()) {
            int iM6707 = 1;
            if (!(c3511.f10461 == null && c3511.f10465 == 0)) {
                C3818 c3818 = this.f11736;
                C3821 c3821 = this.f11737;
                if (c3818 == null) {
                    throw null;
                }
                if (c3511.m5813()) {
                    long j2 = c3821.f11767;
                    c3818.f11726.m6689(1);
                    c3818.m6166(j2, c3818.f11726.f13227, 1);
                    long j3 = j2 + 1;
                    byte b = c3818.f11726.f13227[0];
                    boolean z3 = (b & 128) != 0;
                    int i = b & 127;
                    C3506 c3506 = c3511.f10460;
                    byte[] bArr = c3506.f10444;
                    if (bArr == null) {
                        c3506.f10444 = new byte[16];
                    } else {
                        Arrays.fill(bArr, (byte) 0);
                    }
                    c3818.m6166(j3, c3506.f10444, i);
                    long j4 = j3 + ((long) i);
                    if (z3) {
                        c3818.f11726.m6689(2);
                        c3818.m6166(j4, c3818.f11726.f13227, 2);
                        j4 += 2;
                        iM6707 = c3818.f11726.m6707();
                    }
                    int[] iArr = c3506.f10445;
                    if (iArr == null || iArr.length < iM6707) {
                        iArr = new int[iM6707];
                    }
                    int[] iArr2 = c3506.f10446;
                    if (iArr2 == null || iArr2.length < iM6707) {
                        iArr2 = new int[iM6707];
                    }
                    if (z3) {
                        int i2 = iM6707 * 6;
                        c3818.f11726.m6689(i2);
                        c3818.m6166(j4, c3818.f11726.f13227, i2);
                        j4 += (long) i2;
                        c3818.f11726.m6693(0);
                        for (int i3 = 0; i3 < iM6707; i3++) {
                            iArr[i3] = c3818.f11726.m6707();
                            iArr2[i3] = c3818.f11726.m6705();
                        }
                    } else {
                        iArr[0] = 0;
                        iArr2[0] = c3821.f11766 - ((int) (j4 - c3821.f11767));
                    }
                    InterfaceC3575.C3576 c3576 = c3821.f11768;
                    byte[] bArr2 = c3576.f10600;
                    byte[] bArr3 = c3506.f10444;
                    int i4 = c3576.f10599;
                    int i5 = c3576.f10601;
                    int i6 = c3576.f10602;
                    c3506.f10445 = iArr;
                    c3506.f10446 = iArr2;
                    c3506.f10444 = bArr3;
                    MediaCodec.CryptoInfo cryptoInfo = c3506.f10447;
                    cryptoInfo.numSubSamples = iM6707;
                    cryptoInfo.numBytesOfClearData = iArr;
                    cryptoInfo.numBytesOfEncryptedData = iArr2;
                    cryptoInfo.key = bArr2;
                    cryptoInfo.iv = bArr3;
                    cryptoInfo.mode = i4;
                    if (C4150.f13259 >= 24) {
                        C3506.C3508 c3508 = c3506.f10448;
                        c3508.f10450.set(i5, i6);
                        c3508.f10449.setPattern(c3508.f10450);
                    }
                    long j5 = c3821.f11767;
                    int i7 = (int) (j4 - j5);
                    c3821.f11767 = j5 + ((long) i7);
                    c3821.f11766 -= i7;
                }
                if (c3511.m5802(268435456)) {
                    c3818.f11726.m6689(4);
                    c3818.m6166(c3821.f11767, c3818.f11726.f13227, 4);
                    int iM6705 = c3818.f11726.m6705();
                    c3821.f11767 += 4;
                    c3821.f11766 -= 4;
                    c3511.m5811(iM6705);
                    c3818.m6165(c3821.f11767, c3511.f10461, iM6705);
                    c3821.f11767 += (long) iM6705;
                    int i8 = c3821.f11766 - iM6705;
                    c3821.f11766 = i8;
                    ByteBuffer byteBuffer = c3511.f10464;
                    if (byteBuffer == null || byteBuffer.capacity() < i8) {
                        c3511.f10464 = ByteBuffer.allocate(i8);
                    } else {
                        c3511.f10464.clear();
                    }
                    c3818.m6165(c3821.f11767, c3511.f10464, c3821.f11766);
                } else {
                    c3511.m5811(c3821.f11766);
                    c3818.m6165(c3821.f11767, c3511.f10461, c3821.f11766);
                }
            }
        }
        return iM6174;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized int m6174(C3433 c3433, C3511 c3511, boolean z, boolean z2, long j, C3821 c3821) {
        boolean zM6201;
        boolean z3 = false;
        c3511.f10462 = false;
        int iM6193 = -1;
        while (true) {
            zM6201 = m6201();
            if (!zM6201) {
                break;
            }
            iM6193 = m6193(this.f11753);
            if (this.f11747[iM6193] >= j || !C4134.m6650(this.f11749[iM6193].f10090)) {
                break;
            }
            this.f11753++;
        }
        if (!zM6201) {
            if (!z2 && !this.f11756) {
                if (this.f11759 == null || (!z && this.f11759 == this.f11740)) {
                    return -3;
                }
                C3431 c3431 = this.f11759;
                C0567.m1856(c3431);
                m6178(c3431, c3433);
                return -5;
            }
            c3511.f10443 = 4;
            return -4;
        }
        if (!z && this.f11749[iM6193] == this.f11740) {
            if (!m6196(iM6193)) {
                c3511.f10462 = true;
                return -3;
            }
            c3511.f10443 = this.f11746[iM6193];
            long j2 = this.f11747[iM6193];
            c3511.f10463 = j2;
            if (j2 < j) {
                c3511.m5801(Integer.MIN_VALUE);
            }
            if (c3511.f10461 == null && c3511.f10465 == 0) {
                z3 = true;
            }
            if (z3) {
                return -4;
            }
            c3821.f11766 = this.f11745[iM6193];
            c3821.f11767 = this.f11744[iM6193];
            c3821.f11768 = this.f11748[iM6193];
            this.f11753++;
            return -4;
        }
        m6178(this.f11749[iM6193], c3433);
        return -5;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3575
    /* JADX INFO: renamed from: ֏ */
    public final int mo5882(C3558 c3558, int i, boolean z) throws InterruptedException, EOFException {
        C3818 c3818 = this.f11736;
        int iM6168 = c3818.m6168(i);
        C3818.C3819 c3819 = c3818.f11729;
        int iM5870 = c3558.m5870(c3819.f11734.f13060, c3819.m6169(c3818.f11730), iM6168);
        if (iM5870 != -1) {
            c3818.m6163(iM5870);
            return iM5870;
        }
        if (z) {
            return -1;
        }
        throw new EOFException();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final long m6175(int i) {
        this.f11754 = Math.max(this.f11754, m6191(i));
        this.f11750 -= i;
        this.f11751 += i;
        int i2 = this.f11752 + i;
        this.f11752 = i2;
        int i3 = this.f11742;
        if (i2 >= i3) {
            this.f11752 = i2 - i3;
        }
        int i4 = this.f11753 - i;
        this.f11753 = i4;
        if (i4 < 0) {
            this.f11753 = 0;
        }
        if (this.f11750 != 0) {
            return this.f11744[this.f11752];
        }
        int i5 = this.f11752;
        if (i5 == 0) {
            i5 = this.f11742;
        }
        int i6 = i5 - 1;
        return this.f11744[i6] + ((long) this.f11745[i6]);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized long m6176(long j, boolean z, boolean z2) {
        if (this.f11750 != 0 && j >= this.f11747[this.f11752]) {
            int iM6171 = m6171(this.f11752, (!z2 || this.f11753 == this.f11750) ? this.f11750 : this.f11753 + 1, j, z);
            if (iM6171 == -1) {
                return -1L;
            }
            return m6175(iM6171);
        }
        return -1L;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3575
    /* JADX INFO: renamed from: ֏ */
    public final void mo5883(long j, int i, int i2, int i3, InterfaceC3575.C3576 c3576) {
        if (this.f11762) {
            mo5884(this.f11763);
        }
        long j2 = j + this.f11764;
        if (this.f11765) {
            if ((i & 1) == 0 || !m6186(j2)) {
                return;
            } else {
                this.f11765 = false;
            }
        }
        m6177(j2, i, (this.f11736.f11730 - ((long) i2)) - ((long) i3), i2, c3576);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized void m6177(long j, int i, long j2, int i2, InterfaceC3575.C3576 c3576) {
        if (this.f11757) {
            if ((i & 1) == 0) {
                return;
            } else {
                this.f11757 = false;
            }
        }
        C0567.m1932(!this.f11758);
        this.f11756 = (536870912 & i) != 0;
        this.f11755 = Math.max(this.f11755, j);
        int iM6193 = m6193(this.f11750);
        this.f11747[iM6193] = j;
        this.f11744[iM6193] = j2;
        this.f11745[iM6193] = i2;
        this.f11746[iM6193] = i;
        this.f11748[iM6193] = c3576;
        this.f11749[iM6193] = this.f11759;
        this.f11743[iM6193] = this.f11761;
        this.f11760 = this.f11759;
        int i3 = this.f11750 + 1;
        this.f11750 = i3;
        if (i3 == this.f11742) {
            int i4 = this.f11742 + 1000;
            int[] iArr = new int[i4];
            long[] jArr = new long[i4];
            long[] jArr2 = new long[i4];
            int[] iArr2 = new int[i4];
            int[] iArr3 = new int[i4];
            InterfaceC3575.C3576[] c3576Arr = new InterfaceC3575.C3576[i4];
            C3431[] c3431Arr = new C3431[i4];
            int i5 = this.f11742 - this.f11752;
            System.arraycopy(this.f11744, this.f11752, jArr, 0, i5);
            System.arraycopy(this.f11747, this.f11752, jArr2, 0, i5);
            System.arraycopy(this.f11746, this.f11752, iArr2, 0, i5);
            System.arraycopy(this.f11745, this.f11752, iArr3, 0, i5);
            System.arraycopy(this.f11748, this.f11752, c3576Arr, 0, i5);
            System.arraycopy(this.f11749, this.f11752, c3431Arr, 0, i5);
            System.arraycopy(this.f11743, this.f11752, iArr, 0, i5);
            int i6 = this.f11752;
            System.arraycopy(this.f11744, 0, jArr, i5, i6);
            System.arraycopy(this.f11747, 0, jArr2, i5, i6);
            System.arraycopy(this.f11746, 0, iArr2, i5, i6);
            System.arraycopy(this.f11745, 0, iArr3, i5, i6);
            System.arraycopy(this.f11748, 0, c3576Arr, i5, i6);
            System.arraycopy(this.f11749, 0, c3431Arr, i5, i6);
            System.arraycopy(this.f11743, 0, iArr, i5, i6);
            this.f11744 = jArr;
            this.f11747 = jArr2;
            this.f11746 = iArr2;
            this.f11745 = iArr3;
            this.f11748 = c3576Arr;
            this.f11749 = c3431Arr;
            this.f11743 = iArr;
            this.f11752 = 0;
            this.f11742 = i4;
        }
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3575
    /* JADX INFO: renamed from: ֏ */
    public final void mo5884(C3431 c3431) {
        C3431 c3431Mo6183 = mo6183(c3431);
        this.f11762 = false;
        this.f11763 = c3431;
        boolean zM6190 = m6190(c3431Mo6183);
        InterfaceC3822 interfaceC3822 = this.f11739;
        if (interfaceC3822 == null || !zM6190) {
            return;
        }
        interfaceC3822.mo6149(c3431Mo6183);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6178(C3431 c3431, C3433 c3433) {
        c3433.f10114 = c3431;
        boolean z = this.f11740 == null;
        C3526 c3526 = z ? null : this.f11740.f10093;
        this.f11740 = c3431;
        if (this.f11738 == InterfaceC3532.f10503) {
            return;
        }
        C3526 c35262 = c3431.f10093;
        c3433.f10112 = true;
        c3433.f10113 = this.f11741;
        if (z || !C4150.m6769(c3526, c35262)) {
            DrmSession<?> drmSession = this.f11741;
            Looper looperMyLooper = Looper.myLooper();
            C0567.m1856(looperMyLooper);
            Looper looper = looperMyLooper;
            DrmSession drmSessionMo1124 = c35262 != null ? this.f11738.mo1124(looper, c35262) : this.f11738.mo1123(looper, C4134.m6655(c3431.f10090));
            this.f11741 = drmSessionMo1124;
            c3433.f10113 = drmSessionMo1124;
            if (drmSession != null) {
                drmSession.mo1104();
            }
        }
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3575
    /* JADX INFO: renamed from: ֏ */
    public final void mo5885(C4140 c4140, int i) {
        C3818 c3818 = this.f11736;
        if (c3818 == null) {
            throw null;
        }
        while (i > 0) {
            int iM6168 = c3818.m6168(i);
            C3818.C3819 c3819 = c3818.f11729;
            c4140.m6685(c3819.f11734.f13060, c3819.m6169(c3818.f11730), iM6168);
            i -= iM6168;
            c3818.m6163(iM6168);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized boolean m6179(long j, boolean z) {
        m6207();
        int iM6193 = m6193(this.f11753);
        if (m6201() && j >= this.f11747[iM6193] && (j <= this.f11755 || z)) {
            int iM6171 = m6171(iM6193, this.f11750 - this.f11753, j, true);
            if (iM6171 == -1) {
                return false;
            }
            this.f11753 += iM6171;
            return true;
        }
        return false;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public synchronized boolean m6180(boolean z) {
        boolean z2 = true;
        if (m6201()) {
            int iM6193 = m6193(this.f11753);
            if (this.f11749[iM6193] != this.f11740) {
                return true;
            }
            return m6196(iM6193);
        }
        if (!z && !this.f11756 && (this.f11759 == null || this.f11759 == this.f11740)) {
            z2 = false;
        }
        return z2;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final synchronized long m6181() {
        if (this.f11750 == 0) {
            return -1L;
        }
        return m6175(this.f11750);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final long m6182(int i) {
        int iM6200 = m6200() - i;
        boolean z = false;
        C0567.m1896(iM6200 >= 0 && iM6200 <= this.f11750 - this.f11753);
        int i2 = this.f11750 - iM6200;
        this.f11750 = i2;
        this.f11755 = Math.max(this.f11754, m6191(i2));
        if (iM6200 == 0 && this.f11756) {
            z = true;
        }
        this.f11756 = z;
        int i3 = this.f11750;
        if (i3 == 0) {
            return 0L;
        }
        int iM6193 = m6193(i3 - 1);
        return this.f11744[iM6193] + ((long) this.f11745[iM6193]);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public C3431 mo6183(C3431 c3431) {
        long j = this.f11764;
        if (j == 0) {
            return c3431;
        }
        long j2 = c3431.f10094;
        return j2 != Long.MAX_VALUE ? c3431.m5598(j2 + j) : c3431;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m6184(long j, boolean z, boolean z2) {
        this.f11736.m6164(m6176(j, z, z2));
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void m6185(boolean z) {
        C3818 c3818 = this.f11736;
        c3818.m6167(c3818.f11727);
        C3818.C3819 c3819 = new C3818.C3819(0L, c3818.f11725);
        c3818.f11727 = c3819;
        c3818.f11728 = c3819;
        c3818.f11729 = c3819;
        c3818.f11730 = 0L;
        ((C4099) c3818.f11724).m6592();
        this.f11750 = 0;
        this.f11751 = 0;
        this.f11752 = 0;
        this.f11753 = 0;
        this.f11757 = true;
        this.f11754 = Long.MIN_VALUE;
        this.f11755 = Long.MIN_VALUE;
        this.f11756 = false;
        this.f11760 = null;
        if (z) {
            this.f11763 = null;
            this.f11759 = null;
            this.f11758 = true;
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final synchronized boolean m6186(long j) {
        if (this.f11750 == 0) {
            return j > this.f11754;
        }
        if (Math.max(this.f11754, m6191(this.f11753)) >= j) {
            return false;
        }
        int i = this.f11750;
        int iM6193 = m6193(this.f11750 - 1);
        while (i > this.f11753 && this.f11747[iM6193] >= j) {
            i--;
            iM6193--;
            if (iM6193 == -1) {
                iM6193 = this.f11742 - 1;
            }
        }
        m6182(this.f11751 + i);
        return true;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public synchronized long m6187() {
        if (this.f11753 == 0) {
            return -1L;
        }
        return m6175(this.f11753);
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final void m6188(int i) {
        C3818 c3818 = this.f11736;
        long jM6182 = m6182(i);
        c3818.f11730 = jM6182;
        if (jM6182 != 0) {
            C3818.C3819 c3819 = c3818.f11727;
            if (jM6182 != c3819.f11731) {
                while (c3818.f11730 > c3819.f11732) {
                    c3819 = c3819.f11735;
                }
                C3818.C3819 c38192 = c3819.f11735;
                c3818.m6167(c38192);
                C3818.C3819 c38193 = new C3818.C3819(c3819.f11732, c3818.f11725);
                c3819.f11735 = c38193;
                if (c3818.f11730 != c3819.f11732) {
                    c38193 = c3819;
                }
                c3818.f11729 = c38193;
                if (c3818.f11728 == c38192) {
                    c3818.f11728 = c3819.f11735;
                    return;
                }
                return;
            }
        }
        c3818.m6167(c3818.f11727);
        C3818.C3819 c38194 = new C3818.C3819(c3818.f11730, c3818.f11725);
        c3818.f11727 = c38194;
        c3818.f11728 = c38194;
        c3818.f11729 = c38194;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final void m6189(long j) {
        if (this.f11764 != j) {
            this.f11764 = j;
            this.f11762 = true;
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final synchronized boolean m6190(C3431 c3431) {
        if (c3431 == null) {
            this.f11758 = true;
            return false;
        }
        this.f11758 = false;
        if (C4150.m6769(c3431, this.f11759)) {
            return false;
        }
        if (C4150.m6769(c3431, this.f11760)) {
            this.f11759 = this.f11760;
            return true;
        }
        this.f11759 = c3431;
        return true;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final long m6191(int i) {
        long jMax = Long.MIN_VALUE;
        if (i == 0) {
            return Long.MIN_VALUE;
        }
        int iM6193 = m6193(i - 1);
        for (int i2 = 0; i2 < i; i2++) {
            jMax = Math.max(jMax, this.f11747[iM6193]);
            if ((this.f11746[iM6193] & 1) != 0) {
                break;
            }
            iM6193--;
            if (iM6193 == -1) {
                iM6193 = this.f11742 - 1;
            }
        }
        return jMax;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final void m6192() {
        this.f11736.m6164(m6181());
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final int m6193(int i) {
        int i2 = this.f11752 + i;
        int i3 = this.f11742;
        return i2 < i3 ? i2 : i2 - i3;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final synchronized long m6194() {
        return this.f11750 == 0 ? Long.MIN_VALUE : this.f11747[this.f11752];
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final synchronized long m6195() {
        return this.f11755;
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final boolean m6196(int i) {
        DrmSession<?> drmSession;
        if (this.f11738 == InterfaceC3532.f10503 || (drmSession = this.f11741) == null || drmSession.mo1113() == 4) {
            return true;
        }
        return (this.f11746[i] & 1073741824) == 0 && this.f11741.mo1111();
    }

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final int m6197() {
        return this.f11751 + this.f11753;
    }

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final synchronized boolean m6198(int i) {
        m6207();
        if (i >= this.f11751 && i <= this.f11751 + this.f11750) {
            this.f11753 = i - this.f11751;
            return true;
        }
        return false;
    }

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final synchronized C3431 m6199() {
        return this.f11758 ? null : this.f11759;
    }

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final int m6200() {
        return this.f11751 + this.f11750;
    }

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final boolean m6201() {
        return this.f11753 != this.f11750;
    }

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final synchronized boolean m6202() {
        return this.f11756;
    }

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public void m6203() throws DrmSession.DrmSessionException {
        DrmSession<?> drmSession = this.f11741;
        if (drmSession == null || drmSession.mo1113() != 1) {
            return;
        }
        DrmSession.DrmSessionException drmSessionExceptionMo1114 = this.f11741.mo1114();
        C0567.m1856(drmSessionExceptionMo1114);
        throw drmSessionExceptionMo1114;
    }

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final synchronized int m6204() {
        return m6201() ? this.f11743[m6193(this.f11753)] : this.f11761;
    }

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public void m6205() {
        m6192();
        DrmSession<?> drmSession = this.f11741;
        if (drmSession != null) {
            drmSession.mo1104();
            this.f11741 = null;
            this.f11740 = null;
        }
    }

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public void m6206() {
        m6185(true);
        DrmSession<?> drmSession = this.f11741;
        if (drmSession != null) {
            drmSession.mo1104();
            this.f11741 = null;
            this.f11740 = null;
        }
    }

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final synchronized void m6207() {
        this.f11753 = 0;
        C3818 c3818 = this.f11736;
        c3818.f11728 = c3818.f11727;
    }
}
