package defpackage;

/* JADX INFO: renamed from: ːˌᵷᵥ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1966 implements InterfaceC4833 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public int f7804;

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

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public long[] f7807;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public boolean f7809;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public C2316 f7810;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public boolean f7811;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final ˊˊᵞᵽ f7808 = new ˊˊᵞᵽ(21);

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public long f7806 = -9223372036854775807L;

    public C1966(C2316 c2316, C5286 c5286, boolean z) {
        this.f7805 = c5286;
        this.f7810 = c2316;
        this.f7807 = c2316.f9109;
        m5317(c2316, z);
    }

    @Override // defpackage.InterfaceC4833
    /* JADX INFO: renamed from: ʽˈˋ */
    public final void mo1983() {
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m5317(C2316 c2316, boolean z) {
        int i = this.f7804;
        long j = -9223372036854775807L;
        long j2 = i == 0 ? -9223372036854775807L : this.f7807[i - 1];
        this.f7809 = z;
        this.f7810 = c2316;
        long[] jArr = c2316.f9109;
        this.f7807 = jArr;
        long j3 = this.f7806;
        if (j3 == -9223372036854775807L) {
            if (j2 != -9223372036854775807L) {
                this.f7804 = AbstractC0956.m3210(jArr, j2, false);
            }
        } else {
            int iM3210 = AbstractC0956.m3210(jArr, j3, true);
            this.f7804 = iM3210;
            if (this.f7809 && iM3210 == this.f7807.length) {
                j = j3;
            }
            this.f7806 = j;
        }
    }

    @Override // defpackage.InterfaceC4833
    /* JADX INFO: renamed from: ᵝᵶ */
    public final int mo1984(ˊˊᵞᵽ r7, C3008 c3008, int i) {
        int i2 = this.f7804;
        boolean z = i2 == this.f7807.length;
        if (z && !this.f7809) {
            c3008.f9866 = 4;
            return -4;
        }
        if ((i & 2) != 0 || !this.f7811) {
            r7.ᵔᵖᵹᵫ = this.f7805;
            this.f7811 = true;
            return -5;
        }
        if (z) {
            return -3;
        }
        if ((i & 1) == 0) {
            this.f7804 = i2 + 1;
        }
        if ((i & 4) == 0) {
            byte[] bArr = this.f7808.ᵸˆˁ(this.f7810.f9111[i2]);
            c3008.m7093(bArr.length);
            c3008.f11582.put(bArr);
        }
        c3008.f11577 = this.f7807[i2];
        c3008.f9866 = 1;
        return -4;
    }

    @Override // defpackage.InterfaceC4833
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final boolean mo1985() {
        return true;
    }

    @Override // defpackage.InterfaceC4833
    /* JADX INFO: renamed from: ᵶᵥᵝ */
    public final int mo1986(long j) {
        int iMax = Math.max(this.f7804, AbstractC0956.m3210(this.f7807, j, true));
        int i = iMax - this.f7804;
        this.f7804 = iMax;
        return i;
    }
}
