package p138.p176.p177.p190.p198.p207;

import java.util.Collections;
import java.util.List;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.p194.C3526;
import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.InterfaceC3575;
import p138.p176.p177.p190.p198.p207.InterfaceC3690;
import p138.p176.p177.p190.p239.C4140;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޝ.ކ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3659 implements InterfaceC3660 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final List<InterfaceC3690.C3691> f11139;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final InterfaceC3575[] f11140;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public boolean f11141;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int f11142;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public int f11143;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public long f11144;

    public C3659(List<InterfaceC3690.C3691> list) {
        this.f11139 = list;
        this.f11140 = new InterfaceC3575[list.size()];
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5997() {
        this.f11141 = false;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5998(long j, int i) {
        if ((i & 4) == 0) {
            return;
        }
        this.f11141 = true;
        this.f11144 = j;
        this.f11143 = 0;
        this.f11142 = 2;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5999(InterfaceC3562 interfaceC3562, InterfaceC3690.C3694 c3694) {
        for (int i = 0; i < this.f11140.length; i++) {
            InterfaceC3690.C3691 c3691 = this.f11139.get(i);
            c3694.m6035();
            InterfaceC3575 interfaceC3575Mo5891 = interfaceC3562.mo5891(c3694.m6037(), 3);
            interfaceC3575Mo5891.mo5884(C3431.m5588(c3694.m6036(), "application/dvbsubs", (String) null, -1, 0, (List<byte[]>) Collections.singletonList(c3691.f11375), c3691.f11374, (C3526) null));
            this.f11140[i] = interfaceC3575Mo5891;
        }
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo6000(C4140 c4140) {
        if (this.f11141) {
            if (this.f11142 != 2 || m6011(c4140, 32)) {
                if (this.f11142 != 1 || m6011(c4140, 0)) {
                    int i = c4140.f13228;
                    int iM6679 = c4140.m6679();
                    for (InterfaceC3575 interfaceC3575 : this.f11140) {
                        c4140.m6693(i);
                        interfaceC3575.mo5885(c4140, iM6679);
                    }
                    this.f11143 += iM6679;
                }
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final boolean m6011(C4140 c4140, int i) {
        if (c4140.m6679() == 0) {
            return false;
        }
        if (c4140.m6702() != i) {
            this.f11141 = false;
        }
        this.f11142--;
        return this.f11141;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ؠ */
    public void mo6001() {
        if (this.f11141) {
            for (InterfaceC3575 interfaceC3575 : this.f11140) {
                interfaceC3575.mo5883(this.f11144, 1, this.f11143, 0, null);
            }
            this.f11141 = false;
        }
    }
}
