package defpackage;

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

/* renamed from: ᵯᵜᵻ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4289 implements InterfaceC4315 {

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

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

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

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public long f16087;

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

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public boolean f16089;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public int f16090;

    public C4289() {
        this.f16088 = 1;
        this.f16086 = new C3493(10);
        this.f16087 = -9223372036854775807L;
    }

    public C4289(List list) {
        this.f16088 = 0;
        this.f16086 = list;
        this.f16085 = new InterfaceC2154[list.size()];
        this.f16087 = -9223372036854775807L;
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˇʼʤˎ */
    public final void mo1771(long j, int i) {
        switch (this.f16088) {
            case 0:
                if ((i & 4) != 0) {
                    this.f16089 = true;
                    this.f16087 = j;
                    this.f16084 = 0;
                    this.f16090 = 2;
                    break;
                }
                break;
            default:
                if ((i & 4) != 0) {
                    this.f16089 = true;
                    this.f16087 = j;
                    this.f16090 = 0;
                    this.f16084 = 0;
                    break;
                }
                break;
        }
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ˏˋٴ */
    public final void mo1772(InterfaceC1982 interfaceC1982, C4996 c4996) {
        switch (this.f16088) {
            case 0:
                InterfaceC2154[] interfaceC2154Arr = (InterfaceC2154[]) this.f16085;
                for (int i = 0; i < interfaceC2154Arr.length; i++) {
                    C3097 c3097 = (C3097) ((List) this.f16086).get(i);
                    c4996.m10451();
                    c4996.m10452();
                    InterfaceC2154 interfaceC2154Mo4996 = interfaceC1982.mo4996(c4996.f18548, 3);
                    C2153 c2153 = new C2153();
                    c4996.m10452();
                    c2153.f8512 = c4996.f18544;
                    c2153.f8518 = AbstractC2924.m7101("video/mp2t");
                    c2153.f8516 = AbstractC2924.m7101("application/dvbsubs");
                    c2153.f8506 = Collections.singletonList(c3097.f11808);
                    c2153.f8527 = c3097.f11807;
                    AbstractC4737.m10004(c2153, interfaceC2154Mo4996);
                    interfaceC2154Arr[i] = interfaceC2154Mo4996;
                }
                break;
            default:
                c4996.m10451();
                c4996.m10452();
                InterfaceC2154 interfaceC2154Mo49962 = interfaceC1982.mo4996(c4996.f18548, 5);
                this.f16085 = interfaceC2154Mo49962;
                C2153 c21532 = new C2153();
                c4996.m10452();
                c21532.f8512 = c4996.f18544;
                c21532.f8518 = AbstractC2924.m7101("video/mp2t");
                c21532.f8516 = AbstractC2924.m7101("application/id3");
                AbstractC4737.m10004(c21532, interfaceC2154Mo49962);
                break;
        }
    }

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

    @Override // defpackage.InterfaceC4315
    /* renamed from: ᵥᵯˎ */
    public final void mo1774(C3493 c3493) {
        boolean z;
        boolean z2;
        switch (this.f16088) {
            case 0:
                if (this.f16089) {
                    if (this.f16090 == 2) {
                        if (c3493.m7959() == 0) {
                            z2 = false;
                        } else {
                            if (c3493.m7956() != 32) {
                                this.f16089 = false;
                            }
                            this.f16090--;
                            z2 = this.f16089;
                        }
                        if (!z2) {
                        }
                    }
                    if (this.f16090 == 1) {
                        if (c3493.m7959() == 0) {
                            z = false;
                        } else {
                            if (c3493.m7956() != 0) {
                                this.f16089 = false;
                            }
                            this.f16090--;
                            z = this.f16089;
                        }
                        if (!z) {
                        }
                    }
                    int i = c3493.f13083;
                    int iM7959 = c3493.m7959();
                    for (InterfaceC2154 interfaceC2154 : (InterfaceC2154[]) this.f16085) {
                        c3493.m7955(i);
                        interfaceC2154.mo4406(iM7959, c3493);
                    }
                    this.f16084 += iM7959;
                    break;
                }
                break;
            default:
                C3493 c34932 = (C3493) this.f16086;
                ((InterfaceC2154) this.f16085).getClass();
                if (this.f16089) {
                    int iM79592 = c3493.m7959();
                    int i2 = this.f16084;
                    if (i2 < 10) {
                        int iMin = Math.min(iM79592, 10 - i2);
                        System.arraycopy(c3493.f13082, c3493.f13083, c34932.f13082, this.f16084, iMin);
                        if (this.f16084 + iMin == 10) {
                            c34932.m7955(0);
                            if (73 != c34932.m7956() || 68 != c34932.m7956() || 51 != c34932.m7956()) {
                                ᵳʿˉ.ᵶʔᵢˊ("Discarding invalid ID3 tag");
                                this.f16089 = false;
                                break;
                            } else {
                                c34932.m7946(3);
                                this.f16090 = c34932.m7958() + 10;
                            }
                        }
                    }
                    int iMin2 = Math.min(iM79592, this.f16090 - this.f16084);
                    ((InterfaceC2154) this.f16085).mo4406(iMin2, c3493);
                    this.f16084 += iMin2;
                    break;
                }
                break;
        }
    }

    @Override // defpackage.InterfaceC4315
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo1775(boolean z) {
        int i;
        switch (this.f16088) {
            case 0:
                if (this.f16089) {
                    ᵛᵾˏ.ᵿʗᵝʽ(this.f16087 != -9223372036854775807L);
                    for (InterfaceC2154 interfaceC2154 : (InterfaceC2154[]) this.f16085) {
                        interfaceC2154.mo4410(this.f16087, 1, this.f16084, 0, null);
                    }
                    this.f16089 = false;
                    break;
                }
                break;
            default:
                ((InterfaceC2154) this.f16085).getClass();
                if (this.f16089 && (i = this.f16090) != 0 && this.f16084 == i) {
                    ᵛᵾˏ.ᵿʗᵝʽ(this.f16087 != -9223372036854775807L);
                    ((InterfaceC2154) this.f16085).mo4410(this.f16087, 1, this.f16090, 0, null);
                    this.f16089 = false;
                    break;
                }
                break;
        }
    }
}
