package defpackage;

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

/* renamed from: ᵗᵤˀ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2463 implements InterfaceC4315 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public InterfaceC2154 f9610;

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public int f9611;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public long f9612;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public C3446 f9613;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public String f9614;

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

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public int f9616;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f9617;

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public int f9618;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public boolean f9619;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final String f9620;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public String f9621;

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public long f9622;

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public int f9623;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public boolean f9624;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public int f9625;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int f9626;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public int f9627;

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public long f9628;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public int f9629;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public int f9630;

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

    public C2463(int i, String str) {
        this.f9620 = str;
        this.f9626 = i;
        C3493 c3493 = new C3493(1024);
        this.f9615 = c3493;
        byte[] bArr = c3493.f13082;
        this.f9631 = new C4089(bArr.length, bArr);
        this.f9612 = -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˇʼʤˎ */
    public final void mo1771(long j, int i) {
        this.f9612 = j;
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˏˋٴ */
    public final void mo1772(InterfaceC1982 interfaceC1982, C4996 c4996) {
        c4996.m10451();
        c4996.m10452();
        this.f9610 = interfaceC1982.mo4996(c4996.f18548, 1);
        c4996.m10452();
        this.f9614 = c4996.f18544;
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˏᵙ */
    public final void mo1773() {
        this.f9630 = 0;
        this.f9612 = -9223372036854775807L;
        this.f9624 = false;
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ᵥᵯˎ */
    public final void mo1774(C3493 c3493) throws ParserException {
        int iM8966;
        boolean zM8964;
        this.f9610.getClass();
        while (c3493.m7959() > 0) {
            int i = this.f9630;
            if (i != 0) {
                if (i != 1) {
                    C3493 c34932 = this.f9615;
                    C4089 c4089 = this.f9631;
                    if (i == 2) {
                        int iM7956 = ((this.f9629 & (-225)) << 8) | c3493.m7956();
                        this.f9627 = iM7956;
                        if (iM7956 > c34932.f13082.length) {
                            c34932.m7939(iM7956);
                            byte[] bArr = c34932.f13082;
                            c4089.getClass();
                            c4089.m8962(bArr.length, bArr);
                        }
                        this.f9617 = 0;
                        this.f9630 = 3;
                    } else {
                        if (i != 3) {
                            ᵨᴵᵺ.ˌʾˀ();
                            return;
                        }
                        int iMin = Math.min(c3493.m7959(), this.f9627 - this.f9617);
                        c3493.m7970(c4089.f15282, this.f9617, iMin);
                        int i2 = this.f9617 + iMin;
                        this.f9617 = i2;
                        if (i2 == this.f9627) {
                            c4089.m8957(0);
                            if (c4089.m8964()) {
                                if (this.f9624) {
                                }
                                this.f9630 = 0;
                            } else {
                                this.f9624 = true;
                                int iM89662 = c4089.m8966(1);
                                int iM89663 = iM89662 == 1 ? c4089.m8966(1) : 0;
                                this.f9623 = iM89663;
                                if (iM89663 != 0) {
                                    throw ParserException.m356(null, null);
                                }
                                if (iM89662 == 1) {
                                    c4089.m8966((c4089.m8966(2) + 1) * 8);
                                }
                                if (!c4089.m8964()) {
                                    throw ParserException.m356(null, null);
                                }
                                this.f9625 = c4089.m8966(6);
                                int iM89664 = c4089.m8966(4);
                                int iM89665 = c4089.m8966(3);
                                if (iM89664 != 0 || iM89665 != 0) {
                                    throw ParserException.m356(null, null);
                                }
                                if (iM89662 == 0) {
                                    int iM8951 = c4089.m8951();
                                    int iM8963 = c4089.m8963();
                                    C5092 c5092 = ˊˉʤﹳ.ᵙᵢᵨᵳ(c4089, true);
                                    this.f9621 = c5092.f19026;
                                    this.f9618 = c5092.f19027;
                                    this.f9616 = c5092.f19028;
                                    int iM89632 = iM8963 - c4089.m8963();
                                    c4089.m8957(iM8951);
                                    byte[] bArr2 = new byte[(iM89632 + 7) / 8];
                                    c4089.m8950(iM89632, bArr2);
                                    C2153 c2153 = new C2153();
                                    c2153.f8512 = this.f9614;
                                    c2153.f8518 = AbstractC2924.m7101("video/mp2t");
                                    c2153.f8516 = AbstractC2924.m7101("audio/mp4a-latm");
                                    c2153.f8522 = this.f9621;
                                    c2153.f8517 = this.f9616;
                                    c2153.f8513 = this.f9618;
                                    c2153.f8506 = Collections.singletonList(bArr2);
                                    c2153.f8527 = this.f9620;
                                    c2153.f8497 = this.f9626;
                                    C3446 c3446 = new C3446(c2153);
                                    if (!c3446.equals(this.f9613)) {
                                        this.f9613 = c3446;
                                        this.f9622 = 1024000000 / c3446.f12936;
                                        this.f9610.mo4407(c3446);
                                    }
                                } else {
                                    int iM89633 = c4089.m8963();
                                    C5092 c50922 = ˊˉʤﹳ.ᵙᵢᵨᵳ(c4089, true);
                                    this.f9621 = c50922.f19026;
                                    this.f9618 = c50922.f19027;
                                    this.f9616 = c50922.f19028;
                                    c4089.m8956(c4089.m8966((c4089.m8966(2) + 1) * 8) - (iM89633 - c4089.m8963()));
                                }
                                int iM89666 = c4089.m8966(3);
                                this.f9611 = iM89666;
                                if (iM89666 == 0) {
                                    c4089.m8956(8);
                                } else if (iM89666 == 1) {
                                    c4089.m8956(9);
                                } else if (iM89666 == 3 || iM89666 == 4 || iM89666 == 5) {
                                    c4089.m8956(6);
                                } else {
                                    if (iM89666 != 6 && iM89666 != 7) {
                                        ᵨᴵᵺ.ˌʾˀ();
                                        return;
                                    }
                                    c4089.m8956(1);
                                }
                                boolean zM89642 = c4089.m8964();
                                this.f9619 = zM89642;
                                this.f9628 = 0L;
                                if (zM89642) {
                                    if (iM89662 == 1) {
                                        this.f9628 = c4089.m8966((c4089.m8966(2) + 1) * 8);
                                    } else {
                                        do {
                                            zM8964 = c4089.m8964();
                                            this.f9628 = (this.f9628 << 8) + c4089.m8966(8);
                                        } while (zM8964);
                                    }
                                }
                                if (c4089.m8964()) {
                                    c4089.m8956(8);
                                }
                            }
                            if (this.f9623 != 0) {
                                throw ParserException.m356(null, null);
                            }
                            if (this.f9625 != 0) {
                                throw ParserException.m356(null, null);
                            }
                            if (this.f9611 != 0) {
                                throw ParserException.m356(null, null);
                            }
                            int i3 = 0;
                            do {
                                iM8966 = c4089.m8966(8);
                                i3 += iM8966;
                            } while (iM8966 == 255);
                            int iM89512 = c4089.m8951();
                            if ((iM89512 & 7) == 0) {
                                c34932.m7955(iM89512 >> 3);
                            } else {
                                c4089.m8950(i3 * 8, c34932.f13082);
                                c34932.m7955(0);
                            }
                            this.f9610.mo4406(i3, c34932);
                            ᵛᵾˏ.ᵿʗᵝʽ(this.f9612 != -9223372036854775807L);
                            this.f9610.mo4410(this.f9612, 1, i3, 0, null);
                            this.f9612 += this.f9622;
                            if (this.f9619) {
                                c4089.m8956((int) this.f9628);
                            }
                            this.f9630 = 0;
                        } else {
                            continue;
                        }
                    }
                } else {
                    int iM79562 = c3493.m7956();
                    if ((iM79562 & 224) == 224) {
                        this.f9629 = iM79562;
                        this.f9630 = 2;
                    } else if (iM79562 != 86) {
                        this.f9630 = 0;
                    }
                }
            } else if (c3493.m7956() == 86) {
                this.f9630 = 1;
            }
        }
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo1775(boolean z) {
    }
}
