package defpackage;

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

/* renamed from: ᵗٴˋ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2452 extends AbstractC4733 {

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

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

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

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

    public C2452(AbstractC0488 abstractC0488, long j, long j2) throws ClippingMediaSource$IllegalClippingException {
        super(abstractC0488);
        if (j2 != Long.MIN_VALUE && j2 < j) {
            throw new ClippingMediaSource$IllegalClippingException(j, 2, j2);
        }
        boolean z = false;
        if (abstractC0488.mo2128() != 1) {
            throw new ClippingMediaSource$IllegalClippingException(0);
        }
        C3254 c3254Mo2123 = abstractC0488.mo2123(0, new C3254(), 0L);
        long jMax = Math.max(0L, j);
        if (!c3254Mo2123.f12266 && jMax != 0 && !c3254Mo2123.f12257) {
            throw new ClippingMediaSource$IllegalClippingException(1);
        }
        long jMax2 = j2 == Long.MIN_VALUE ? c3254Mo2123.f12256 : Math.max(0L, j2);
        long j3 = c3254Mo2123.f12256;
        if (j3 != -9223372036854775807L) {
            jMax2 = jMax2 > j3 ? j3 : jMax2;
            if (jMax > jMax2) {
                jMax = jMax2;
            }
        }
        this.f9572 = jMax;
        this.f9573 = jMax2;
        this.f9570 = jMax2 != -9223372036854775807L ? jMax2 - jMax : -9223372036854775807L;
        if (c3254Mo2123.f12268 && (jMax2 == -9223372036854775807L || (j3 != -9223372036854775807L && jMax2 == j3))) {
            z = true;
        }
        this.f9571 = z;
    }

    @Override // defpackage.AbstractC4733, defpackage.AbstractC0488
    /* renamed from: ˏˋٴ */
    public final C4479 mo2118(int i, C4479 c4479, boolean z) {
        this.f17542.mo2118(0, c4479, z);
        long j = c4479.f16705 - this.f9572;
        long j2 = this.f9570;
        c4479.m9530(c4479.f16709, c4479.f16710, 0, j2 != -9223372036854775807L ? j2 - j : -9223372036854775807L, j, C5177.f19276, false);
        return c4479;
    }

    @Override // defpackage.AbstractC4733, defpackage.AbstractC0488
    /* renamed from: ᵯٴᵦ */
    public final C3254 mo2123(int i, C3254 c3254, long j) {
        this.f17542.mo2123(0, c3254, 0L);
        long j2 = c3254.f12264;
        long j3 = this.f9572;
        c3254.f12264 = j2 + j3;
        c3254.f12256 = this.f9570;
        c3254.f12268 = this.f9571;
        long j4 = c3254.f12267;
        if (j4 != -9223372036854775807L) {
            long jMax = Math.max(j4, j3);
            c3254.f12267 = jMax;
            long j5 = this.f9573;
            if (j5 != -9223372036854775807L) {
                jMax = Math.min(jMax, j5);
            }
            c3254.f12267 = jMax - j3;
        }
        long jM8161 = AbstractC3558.m8161(j3);
        long j6 = c3254.f12269;
        if (j6 != -9223372036854775807L) {
            c3254.f12269 = j6 + jM8161;
        }
        long j7 = c3254.f12255;
        if (j7 != -9223372036854775807L) {
            c3254.f12255 = j7 + jM8161;
        }
        return c3254;
    }
}
