package defpackage;

import j$.util.Objects;

/* JADX INFO: renamed from: ᵢᵝᵣ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3292 implements InterfaceC2750 {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public C3292(int i, int i2, String str, String str2) {
        this.f12639 = i2;
        switch (i2) {
            case 1:
                C3180 c3180 = new C3180(16, new byte[16]);
                this.f12630 = c3180;
                this.f12633 = new C4545(c3180.f12075);
                this.f12643 = 0;
                this.f12638 = 0;
                this.f12641 = false;
                this.f12636 = -9223372036854775807L;
                this.f12642 = str;
                this.f12635 = i;
                this.f12644 = str2;
                break;
            default:
                C3180 c31802 = new C3180(128, new byte[128]);
                this.f12630 = c31802;
                this.f12633 = new C4545(c31802.f12075);
                this.f12643 = 0;
                this.f12636 = -9223372036854775807L;
                this.f12642 = str;
                this.f12635 = i;
                this.f12644 = str2;
                break;
        }
    }

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

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    private final void m7537(boolean z) {
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    private final void m7538(boolean z) {
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2659() {
        switch (this.f12639) {
            case 0:
                this.f12643 = 0;
                this.f12638 = 0;
                this.f12641 = false;
                this.f12636 = -9223372036854775807L;
                break;
            default:
                this.f12643 = 0;
                this.f12638 = 0;
                this.f12641 = false;
                this.f12636 = -9223372036854775807L;
                break;
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵨᵣ */
    public final void mo2660(long j, int i) {
        switch (this.f12639) {
            case 0:
                this.f12636 = j;
                break;
            default:
                this.f12636 = j;
                break;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2661(C4545 c4545) {
        long j;
        int i = this.f12639;
        int i2 = this.f12635;
        String str = this.f12642;
        String str2 = this.f12644;
        C3180 c3180 = this.f12630;
        long j2 = -9223372036854775807L;
        int i3 = 1;
        int i4 = 2;
        C4545 c45452 = this.f12633;
        switch (i) {
            case 0:
                this.f12631.getClass();
                while (c4545.m9623() > 0) {
                    int i5 = this.f12643;
                    if (i5 == 0) {
                        while (true) {
                            if (c4545.m9623() <= 0) {
                            }
                            if (this.f12641) {
                                int iM9626 = c4545.m9626();
                                if (iM9626 == 119) {
                                    this.f12641 = false;
                                    this.f12643 = 1;
                                    byte[] bArr = c45452.f17284;
                                    bArr[0] = 11;
                                    bArr[1] = 119;
                                    this.f12638 = 2;
                                } else {
                                    this.f12641 = iM9626 == 11;
                                }
                            } else {
                                this.f12641 = c4545.m9626() == 11;
                            }
                            break;
                        }
                    } else if (i5 == 1) {
                        byte[] bArr2 = c45452.f17284;
                        int iMin = Math.min(c4545.m9623(), 128 - this.f12638);
                        c4545.m9627(bArr2, this.f12638, iMin);
                        int i6 = this.f12638 + iMin;
                        this.f12638 = i6;
                        if (i6 == 128) {
                            c3180.m7298(0);
                            C5187 c5187 = ᵷˆᵣ.ᵶᵥᵝ(c3180);
                            int i7 = c5187.f19529;
                            int i8 = c5187.f19530;
                            int i9 = c5187.f19527;
                            String str3 = (String) c5187.f19532;
                            C5286 c5286 = this.f12634;
                            if (c5286 == null || i9 != c5286.f19984 || i8 != c5286.f19966 || !Objects.equals(str3, c5286.f19987)) {
                                C4753 c4753 = new C4753();
                                c4753.f18121 = this.f12640;
                                c4753.f18111 = AbstractC4208.m9132(str2);
                                c4753.f18101 = AbstractC4208.m9132(str3);
                                c4753.f18090 = i9;
                                c4753.f18113 = i8;
                                c4753.f18126 = str;
                                c4753.f18129 = i2;
                                c4753.f18128 = i7;
                                if ("audio/ac3".equals(str3)) {
                                    c4753.f18099 = i7;
                                }
                                C5286 c52862 = new C5286(c4753);
                                this.f12634 = c52862;
                                this.f12631.mo1742(c52862);
                            }
                            this.f12632 = c5187.f19528;
                            this.f12637 = (((long) c5187.f19531) * 1000000) / ((long) this.f12634.f19966);
                            c45452.m9624(0);
                            this.f12631.mo1740(128, c45452);
                            this.f12643 = 2;
                        }
                    } else if (i5 == 2) {
                        int iMin2 = Math.min(c4545.m9623(), this.f12632 - this.f12638);
                        this.f12631.mo1740(iMin2, c4545);
                        int i10 = this.f12638 + iMin2;
                        this.f12638 = i10;
                        if (i10 == this.f12632) {
                            ᵻᵪ.ˌᴵ(this.f12636 != -9223372036854775807L);
                            this.f12631.mo1741(this.f12636, 1, this.f12632, 0, null);
                            this.f12636 += this.f12637;
                            this.f12643 = 0;
                        }
                    }
                }
                break;
            default:
                this.f12631.getClass();
                while (c4545.m9623() > 0) {
                    int i11 = this.f12643;
                    if (i11 != 0) {
                        if (i11 == i3) {
                            j = j2;
                            byte[] bArr3 = c45452.f17284;
                            int iMin3 = Math.min(c4545.m9623(), 16 - this.f12638);
                            c4545.m9627(bArr3, this.f12638, iMin3);
                            int i12 = this.f12638 + iMin3;
                            this.f12638 = i12;
                            if (i12 == 16) {
                                c3180.m7298(0);
                                C5151 c5151 = ˑᵕʾ.ᵶˇᵱ(c3180);
                                int i13 = c5151.f19366;
                                C5286 c52863 = this.f12634;
                                if (c52863 == null || i4 != c52863.f19984 || i13 != c52863.f19966 || !"audio/ac4".equals(c52863.f19987)) {
                                    C4753 c47532 = new C4753();
                                    c47532.f18121 = this.f12640;
                                    c47532.f18111 = AbstractC4208.m9132(str2);
                                    c47532.f18101 = AbstractC4208.m9132("audio/ac4");
                                    c47532.f18090 = i4;
                                    c47532.f18113 = i13;
                                    c47532.f18126 = str;
                                    c47532.f18129 = i2;
                                    C5286 c52864 = new C5286(c47532);
                                    this.f12634 = c52864;
                                    this.f12631.mo1742(c52864);
                                }
                                this.f12632 = c5151.f19364;
                                this.f12637 = (((long) c5151.f19365) * 1000000) / ((long) this.f12634.f19966);
                                c45452.m9624(0);
                                this.f12631.mo1740(16, c45452);
                                this.f12643 = 2;
                            }
                        } else if (i11 == i4) {
                            int iMin4 = Math.min(c4545.m9623(), this.f12632 - this.f12638);
                            this.f12631.mo1740(iMin4, c4545);
                            int i14 = this.f12638 + iMin4;
                            this.f12638 = i14;
                            if (i14 == this.f12632) {
                                ᵻᵪ.ˌᴵ(this.f12636 != j2 ? i3 : 0);
                                this.f12631.mo1741(this.f12636, 1, this.f12632, 0, null);
                                j = j2;
                                this.f12636 += this.f12637;
                                this.f12643 = 0;
                            }
                        }
                        j2 = j;
                    } else {
                        j = j2;
                        while (c4545.m9623() > 0) {
                            if (this.f12641) {
                                int iM96262 = c4545.m9626();
                                this.f12641 = iM96262 == 172;
                                if (iM96262 == 64 || iM96262 == 65) {
                                    boolean z = iM96262 == 65;
                                    this.f12643 = 1;
                                    byte[] bArr4 = c45452.f17284;
                                    bArr4[0] = -84;
                                    bArr4[1] = (byte) (z ? 65 : 64);
                                    this.f12638 = 2;
                                }
                            } else {
                                this.f12641 = c4545.m9626() == 172;
                            }
                        }
                    }
                    j2 = j;
                    i3 = 1;
                    i4 = 2;
                }
                break;
        }
    }

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

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo2663(InterfaceC4550 interfaceC4550, C4173 c4173) {
        switch (this.f12639) {
            case 0:
                c4173.m9112();
                c4173.m9111();
                this.f12640 = c4173.f15926;
                c4173.m9111();
                this.f12631 = interfaceC4550.mo2743(c4173.f15928, 1);
                break;
            default:
                c4173.m9112();
                c4173.m9111();
                this.f12640 = c4173.f15926;
                c4173.m9111();
                this.f12631 = interfaceC4550.mo2743(c4173.f15928, 1);
                break;
        }
    }
}
