package defpackage;

import androidx.media3.common.ParserException;
import java.util.Collections;

/* JADX INFO: renamed from: ᵘᵼ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2606 implements InterfaceC2750 {

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

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public int f10090;

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public long f10091;

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public int f10092;

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

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

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public String f10095;

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public long f10096;

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

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public boolean f10098;

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public int f10099;

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

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public int f10101;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public long f10102;

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public boolean f10103;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public int f10104;

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

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

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public int f10107;

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

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public int f10109;

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

    public C2606(int i, String str) {
        this.f10105 = str;
        this.f10089 = i;
        C4545 c4545 = new C4545(1024);
        this.f10097 = c4545;
        byte[] bArr = c4545.f17284;
        this.f10108 = new C3180(bArr.length, bArr);
        this.f10102 = -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2659() {
        this.f10093 = 0;
        this.f10102 = -9223372036854775807L;
        this.f10098 = false;
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵨᵣ */
    public final void mo2660(long j, int i) {
        this.f10102 = j;
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2661(C4545 c4545) throws ParserException {
        int iM7302;
        boolean zM7299;
        this.f10100.getClass();
        while (c4545.m9623() > 0) {
            int i = this.f10093;
            if (i != 0) {
                if (i != 1) {
                    C4545 c45452 = this.f10097;
                    C3180 c3180 = this.f10108;
                    if (i == 2) {
                        int iM9626 = ((this.f10107 & (-225)) << 8) | c4545.m9626();
                        this.f10104 = iM9626;
                        if (iM9626 > c45452.f17284.length) {
                            c45452.m9603(iM9626);
                            byte[] bArr = c45452.f17284;
                            c3180.getClass();
                            c3180.m7296(bArr.length, bArr);
                        }
                        this.f10109 = 0;
                        this.f10093 = 3;
                    } else {
                        if (i != 3) {
                            ᵷᵝˎ.ᵱʡˏ();
                            return;
                        }
                        int iMin = Math.min(c4545.m9623(), this.f10104 - this.f10109);
                        c4545.m9627(c3180.f12075, this.f10109, iMin);
                        int i2 = this.f10109 + iMin;
                        this.f10109 = i2;
                        if (i2 == this.f10104) {
                            c3180.m7298(0);
                            if (c3180.m7299()) {
                                if (this.f10098) {
                                }
                                this.f10093 = 0;
                            } else {
                                this.f10098 = true;
                                int iM73022 = c3180.m7302(1);
                                int iM73023 = iM73022 == 1 ? c3180.m7302(1) : 0;
                                this.f10094 = iM73023;
                                if (iM73023 != 0) {
                                    throw ParserException.m357(null, null);
                                }
                                if (iM73022 == 1) {
                                    c3180.m7302((c3180.m7302(2) + 1) * 8);
                                }
                                if (!c3180.m7299()) {
                                    throw ParserException.m357(null, null);
                                }
                                this.f10101 = c3180.m7302(6);
                                int iM73024 = c3180.m7302(4);
                                int iM73025 = c3180.m7302(3);
                                if (iM73024 != 0 || iM73025 != 0) {
                                    throw ParserException.m357(null, null);
                                }
                                if (iM73022 == 0) {
                                    int iM7301 = c3180.m7301();
                                    int iM7286 = c3180.m7286();
                                    C1260 c1260 = ᵱˉˈ.ˑˊᵲ(c3180, true);
                                    this.f10095 = c1260.f5307;
                                    this.f10090 = c1260.f5308;
                                    this.f10092 = c1260.f5306;
                                    int iM72862 = iM7286 - c3180.m7286();
                                    c3180.m7298(iM7301);
                                    byte[] bArr2 = new byte[(iM72862 + 7) / 8];
                                    c3180.m7297(iM72862, bArr2);
                                    C4753 c4753 = new C4753();
                                    c4753.f18121 = this.f10110;
                                    c4753.f18111 = AbstractC4208.m9132("video/mp2t");
                                    c4753.f18101 = AbstractC4208.m9132("audio/mp4a-latm");
                                    c4753.f18120 = this.f10095;
                                    c4753.f18090 = this.f10092;
                                    c4753.f18113 = this.f10090;
                                    c4753.f18119 = Collections.singletonList(bArr2);
                                    c4753.f18126 = this.f10105;
                                    c4753.f18129 = this.f10089;
                                    C5286 c5286 = new C5286(c4753);
                                    if (!c5286.equals(this.f10106)) {
                                        this.f10106 = c5286;
                                        this.f10096 = 1024000000 / ((long) c5286.f19966);
                                        this.f10100.mo1742(c5286);
                                    }
                                } else {
                                    int iM72863 = c3180.m7286();
                                    C1260 c12602 = ᵱˉˈ.ˑˊᵲ(c3180, true);
                                    this.f10095 = c12602.f5307;
                                    this.f10090 = c12602.f5308;
                                    this.f10092 = c12602.f5306;
                                    c3180.m7287(c3180.m7302((c3180.m7302(2) + 1) * 8) - (iM72863 - c3180.m7286()));
                                }
                                int iM73026 = c3180.m7302(3);
                                this.f10099 = iM73026;
                                if (iM73026 == 0) {
                                    c3180.m7287(8);
                                } else if (iM73026 == 1) {
                                    c3180.m7287(9);
                                } else if (iM73026 == 3 || iM73026 == 4 || iM73026 == 5) {
                                    c3180.m7287(6);
                                } else {
                                    if (iM73026 != 6 && iM73026 != 7) {
                                        ᵷᵝˎ.ᵱʡˏ();
                                        return;
                                    }
                                    c3180.m7287(1);
                                }
                                boolean zM72992 = c3180.m7299();
                                this.f10103 = zM72992;
                                this.f10091 = 0L;
                                if (zM72992) {
                                    if (iM73022 == 1) {
                                        this.f10091 = c3180.m7302((c3180.m7302(2) + 1) * 8);
                                    } else {
                                        do {
                                            zM7299 = c3180.m7299();
                                            this.f10091 = (this.f10091 << 8) + ((long) c3180.m7302(8));
                                        } while (zM7299);
                                    }
                                }
                                if (c3180.m7299()) {
                                    c3180.m7287(8);
                                }
                            }
                            if (this.f10094 != 0) {
                                throw ParserException.m357(null, null);
                            }
                            if (this.f10101 != 0) {
                                throw ParserException.m357(null, null);
                            }
                            if (this.f10099 != 0) {
                                throw ParserException.m357(null, null);
                            }
                            int i3 = 0;
                            do {
                                iM7302 = c3180.m7302(8);
                                i3 += iM7302;
                            } while (iM7302 == 255);
                            int iM73012 = c3180.m7301();
                            if ((iM73012 & 7) == 0) {
                                c45452.m9624(iM73012 >> 3);
                            } else {
                                c3180.m7297(i3 * 8, c45452.f17284);
                                c45452.m9624(0);
                            }
                            this.f10100.mo1740(i3, c45452);
                            ᵻᵪ.ˌᴵ(this.f10102 != -9223372036854775807L);
                            this.f10100.mo1741(this.f10102, 1, i3, 0, null);
                            this.f10102 += this.f10096;
                            if (this.f10103) {
                                c3180.m7287((int) this.f10091);
                            }
                            this.f10093 = 0;
                        } else {
                            continue;
                        }
                    }
                } else {
                    int iM96262 = c4545.m9626();
                    if ((iM96262 & 224) == 224) {
                        this.f10107 = iM96262;
                        this.f10093 = 2;
                    } else if (iM96262 != 86) {
                        this.f10093 = 0;
                    }
                }
            } else if (c4545.m9626() == 86) {
                this.f10093 = 1;
            }
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2662(boolean z) {
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo2663(InterfaceC4550 interfaceC4550, C4173 c4173) {
        c4173.m9112();
        c4173.m9111();
        this.f10100 = interfaceC4550.mo2743(c4173.f15928, 1);
        c4173.m9111();
        this.f10110 = c4173.f15926;
    }
}
