package p138.p176.p177.p190.p217.p219;

import android.util.SparseArray;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.p198.C3558;
import p138.p176.p177.p190.p198.C3560;
import p138.p176.p177.p190.p198.InterfaceC3561;
import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.InterfaceC3571;
import p138.p176.p177.p190.p198.InterfaceC3575;
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 C3837 implements InterfaceC3562 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final InterfaceC3561 f11813;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final int f11814;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final C3431 f11815;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final SparseArray<C3838> f11816 = new SparseArray<>();

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

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public InterfaceC3839 f11818;

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

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public InterfaceC3571 f11820;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public C3431[] f11821;

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޝ.ނ$֏, reason: contains not printable characters */
    public static final class C3838 implements InterfaceC3575 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final int f11822;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final int f11823;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final C3431 f11824;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public final C3560 f11825 = new C3560();

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

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

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

        public C3838(int i, int i2, C3431 c3431) {
            this.f11822 = i;
            this.f11823 = i2;
            this.f11824 = c3431;
        }

        @Override // p138.p176.p177.p190.p198.InterfaceC3575
        /* JADX INFO: renamed from: ֏ */
        public int mo5882(C3558 c3558, int i, boolean z) {
            return this.f11827.mo5882(c3558, i, z);
        }

        @Override // p138.p176.p177.p190.p198.InterfaceC3575
        /* JADX INFO: renamed from: ֏ */
        public void mo5883(long j, int i, int i2, int i3, InterfaceC3575.C3576 c3576) {
            long j2 = this.f11828;
            if (j2 != -9223372036854775807L && j >= j2) {
                this.f11827 = this.f11825;
            }
            this.f11827.mo5883(j, i, i2, i3, c3576);
        }

        @Override // p138.p176.p177.p190.p198.InterfaceC3575
        /* JADX INFO: renamed from: ֏ */
        public void mo5884(C3431 c3431) {
            C3431 c34312 = this.f11824;
            if (c34312 != null) {
                c3431 = c3431.m5600(c34312);
            }
            this.f11826 = c3431;
            this.f11827.mo5884(c3431);
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void m6215(InterfaceC3839 interfaceC3839, long j) {
            if (interfaceC3839 == null) {
                this.f11827 = this.f11825;
                return;
            }
            this.f11828 = j;
            InterfaceC3575 interfaceC3575M6212 = ((C3835) interfaceC3839).m6212(this.f11822, this.f11823);
            this.f11827 = interfaceC3575M6212;
            C3431 c3431 = this.f11826;
            if (c3431 != null) {
                interfaceC3575M6212.mo5884(c3431);
            }
        }

        @Override // p138.p176.p177.p190.p198.InterfaceC3575
        /* JADX INFO: renamed from: ֏ */
        public void mo5885(C4140 c4140, int i) {
            this.f11827.mo5885(c4140, i);
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໞ.ޝ.ނ$ؠ, reason: contains not printable characters */
    public interface InterfaceC3839 {
    }

    public C3837(InterfaceC3561 interfaceC3561, int i, C3431 c3431) {
        this.f11813 = interfaceC3561;
        this.f11814 = i;
        this.f11815 = c3431;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC3575 mo5891(int i, int i2) {
        C3838 c3838 = this.f11816.get(i);
        if (c3838 == null) {
            C0567.m1932(this.f11821 == null);
            c3838 = new C3838(i, i2, i2 == this.f11814 ? this.f11815 : null);
            c3838.m6215(this.f11818, this.f11819);
            this.f11816.put(i, c3838);
        }
        return c3838;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public void mo5892() {
        C3431[] c3431Arr = new C3431[this.f11816.size()];
        for (int i = 0; i < this.f11816.size(); i++) {
            c3431Arr[i] = this.f11816.valueAt(i).f11826;
        }
        this.f11821 = c3431Arr;
    }

    @Override // p138.p176.p177.p190.p198.InterfaceC3562
    /* JADX INFO: renamed from: ֏ */
    public void mo5893(InterfaceC3571 interfaceC3571) {
        this.f11820 = interfaceC3571;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m6214(InterfaceC3839 interfaceC3839, long j, long j2) {
        this.f11818 = interfaceC3839;
        this.f11819 = j2;
        if (!this.f11817) {
            this.f11813.mo5889(this);
            if (j != -9223372036854775807L) {
                this.f11813.mo5888(0L, j);
            }
            this.f11817 = true;
            return;
        }
        InterfaceC3561 interfaceC3561 = this.f11813;
        if (j == -9223372036854775807L) {
            j = 0;
        }
        interfaceC3561.mo5888(0L, j);
        for (int i = 0; i < this.f11816.size(); i++) {
            this.f11816.valueAt(i).m6215(interfaceC3839, j2);
        }
    }
}
