package defpackage;

import java.util.Collections;
import java.util.List;

/* JADX INFO: renamed from: ˉᵛˇ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1219 implements InterfaceC2750 {

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

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

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

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

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

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

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

    public C1219() {
        this.f5168 = 1;
        this.f5171 = new C4545(10);
        this.f5166 = -9223372036854775807L;
    }

    public C1219(List list) {
        this.f5168 = 0;
        this.f5171 = list;
        this.f5169 = new InterfaceC5226[list.size()];
        this.f5166 = -9223372036854775807L;
    }

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

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵨᵣ */
    public final void mo2660(long j, int i) {
        switch (this.f5168) {
            case 0:
                if ((i & 4) != 0) {
                    this.f5165 = true;
                    this.f5166 = j;
                    this.f5167 = 0;
                    this.f5170 = 2;
                    break;
                }
                break;
            default:
                if ((i & 4) != 0) {
                    this.f5165 = true;
                    this.f5166 = j;
                    this.f5170 = 0;
                    this.f5167 = 0;
                    break;
                }
                break;
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2661(C4545 c4545) {
        boolean z;
        boolean z2;
        switch (this.f5168) {
            case 0:
                if (this.f5165) {
                    if (this.f5170 == 2) {
                        if (c4545.m9623() == 0) {
                            z2 = false;
                        } else {
                            if (c4545.m9626() != 32) {
                                this.f5165 = false;
                            }
                            this.f5170--;
                            z2 = this.f5165;
                        }
                        if (!z2) {
                        }
                    }
                    if (this.f5170 == 1) {
                        if (c4545.m9623() == 0) {
                            z = false;
                        } else {
                            if (c4545.m9626() != 0) {
                                this.f5165 = false;
                            }
                            this.f5170--;
                            z = this.f5165;
                        }
                        if (!z) {
                        }
                    }
                    int i = c4545.f17282;
                    int iM9623 = c4545.m9623();
                    for (InterfaceC5226 interfaceC5226 : (InterfaceC5226[]) this.f5169) {
                        c4545.m9624(i);
                        interfaceC5226.mo1740(iM9623, c4545);
                    }
                    this.f5167 += iM9623;
                }
                break;
            default:
                C4545 c45452 = (C4545) this.f5171;
                ((InterfaceC5226) this.f5169).getClass();
                if (this.f5165) {
                    int iM96232 = c4545.m9623();
                    int i2 = this.f5167;
                    if (i2 < 10) {
                        int iMin = Math.min(iM96232, 10 - i2);
                        System.arraycopy(c4545.f17284, c4545.f17282, c45452.f17284, this.f5167, iMin);
                        if (this.f5167 + iMin == 10) {
                            c45452.m9624(0);
                            if (73 == c45452.m9626() && 68 == c45452.m9626() && 51 == c45452.m9626()) {
                                c45452.m9609(3);
                                this.f5170 = c45452.m9620() + 10;
                            } else {
                                ˋˀᵧ.ʿٴˇ("Discarding invalid ID3 tag");
                                this.f5165 = false;
                            }
                        }
                    }
                    int iMin2 = Math.min(iM96232, this.f5170 - this.f5167);
                    ((InterfaceC5226) this.f5169).mo1740(iMin2, c4545);
                    this.f5167 += iMin2;
                    break;
                }
                break;
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2662(boolean z) {
        int i;
        switch (this.f5168) {
            case 0:
                if (this.f5165) {
                    ᵻᵪ.ˌᴵ(this.f5166 != -9223372036854775807L);
                    for (InterfaceC5226 interfaceC5226 : (InterfaceC5226[]) this.f5169) {
                        interfaceC5226.mo1741(this.f5166, 1, this.f5167, 0, null);
                    }
                    this.f5165 = false;
                }
                break;
            default:
                ((InterfaceC5226) this.f5169).getClass();
                if (this.f5165 && (i = this.f5170) != 0 && this.f5167 == i) {
                    ᵻᵪ.ˌᴵ(this.f5166 != -9223372036854775807L);
                    ((InterfaceC5226) this.f5169).mo1741(this.f5166, 1, this.f5170, 0, null);
                    this.f5165 = false;
                    break;
                }
                break;
        }
    }

    @Override // defpackage.InterfaceC2750
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo2663(InterfaceC4550 interfaceC4550, C4173 c4173) {
        switch (this.f5168) {
            case 0:
                InterfaceC5226[] interfaceC5226Arr = (InterfaceC5226[]) this.f5169;
                for (int i = 0; i < interfaceC5226Arr.length; i++) {
                    C3288 c3288 = (C3288) ((List) this.f5171).get(i);
                    c4173.m9112();
                    c4173.m9111();
                    InterfaceC5226 interfaceC5226Mo2743 = interfaceC4550.mo2743(c4173.f15928, 3);
                    C4753 c4753 = new C4753();
                    c4173.m9111();
                    c4753.f18121 = c4173.f15926;
                    c4753.f18111 = AbstractC4208.m9132("video/mp2t");
                    c4753.f18101 = AbstractC4208.m9132("application/dvbsubs");
                    c4753.f18119 = Collections.singletonList(c3288.f12613);
                    c4753.f18126 = c3288.f12614;
                    AbstractC0659.m2415(c4753, interfaceC5226Mo2743);
                    interfaceC5226Arr[i] = interfaceC5226Mo2743;
                }
                break;
            default:
                c4173.m9112();
                c4173.m9111();
                InterfaceC5226 interfaceC5226Mo27432 = interfaceC4550.mo2743(c4173.f15928, 5);
                this.f5169 = interfaceC5226Mo27432;
                C4753 c47532 = new C4753();
                c4173.m9111();
                c47532.f18121 = c4173.f15926;
                c47532.f18111 = AbstractC4208.m9132("video/mp2t");
                c47532.f18101 = AbstractC4208.m9132("application/id3");
                AbstractC0659.m2415(c47532, interfaceC5226Mo27432);
                break;
        }
    }
}
