package defpackage;

import java.util.Collections;

/* JADX INFO: renamed from: ˏᵹˀ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1924 implements InterfaceC2750 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public String f7653;

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

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

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

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

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

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final boolean[] f7666 = new boolean[3];

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final C4048 f7662 = new C4048(32);

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final C4048 f7654 = new C4048(33);

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public final C4048 f7665 = new C4048(34);

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public final C4048 f7660 = new C4048(39);

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final C4048 f7663 = new C4048(40);

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public long f7657 = -9223372036854775807L;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final C4545 f7655 = new C4545();

    public C1924(C3735 c3735) {
        this.f7661 = c3735;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m5159(int i, int i2, long j, long j2) {
        C4132 c4132 = this.f7661.f14178;
        C3273 c3273 = this.f7664;
        boolean z = this.f7658;
        if (c3273.f12546 && c3273.f12548) {
            c3273.f12543 = c3273.f12542;
            c3273.f12546 = false;
        } else if (c3273.f12541 || c3273.f12548) {
            if (z && c3273.f12551) {
                c3273.m7508(i + ((int) (j - c3273.f12540)));
            }
            c3273.f12549 = c3273.f12540;
            c3273.f12545 = c3273.f12544;
            c3273.f12543 = c3273.f12542;
            c3273.f12551 = true;
        }
        if (!this.f7658) {
            C4048 c4048 = this.f7662;
            c4048.m8857(i2);
            C4048 c40482 = this.f7654;
            c40482.m8857(i2);
            C4048 c40483 = this.f7665;
            c40483.m8857(i2);
            if (c4048.f15538 && c40482.f15538 && c40483.f15538) {
                String str = this.f7653;
                int i3 = c4048.f15537;
                byte[] bArr = new byte[c40482.f15537 + i3 + c40483.f15537];
                System.arraycopy((byte[]) c4048.f15541, 0, bArr, 0, i3);
                System.arraycopy((byte[]) c40482.f15541, 0, bArr, c4048.f15537, c40482.f15537);
                System.arraycopy((byte[]) c40483.f15541, 0, bArr, c4048.f15537 + c40482.f15537, c40483.f15537);
                C2782 c2782 = ᵥˇᵛˎ.ʿᵿʽᵞ((byte[]) c40482.f15541, 3, c40482.f15537, (ᵥᵵᵶᵩ) null);
                C1238 c1238 = c2782.f10709;
                String strM5108 = c1238 != null ? AbstractC1879.m5108(c1238.f5216, c1238.f5213, c1238.f5214, c1238.f5217, c1238.f5215, c1238.f5218) : null;
                C4753 c4753 = new C4753();
                c4753.f18121 = str;
                c4753.f18111 = AbstractC4208.m9132("video/mp2t");
                c4753.f18101 = AbstractC4208.m9132("video/hevc");
                c4753.f18120 = strM5108;
                c4753.f18098 = c2782.f10713;
                c4753.f18102 = c2782.f10721;
                c4753.f18110 = c2782.f10717;
                c4753.f18108 = c2782.f10710;
                c4753.f18127 = new C3281(c2782.f10718, c2782.f10714, c2782.f10712, null, c2782.f10711 + 8, c2782.f10719 + 8);
                c4753.f18124 = c2782.f10720;
                c4753.f18112 = c2782.f10715;
                c4753.f18107 = c2782.f10716 + 1;
                c4753.f18119 = Collections.singletonList(bArr);
                C5286 c5286 = new C5286(c4753);
                this.f7656.mo1742(c5286);
                int i4 = c5286.f19990;
                ᵻᵪ.ˌᴵ(i4 != -1);
                c4132.m9042(i4);
                this.f7658 = true;
            }
        }
        C4048 c40484 = this.f7660;
        boolean zM8857 = c40484.m8857(i2);
        C4545 c4545 = this.f7655;
        if (zM8857) {
            c4545.m9600(ᵥˇᵛˎ.ᵚᵹᵔᵜ(c40484.f15537, (byte[]) c40484.f15541), (byte[]) c40484.f15541);
            c4545.m9609(5);
            c4132.m9056(j2, c4545);
        }
        C4048 c40485 = this.f7663;
        if (c40485.m8857(i2)) {
            c4545.m9600(ᵥˇᵛˎ.ᵚᵹᵔᵜ(c40485.f15537, (byte[]) c40485.f15541), (byte[]) c40485.f15541);
            c4545.m9609(5);
            c4132.m9056(j2, c4545);
        }
    }

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public final void m5160(int i, int i2, long j, long j2) {
        C3273 c3273 = this.f7664;
        boolean z = this.f7658;
        c3273.f12548 = false;
        c3273.f12541 = false;
        c3273.f12544 = j2;
        c3273.f12550 = 0;
        c3273.f12540 = j;
        if (i2 >= 32 && i2 != 40) {
            if (c3273.f12551 && !c3273.f12546) {
                if (z) {
                    c3273.m7508(i);
                }
                c3273.f12551 = false;
            }
            if ((32 <= i2 && i2 <= 35) || i2 == 39) {
                c3273.f12541 = !c3273.f12546;
                c3273.f12546 = true;
            }
        }
        boolean z2 = i2 >= 16 && i2 <= 21;
        c3273.f12542 = z2;
        c3273.f12552 = z2 || i2 <= 9;
        if (!this.f7658) {
            this.f7662.m8856(i2);
            this.f7654.m8856(i2);
            this.f7665.m8856(i2);
        }
        this.f7660.m8856(i2);
        this.f7663.m8856(i2);
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2659() {
        this.f7659 = 0L;
        this.f7657 = -9223372036854775807L;
        ᵥˇᵛˎ.ᵨᵣ(this.f7666);
        this.f7662.m8858();
        this.f7654.m8858();
        this.f7665.m8858();
        this.f7660.m8858();
        this.f7663.m8858();
        this.f7661.f14178.m9060(0);
        C3273 c3273 = this.f7664;
        if (c3273 != null) {
            c3273.f12552 = false;
            c3273.f12548 = false;
            c3273.f12541 = false;
            c3273.f12551 = false;
            c3273.f12546 = false;
        }
    }

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

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2661(C4545 c4545) {
        int i;
        this.f7656.getClass();
        String str = AbstractC0956.f4222;
        while (c4545.m9623() > 0) {
            int i2 = c4545.f17282;
            int i3 = c4545.f17283;
            byte[] bArr = c4545.f17284;
            this.f7659 += (long) c4545.m9623();
            this.f7656.mo1740(c4545.m9623(), c4545);
            while (i2 < i3) {
                int i4 = ᵥˇᵛˎ.ˊᵨᵧ(bArr, i2, i3, this.f7666);
                if (i4 == i3) {
                    m5161(bArr, i2, i3);
                    return;
                }
                int i5 = (bArr[i4 + 3] & 126) >> 1;
                if (i4 <= 0 || bArr[i4 - 1] != 0) {
                    i = 3;
                } else {
                    i4--;
                    i = 4;
                }
                int i6 = i4;
                int i7 = i;
                int i8 = i6 - i2;
                if (i8 > 0) {
                    m5161(bArr, i2, i6);
                }
                int i9 = i3 - i6;
                long j = this.f7659 - ((long) i9);
                m5159(i9, i8 < 0 ? -i8 : 0, j, this.f7657);
                m5160(i9, i5, j, this.f7657);
                i2 = i6 + i7;
            }
        }
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final void m5161(byte[] bArr, int i, int i2) {
        C3273 c3273 = this.f7664;
        if (c3273.f12552) {
            int i3 = c3273.f12550;
            int i4 = (i + 2) - i3;
            if (i4 < i2) {
                c3273.f12548 = (bArr[i4] & 128) != 0;
                c3273.f12552 = false;
            } else {
                c3273.f12550 = (i2 - i) + i3;
            }
        }
        if (!this.f7658) {
            this.f7662.m8855(bArr, i, i2);
            this.f7654.m8855(bArr, i, i2);
            this.f7665.m8855(bArr, i, i2);
        }
        this.f7660.m8855(bArr, i, i2);
        this.f7663.m8855(bArr, i, i2);
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2662(boolean z) {
        this.f7656.getClass();
        String str = AbstractC0956.f4222;
        if (z) {
            this.f7661.f14178.m9060(0);
            m5159(0, 0, this.f7659, this.f7657);
            m5160(0, 48, this.f7659, this.f7657);
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo2663(InterfaceC4550 interfaceC4550, C4173 c4173) {
        c4173.m9112();
        c4173.m9111();
        this.f7653 = c4173.f15926;
        c4173.m9111();
        InterfaceC5226 interfaceC5226Mo2743 = interfaceC4550.mo2743(c4173.f15928, 2);
        this.f7656 = interfaceC5226Mo2743;
        this.f7664 = new C3273(interfaceC5226Mo2743);
        this.f7661.m8404(interfaceC4550, c4173);
    }
}
