package defpackage;

import androidx.media3.exoplayer.source.ClippingMediaSource$IllegalClippingException;

/* renamed from: ˇᵙː, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0954 implements InterfaceC3757, InterfaceC1727 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public long f4288;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public ClippingMediaSource$IllegalClippingException f4289;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public long f4290;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public InterfaceC1727 f4291;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public long f4292;

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

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public long f4294;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public C3806[] f4295 = new C3806[0];

    public C0954(InterfaceC3757 interfaceC3757, boolean z, long j, long j2, int i) {
        this.f4293 = interfaceC3757;
        this.f4294 = z ? j : -9223372036854775807L;
        this.f4292 = -9223372036854775807L;
        this.f4290 = j;
        this.f4288 = j2;
    }

    @Override // defpackage.InterfaceC4532
    /* renamed from: ˇʼʤˎ */
    public final void mo1661(InterfaceC5211 interfaceC5211) {
        InterfaceC1727 interfaceC1727 = this.f4291;
        interfaceC1727.getClass();
        interfaceC1727.mo1661(this);
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ˎˏʜʾ */
    public final long mo1662(InterfaceC5264[] interfaceC5264Arr, boolean[] zArr, InterfaceC0772[] interfaceC0772Arr, boolean[] zArr2, long j) {
        long j2;
        this.f4295 = new C3806[interfaceC0772Arr.length];
        InterfaceC0772[] interfaceC0772Arr2 = new InterfaceC0772[interfaceC0772Arr.length];
        for (int i = 0; i < interfaceC0772Arr.length; i++) {
            C3806[] c3806Arr = this.f4295;
            C3806 c3806 = (C3806) interfaceC0772Arr[i];
            c3806Arr[i] = c3806;
            interfaceC0772Arr2[i] = c3806 != null ? c3806.f14190 : null;
        }
        long jMo1662 = this.f4293.mo1662(interfaceC5264Arr, zArr, interfaceC0772Arr2, zArr2, j);
        long j3 = this.f4288;
        long jMax = Math.max(jMo1662, j);
        if (j3 != Long.MIN_VALUE) {
            jMax = Math.min(jMax, j3);
        }
        if (m3233()) {
            if (jMo1662 >= j) {
                if (jMo1662 != 0) {
                    for (InterfaceC5264 interfaceC5264 : interfaceC5264Arr) {
                        if (interfaceC5264 != null) {
                            C3446 c3446Mo5374 = interfaceC5264.mo5374();
                            if (!AbstractC2924.m7107(c3446Mo5374.f12929, c3446Mo5374.f12934)) {
                            }
                        }
                    }
                }
                j2 = -9223372036854775807L;
            }
            j2 = jMax;
            break;
        } else {
            j2 = -9223372036854775807L;
        }
        this.f4294 = j2;
        for (int i2 = 0; i2 < interfaceC0772Arr.length; i2++) {
            InterfaceC0772 interfaceC0772 = interfaceC0772Arr2[i2];
            C3806[] c3806Arr2 = this.f4295;
            if (interfaceC0772 == null) {
                c3806Arr2[i2] = null;
            } else {
                C3806 c38062 = c3806Arr2[i2];
                if (c38062 == null || c38062.f14190 != interfaceC0772) {
                    c3806Arr2[i2] = new C3806(this, interfaceC0772);
                }
            }
            interfaceC0772Arr[i2] = c3806Arr2[i2];
        }
        return jMax;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ˏᵙ */
    public final long mo1663(long j, C4110 c4110) {
        long j2 = this.f4290;
        if (j == j2) {
            return j2;
        }
        long jM8153 = AbstractC3558.m8153(c4110.f15355, 0L, j - j2);
        long j3 = c4110.f15356;
        long j4 = this.f4288;
        long jM81532 = AbstractC3558.m8153(j3, 0L, j4 == Long.MIN_VALUE ? Long.MAX_VALUE : j4 - j);
        if (jM8153 != c4110.f15355 || jM81532 != c4110.f15356) {
            c4110 = new C4110(jM8153, jM81532);
        }
        return this.f4293.mo1663(j, c4110);
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ˑᵱ */
    public final void mo1664(long j) {
        this.f4293.mo1664(j);
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵝᵵᵺ */
    public final void mo1665() throws ClippingMediaSource$IllegalClippingException {
        ClippingMediaSource$IllegalClippingException clippingMediaSource$IllegalClippingException = this.f4289;
        if (clippingMediaSource$IllegalClippingException != null) {
            throw clippingMediaSource$IllegalClippingException;
        }
        this.f4293.mo1665();
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵡʠ */
    public final C0052 mo1666() {
        return this.f4293.mo1666();
    }

    @Override // defpackage.InterfaceC1727
    /* renamed from: ᵥᵯˎ */
    public final void mo1667(InterfaceC3757 interfaceC3757) {
        if (this.f4289 != null) {
            return;
        }
        InterfaceC1727 interfaceC1727 = this.f4291;
        interfaceC1727.getClass();
        interfaceC1727.mo1667(this);
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵨᵳʝ */
    public final long mo1668() {
        long jMo1668 = this.f4293.mo1668();
        if (jMo1668 != Long.MIN_VALUE) {
            long j = this.f4288;
            if (j == Long.MIN_VALUE || jMo1668 < j) {
                return jMo1668;
            }
        }
        return Long.MIN_VALUE;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵪʩ */
    public final long mo1669() {
        if (m3233()) {
            long j = this.f4294;
            this.f4294 = -9223372036854775807L;
            this.f4292 = j;
            long jMo1669 = mo1669();
            return jMo1669 != -9223372036854775807L ? jMo1669 : j;
        }
        long jMo16692 = this.f4293.mo1669();
        if (jMo16692 != -9223372036854775807L) {
            long j2 = this.f4290;
            long j3 = this.f4288;
            long jMax = Math.max(jMo16692, j2);
            if (j3 != Long.MIN_VALUE) {
                jMax = Math.min(jMax, j3);
            }
            if (jMax != this.f4292) {
                this.f4292 = jMax;
                return jMax;
            }
        }
        return -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵯٴᵦ */
    public final boolean mo1670() {
        return this.f4293.mo1670();
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵳٴᵶ */
    public final void mo1671(InterfaceC1727 interfaceC1727, long j) {
        this.f4291 = interfaceC1727;
        this.f4293.mo1671(this, j);
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final boolean m3233() {
        return this.f4294 != -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵶᵷᵕ */
    public final long mo1672(long j) {
        this.f4294 = -9223372036854775807L;
        for (C3806 c3806 : this.f4295) {
            if (c3806 != null) {
                c3806.f14189 = false;
            }
        }
        long jMo1672 = this.f4293.mo1672(j);
        long j2 = this.f4290;
        long j3 = this.f4288;
        long jMax = Math.max(jMo1672, j2);
        return j3 != Long.MIN_VALUE ? Math.min(jMax, j3) : jMax;
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵸʓᵠ */
    public final boolean mo1673(C5196 c5196) {
        return this.f4293.mo1673(c5196);
    }

    @Override // defpackage.InterfaceC3757
    /* renamed from: ᵸˑ */
    public final void mo1674(long j) {
        this.f4293.mo1674(j);
    }

    @Override // defpackage.InterfaceC5211
    /* renamed from: ᵹᵝᵶ */
    public final long mo1675() {
        long jMo1675 = this.f4293.mo1675();
        if (jMo1675 != Long.MIN_VALUE) {
            long j = this.f4288;
            if (j == Long.MIN_VALUE || jMo1675 < j) {
                return jMo1675;
            }
        }
        return Long.MIN_VALUE;
    }
}
