package defpackage;

import androidx.media3.common.ParserException;

/* JADX INFO: renamed from: ˋʿᵨ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1459 implements InterfaceC0728 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final int f5926;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public long f5927;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public InterfaceC5226 f5928;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public int f5929;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C3176 f5930;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public long f5931;

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

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public int f5933;

    public C1459(C3176 c3176) {
        this.f5930 = c3176;
        try {
            this.f5926 = m4182(c3176.f12060);
            this.f5932 = -9223372036854775807L;
            this.f5929 = -1;
            this.f5933 = 0;
            this.f5931 = 0L;
            this.f5927 = -9223372036854775807L;
        } catch (ParserException e) {
            throw new IllegalArgumentException(e);
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static int m4182(AbstractC3409 abstractC3409) throws ParserException {
        String str = (String) abstractC3409.get("config");
        int i = 0;
        i = 0;
        if (str != null && str.length() % 2 == 0) {
            byte[] bArrM3233 = AbstractC0956.m3233(str);
            C3180 c3180 = new C3180(bArrM3233.length, bArrM3233);
            int iM7302 = c3180.m7302(1);
            if (iM7302 != 0) {
                throw new ParserException(AbstractC2704.m6517(iM7302, "unsupported audio mux version: "), null, true, 0);
            }
            ᵻᵪ.ᵻʽᵯ("Only supports allStreamsSameTimeFraming.", c3180.m7302(1) == 1);
            int iM73022 = c3180.m7302(6);
            ᵻᵪ.ᵻʽᵯ("Only suppors one program.", c3180.m7302(4) == 0);
            ᵻᵪ.ᵻʽᵯ("Only suppors one layer.", c3180.m7302(3) == 0);
            i = iM73022;
        }
        return i + 1;
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ʽˈˋ */
    public final void mo2599(long j, long j2) {
        this.f5932 = j;
        this.f5933 = 0;
        this.f5931 = j2;
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2600(InterfaceC4550 interfaceC4550, int i) {
        InterfaceC5226 interfaceC5226Mo2743 = interfaceC4550.mo2743(i, 2);
        this.f5928 = interfaceC5226Mo2743;
        String str = AbstractC0956.f4222;
        interfaceC5226Mo2743.mo1742(this.f5930.f12057);
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2601(long j) {
        ᵻᵪ.ˌᴵ(this.f5932 == -9223372036854775807L);
        this.f5932 = j;
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2602(C4545 c4545, long j, int i, boolean z) {
        this.f5928.getClass();
        int iM10653 = C5141.m10653(this.f5929);
        if (this.f5933 > 0 && iM10653 < i) {
            InterfaceC5226 interfaceC5226 = this.f5928;
            interfaceC5226.getClass();
            interfaceC5226.mo1741(this.f5927, 1, this.f5933, 0, null);
            this.f5933 = 0;
            this.f5927 = -9223372036854775807L;
        }
        for (int i2 = 0; i2 < this.f5926; i2++) {
            int i3 = 0;
            while (c4545.f17282 < c4545.f17283) {
                int iM9626 = c4545.m9626();
                i3 += iM9626;
                if (iM9626 != 255) {
                    break;
                }
            }
            this.f5928.mo1740(i3, c4545);
            this.f5933 += i3;
        }
        this.f5927 = ᵸᵺᵜ.ˁˌᵩ(this.f5930.f12056, this.f5931, j, this.f5932);
        if (z) {
            InterfaceC5226 interfaceC52262 = this.f5928;
            interfaceC52262.getClass();
            interfaceC52262.mo1741(this.f5927, 1, this.f5933, 0, null);
            this.f5933 = 0;
            this.f5927 = -9223372036854775807L;
        }
        this.f5929 = i;
    }
}
