package defpackage;

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

/* renamed from: ᵤˑᵗ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3424 extends AbstractC0114 {

    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public List f12742;

    /* renamed from: ˑᵱ, reason: contains not printable characters */
    public byte f12744;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final int f12745;

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public boolean f12746;

    /* renamed from: ᵡʠ, reason: contains not printable characters */
    public int f12747;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public byte f12749;

    /* renamed from: ᵨᵳʝ, reason: contains not printable characters */
    public boolean f12750;

    /* renamed from: ᵳٴᵶ, reason: contains not printable characters */
    public List f12753;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public final int f12754;

    /* renamed from: ᵸʓᵠ, reason: contains not printable characters */
    public int f12755;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final int f12756;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public long f12758;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public boolean f12759;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final int[] f12739 = {11, 1, 3, 12, 14, 5, 7, 9};

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public static final int[] f12738 = {0, 4, 8, 12, 16, 20, 24, 28};

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public static final int[] f12734 = {-1, -16711936, -16776961, -16711681, -65536, -256, -65281};

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public static final int[] f12737 = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 225, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 233, 93, 237, 243, 250, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 231, 247, 209, 241, 9632};

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public static final int[] f12736 = {174, 176, 189, 191, 8482, 162, 163, 9834, 224, 32, 232, 226, 234, 238, 244, 251};

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public static final int[] f12735 = {193, 201, 211, 218, 220, 252, 8216, 161, 42, 39, 8212, 169, 8480, 8226, 8220, 8221, 192, 194, 199, 200, 202, 203, 235, 206, 207, 239, 212, 217, 249, 219, 171, 187};

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public static final int[] f12741 = {195, 227, 205, 204, 236, 210, 242, 213, 245, 123, 125, 92, 94, 95, 124, 126, 196, 228, 214, 246, 223, 165, 164, 9474, 197, 229, 216, 248, 9484, 9488, 9492, 9496};

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public static final boolean[] f12740 = {false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false, false, true, true, false, true, false, false, true, false, true, true, false, true, false, false, true, true, false, false, true, false, true, true, false};

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final C3493 f12757 = new C3493();

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final ArrayList f12752 = new ArrayList();

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public C3278 f12751 = new C3278(0, 4);

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public int f12748 = 0;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final long f12743 = 16000000;

    public C3424(int i, String str) {
        this.f12745 = "application/x-mp4-cea-608".equals(str) ? 2 : 3;
        if (i == 1) {
            this.f12756 = 0;
            this.f12754 = 0;
        } else if (i == 2) {
            this.f12756 = 1;
            this.f12754 = 0;
        } else if (i == 3) {
            this.f12756 = 0;
            this.f12754 = 1;
        } else if (i != 4) {
            ᵳʿˉ.ᵶʔᵢˊ("Invalid channel. Defaulting to CC1.");
            this.f12756 = 0;
            this.f12754 = 0;
        } else {
            this.f12756 = 1;
            this.f12754 = 1;
        }
        m7792(0);
        m7791();
        this.f12759 = true;
        this.f12758 = -9223372036854775807L;
    }

    @Override // defpackage.AbstractC0114, defpackage.InterfaceC3574
    public final void flush() {
        super.flush();
        this.f12753 = null;
        this.f12742 = null;
        m7792(0);
        this.f12755 = 4;
        this.f12751.f12313 = 4;
        m7791();
        this.f12746 = false;
        this.f12750 = false;
        this.f12744 = (byte) 0;
        this.f12749 = (byte) 0;
        this.f12748 = 0;
        this.f12759 = true;
        this.f12758 = -9223372036854775807L;
    }

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public final void m7791() {
        C3278 c3278 = this.f12751;
        c3278.f12308 = this.f12747;
        c3278.f12311.clear();
        c3278.f12312.clear();
        c3278.f12310.setLength(0);
        c3278.f12314 = 15;
        c3278.f12307 = 0;
        c3278.f12309 = 0;
        ArrayList arrayList = this.f12752;
        arrayList.clear();
        arrayList.add(this.f12751);
    }

    @Override // defpackage.AbstractC0114
    /* renamed from: ˎˏʜʾ */
    public final C0410 mo1215() {
        List list = this.f12753;
        this.f12742 = list;
        list.getClass();
        return new C0410(list);
    }

    @Override // defpackage.AbstractC0114, defpackage.InterfaceC3574
    /* renamed from: ᵝᵵᵺ */
    public final AbstractC2880 mo1222() {
        AbstractC2880 abstractC2880;
        AbstractC2880 abstractC2880Mo1222 = super.mo1222();
        if (abstractC2880Mo1222 != null) {
            return abstractC2880Mo1222;
        }
        long j = this.f12743;
        if (j == -9223372036854775807L) {
            return null;
        }
        long j2 = this.f12758;
        if (j2 == -9223372036854775807L || this.f1419 - j2 < j || (abstractC2880 = (AbstractC2880) this.f1424.pollFirst()) == null) {
            return null;
        }
        this.f12753 = Collections.EMPTY_LIST;
        this.f12758 = -9223372036854775807L;
        C0410 c0410Mo1215 = mo1215();
        long j3 = this.f1419;
        abstractC2880.f2897 = j3;
        abstractC2880.f11148 = c0410Mo1215;
        abstractC2880.f11147 = j3;
        return abstractC2880;
    }

    @Override // defpackage.AbstractC0114, defpackage.InterfaceC3574
    /* renamed from: ᵥᵯˎ */
    public final void mo364() {
    }

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void m7792(int i) {
        int i2 = this.f12747;
        if (i2 == i) {
            return;
        }
        this.f12747 = i;
        if (i != 3) {
            m7791();
            if (i2 == 3 || i == 1 || i == 0) {
                this.f12753 = Collections.EMPTY_LIST;
                return;
            }
            return;
        }
        int i3 = 0;
        while (true) {
            ArrayList arrayList = this.f12752;
            if (i3 >= arrayList.size()) {
                return;
            }
            ((C3278) arrayList.get(i3)).f12308 = i;
            i3++;
        }
    }

    @Override // defpackage.AbstractC0114
    /* renamed from: ᵶᵷᵕ */
    public final boolean mo1220() {
        return this.f12753 != this.f12742;
    }

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public final ArrayList m7793() {
        ArrayList arrayList = this.f12752;
        int size = arrayList.size();
        ArrayList arrayList2 = new ArrayList(size);
        int iMin = 2;
        for (int i = 0; i < size; i++) {
            C0551 c0551M7656 = ((C3278) arrayList.get(i)).m7656(Integer.MIN_VALUE);
            arrayList2.add(c0551M7656);
            if (c0551M7656 != null) {
                iMin = Math.min(iMin, c0551M7656.f2880);
            }
        }
        ArrayList arrayList3 = new ArrayList(size);
        for (int i2 = 0; i2 < size; i2++) {
            C0551 c0551M76562 = (C0551) arrayList2.get(i2);
            if (c0551M76562 != null) {
                if (c0551M76562.f2880 != iMin) {
                    c0551M76562 = ((C3278) arrayList.get(i2)).m7656(iMin);
                    c0551M76562.getClass();
                }
                arrayList3.add(c0551M76562);
            }
        }
        return arrayList3;
    }

    /* JADX WARN: Removed duplicated region for block: B:179:0x0085 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:181:0x007e A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:26:0x0059  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x00a6 A[FALL_THROUGH] */
    @Override // defpackage.AbstractC0114
    /* renamed from: ᵹᵝᵶ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void mo1221(defpackage.C1647 r15) {
        /*
            Method dump skipped, instructions count: 678
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C3424.mo1221(ˌᵲᵷ):void");
    }
}
