package defpackage;

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

/* JADX INFO: renamed from: ᵘᵕᵠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2573 extends AbstractC4980 {

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final long f9936;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final long f9937;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final long f9938;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final boolean f9939;

    public C2573(AbstractC4975 abstractC4975, long j, long j2) throws ClippingMediaSource$IllegalClippingException {
        super(abstractC4975);
        if (j2 != Long.MIN_VALUE && j2 < j) {
            throw new ClippingMediaSource$IllegalClippingException(j, 2, j2);
        }
        boolean z = false;
        if (abstractC4975.mo5884() != 1) {
            throw new ClippingMediaSource$IllegalClippingException(0);
        }
        C5201 c5201Mo1664 = abstractC4975.mo1664(0, new C5201(), 0L);
        long jMax = Math.max(0L, j);
        if (!c5201Mo1664.f19597 && jMax != 0 && !c5201Mo1664.f19599) {
            throw new ClippingMediaSource$IllegalClippingException(1);
        }
        long jMax2 = j2 == Long.MIN_VALUE ? c5201Mo1664.f19596 : Math.max(0L, j2);
        long j3 = c5201Mo1664.f19596;
        if (j3 != -9223372036854775807L) {
            jMax2 = jMax2 > j3 ? j3 : jMax2;
            if (jMax > jMax2) {
                jMax = jMax2;
            }
        }
        this.f9936 = jMax;
        this.f9938 = jMax2;
        this.f9937 = jMax2 != -9223372036854775807L ? jMax2 - jMax : -9223372036854775807L;
        if (c5201Mo1664.f19590 && (jMax2 == -9223372036854775807L || (j3 != -9223372036854775807L && jMax2 == j3))) {
            z = true;
        }
        this.f9939 = z;
    }

    @Override // defpackage.AbstractC4980, defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵝᵶ */
    public final C5201 mo1664(int i, C5201 c5201, long j) {
        this.f18884.mo1664(0, c5201, 0L);
        long j2 = c5201.f19595;
        long j3 = this.f9936;
        c5201.f19595 = j2 + j3;
        c5201.f19596 = this.f9937;
        c5201.f19590 = this.f9939;
        long j4 = c5201.f19600;
        if (j4 != -9223372036854775807L) {
            long jMax = Math.max(j4, j3);
            c5201.f19600 = jMax;
            long j5 = this.f9938;
            if (j5 != -9223372036854775807L) {
                jMax = Math.min(jMax, j5);
            }
            c5201.f19600 = jMax - j3;
        }
        long jM3264 = AbstractC0956.m3264(j3);
        long j6 = c5201.f19601;
        if (j6 != -9223372036854775807L) {
            c5201.f19601 = j6 + jM3264;
        }
        long j7 = c5201.f19594;
        if (j7 != -9223372036854775807L) {
            c5201.f19594 = j7 + jM3264;
        }
        return c5201;
    }

    @Override // defpackage.AbstractC4980, defpackage.AbstractC4975
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final C4593 mo1666(int i, C4593 c4593, boolean z) {
        this.f18884.mo1666(0, c4593, z);
        long j = c4593.f17477 - this.f9936;
        long j2 = this.f9937;
        c4593.m9678(c4593.f17478, c4593.f17475, 0, j2 != -9223372036854775807L ? j2 - j : -9223372036854775807L, j, C1124.f4807, false);
        return c4593;
    }
}
