package defpackage;

import j$.util.Objects;

/* renamed from: ᵫʽ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3926 implements InterfaceC4315 {

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

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

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

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

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

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

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final /* synthetic */ int f14830;

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

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

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

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

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

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public boolean f14836;

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

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

    public C3926(int i, int i2, String str, String str2) {
        this.f14830 = i2;
        switch (i2) {
            case 1:
                C4089 c4089 = new C4089(16, new byte[16]);
                this.f14834 = c4089;
                this.f14828 = new C3493(c4089.f15282);
                this.f14829 = 0;
                this.f14835 = 0;
                this.f14836 = false;
                this.f14833 = -9223372036854775807L;
                this.f14838 = str;
                this.f14824 = i;
                this.f14827 = str2;
                break;
            default:
                C4089 c40892 = new C4089(128, new byte[128]);
                this.f14834 = c40892;
                this.f14828 = new C3493(c40892.f15282);
                this.f14829 = 0;
                this.f14833 = -9223372036854775807L;
                this.f14838 = str;
                this.f14824 = i;
                this.f14827 = str2;
                break;
        }
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public C3926(String str) {
        this(0, 0, null, str);
        this.f14830 = 0;
    }

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    private final void m8723(boolean z) {
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    private final void m8724(boolean z) {
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˇʼʤˎ */
    public final void mo1771(long j, int i) {
        switch (this.f14830) {
            case 0:
                this.f14833 = j;
                break;
            default:
                this.f14833 = j;
                break;
        }
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˏˋٴ */
    public final void mo1772(InterfaceC1982 interfaceC1982, C4996 c4996) {
        switch (this.f14830) {
            case 0:
                c4996.m10451();
                c4996.m10452();
                this.f14826 = c4996.f18544;
                c4996.m10452();
                this.f14837 = interfaceC1982.mo4996(c4996.f18548, 1);
                break;
            default:
                c4996.m10451();
                c4996.m10452();
                this.f14826 = c4996.f18544;
                c4996.m10452();
                this.f14837 = interfaceC1982.mo4996(c4996.f18548, 1);
                break;
        }
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˏᵙ */
    public final void mo1773() {
        switch (this.f14830) {
            case 0:
                this.f14829 = 0;
                this.f14835 = 0;
                this.f14836 = false;
                this.f14833 = -9223372036854775807L;
                break;
            default:
                this.f14829 = 0;
                this.f14835 = 0;
                this.f14836 = false;
                this.f14833 = -9223372036854775807L;
                break;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // defpackage.InterfaceC4315
    /* renamed from: ᵥᵯˎ */
    public final void mo1774(C3493 c3493) {
        long j;
        int i = this.f14830;
        int i2 = this.f14824;
        String str = this.f14838;
        String str2 = this.f14827;
        C4089 c4089 = this.f14834;
        long j2 = -9223372036854775807L;
        int i3 = 1;
        int i4 = 2;
        C3493 c34932 = this.f14828;
        switch (i) {
            case 0:
                this.f14837.getClass();
                while (c3493.m7959() > 0) {
                    int i5 = this.f14829;
                    if (i5 == 0) {
                        while (true) {
                            if (c3493.m7959() <= 0) {
                                break;
                            }
                            if (this.f14836) {
                                int iM7956 = c3493.m7956();
                                if (iM7956 == 119) {
                                    this.f14836 = false;
                                    this.f14829 = 1;
                                    byte[] bArr = c34932.f13082;
                                    bArr[0] = 11;
                                    bArr[1] = 119;
                                    this.f14835 = 2;
                                } else {
                                    this.f14836 = iM7956 == 11;
                                }
                            } else {
                                this.f14836 = c3493.m7956() == 11;
                            }
                        }
                    } else if (i5 == 1) {
                        byte[] bArr2 = c34932.f13082;
                        int iMin = Math.min(c3493.m7959(), 128 - this.f14835);
                        c3493.m7970(bArr2, this.f14835, iMin);
                        int i6 = this.f14835 + iMin;
                        this.f14835 = i6;
                        if (i6 == 128) {
                            c4089.m8957(0);
                            C1840 c1840 = ˉᵜˆ.ᵨᵳʝ(c4089);
                            int i7 = c1840.f7449;
                            int i8 = c1840.f7452;
                            int i9 = c1840.f7453;
                            String str3 = (String) c1840.f7450;
                            C3446 c3446 = this.f14832;
                            if (c3446 == null || i9 != c3446.f12923 || i8 != c3446.f12936 || !Objects.equals(str3, c3446.f12929)) {
                                C2153 c2153 = new C2153();
                                c2153.f8512 = this.f14826;
                                c2153.f8518 = AbstractC2924.m7101(str2);
                                c2153.f8516 = AbstractC2924.m7101(str3);
                                c2153.f8517 = i9;
                                c2153.f8513 = i8;
                                c2153.f8527 = str;
                                c2153.f8497 = i2;
                                c2153.f8504 = i7;
                                if ("audio/ac3".equals(str3)) {
                                    c2153.f8525 = i7;
                                }
                                C3446 c34462 = new C3446(c2153);
                                this.f14832 = c34462;
                                this.f14837.mo4407(c34462);
                            }
                            this.f14831 = c1840.f7451;
                            this.f14825 = (c1840.f7454 * 1000000) / this.f14832.f12936;
                            c34932.m7955(0);
                            this.f14837.mo4406(128, c34932);
                            this.f14829 = 2;
                        }
                    } else if (i5 == 2) {
                        int iMin2 = Math.min(c3493.m7959(), this.f14831 - this.f14835);
                        this.f14837.mo4406(iMin2, c3493);
                        int i10 = this.f14835 + iMin2;
                        this.f14835 = i10;
                        if (i10 == this.f14831) {
                            ᵛᵾˏ.ᵿʗᵝʽ(this.f14833 != -9223372036854775807L);
                            this.f14837.mo4410(this.f14833, 1, this.f14831, 0, null);
                            this.f14833 += this.f14825;
                            this.f14829 = 0;
                        }
                    }
                }
                break;
            default:
                this.f14837.getClass();
                while (c3493.m7959() > 0) {
                    int i11 = this.f14829;
                    if (i11 != 0) {
                        if (i11 == i3) {
                            j = j2;
                            byte[] bArr3 = c34932.f13082;
                            int iMin3 = Math.min(c3493.m7959(), 16 - this.f14835);
                            c3493.m7970(bArr3, this.f14835, iMin3);
                            int i12 = this.f14835 + iMin3;
                            this.f14835 = i12;
                            if (i12 == 16) {
                                c4089.m8957(0);
                                C3889 c3889 = ᵳـᵔʤ.ᵿʗᵝʽ(c4089);
                                int i13 = c3889.f14497;
                                C3446 c34463 = this.f14832;
                                if (c34463 == null || i4 != c34463.f12923 || i13 != c34463.f12936 || !"audio/ac4".equals(c34463.f12929)) {
                                    C2153 c21532 = new C2153();
                                    c21532.f8512 = this.f14826;
                                    c21532.f8518 = AbstractC2924.m7101(str2);
                                    c21532.f8516 = AbstractC2924.m7101("audio/ac4");
                                    c21532.f8517 = i4;
                                    c21532.f8513 = i13;
                                    c21532.f8527 = str;
                                    c21532.f8497 = i2;
                                    C3446 c34464 = new C3446(c21532);
                                    this.f14832 = c34464;
                                    this.f14837.mo4407(c34464);
                                }
                                this.f14831 = c3889.f14498;
                                this.f14825 = (c3889.f14496 * 1000000) / this.f14832.f12936;
                                c34932.m7955(0);
                                this.f14837.mo4406(16, c34932);
                                this.f14829 = 2;
                            }
                        } else if (i11 == i4) {
                            int iMin4 = Math.min(c3493.m7959(), this.f14831 - this.f14835);
                            this.f14837.mo4406(iMin4, c3493);
                            int i14 = this.f14835 + iMin4;
                            this.f14835 = i14;
                            if (i14 == this.f14831) {
                                ᵛᵾˏ.ᵿʗᵝʽ(this.f14833 != j2 ? i3 : 0);
                                this.f14837.mo4410(this.f14833, 1, this.f14831, 0, null);
                                j = j2;
                                this.f14833 += this.f14825;
                                this.f14829 = 0;
                            }
                        }
                        j2 = j;
                    } else {
                        j = j2;
                        while (c3493.m7959() > 0) {
                            if (this.f14836) {
                                int iM79562 = c3493.m7956();
                                this.f14836 = iM79562 == 172;
                                if (iM79562 == 64 || iM79562 == 65) {
                                    boolean z = iM79562 == 65;
                                    this.f14829 = 1;
                                    byte[] bArr4 = c34932.f13082;
                                    bArr4[0] = -84;
                                    bArr4[1] = (byte) (z ? 65 : 64);
                                    this.f14835 = 2;
                                }
                            } else {
                                this.f14836 = c3493.m7956() == 172;
                            }
                        }
                    }
                    j2 = j;
                    i3 = 1;
                    i4 = 2;
                }
                break;
        }
    }

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