package p138.p176.p177.p190.p191;

import android.view.Surface;
import com.google.android.exoplayer2.ExoPlaybackException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArraySet;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.AbstractC3457;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.C3439;
import p138.p176.p177.p190.C3441;
import p138.p176.p177.p190.InterfaceC3442;
import p138.p176.p177.p190.p191.InterfaceC3466;
import p138.p176.p177.p190.p192.C3478;
import p138.p176.p177.p190.p192.InterfaceC3481;
import p138.p176.p177.p190.p192.InterfaceC3482;
import p138.p176.p177.p190.p193.C3510;
import p138.p176.p177.p190.p194.InterfaceC3525;
import p138.p176.p177.p190.p210.C3710;
import p138.p176.p177.p190.p210.InterfaceC3718;
import p138.p176.p177.p190.p217.C3829;
import p138.p176.p177.p190.p217.InterfaceC3800;
import p138.p176.p177.p190.p217.InterfaceC3803;
import p138.p176.p177.p190.p235.C4039;
import p138.p176.p177.p190.p238.InterfaceC4090;
import p138.p176.p177.p190.p239.InterfaceC4120;
import p138.p176.p177.p190.p240.InterfaceC4175;
import p138.p176.p177.p190.p240.InterfaceC4176;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ࢩ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C3463 implements InterfaceC3442.InterfaceC3443, InterfaceC3718, InterfaceC3482, InterfaceC4176, InterfaceC3803, InterfaceC4090.InterfaceC4091, InterfaceC3525, InterfaceC4175, InterfaceC3481 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC3466> f10242;

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

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final AbstractC3457.C3460 f10244;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final C3465 f10245;

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

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ࢩ.֏$֏, reason: contains not printable characters */
    public static final class C3464 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final InterfaceC3800.C3801 f10247;

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

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

        public C3464(InterfaceC3800.C3801 c3801, AbstractC3457 abstractC3457, int i) {
            this.f10247 = c3801;
            this.f10248 = abstractC3457;
            this.f10249 = i;
        }
    }

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ࢩ.֏$ؠ, reason: contains not printable characters */
    public static final class C3465 {

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

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

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

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

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final ArrayList<C3464> f10250 = new ArrayList<>();

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final HashMap<InterfaceC3800.C3801, C3464> f10251 = new HashMap<>();

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public final AbstractC3457.C3459 f10252 = new AbstractC3457.C3459();

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public AbstractC3457 f10256 = AbstractC3457.f10223;

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C3464 m5713(C3464 c3464, AbstractC3457 abstractC3457) {
            int iMo1223 = abstractC3457.mo1223(c3464.f10247.f11629);
            if (iMo1223 == -1) {
                return c3464;
            }
            return new C3464(c3464.f10247, abstractC3457, abstractC3457.m5682(iMo1223, this.f10252).f10225);
        }
    }

    public C3463(InterfaceC4120 interfaceC4120) {
        if (interfaceC4120 == null) {
            throw null;
        }
        this.f10243 = interfaceC4120;
        this.f10242 = new CopyOnWriteArraySet<>();
        this.f10245 = new C3465();
        this.f10244 = new AbstractC3457.C3460();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC3466.C3467 m5696(int i, InterfaceC3800.C3801 c3801) {
        C0567.m1856(this.f10246);
        if (c3801 != null) {
            C3464 c3464 = this.f10245.f10251.get(c3801);
            return c3464 != null ? m5698(c3464) : m5697(AbstractC3457.f10223, i, c3801);
        }
        AbstractC3457 abstractC3457Mo5506 = this.f10246.mo5506();
        if (!(i < abstractC3457Mo5506.mo1228())) {
            abstractC3457Mo5506 = AbstractC3457.f10223;
        }
        return m5697(abstractC3457Mo5506, i, (InterfaceC3800.C3801) null);
    }

    @RequiresNonNull({"player"})
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public InterfaceC3466.C3467 m5697(AbstractC3457 abstractC3457, int i, InterfaceC3800.C3801 c3801) {
        if (abstractC3457.m5686()) {
            c3801 = null;
        }
        InterfaceC3800.C3801 c38012 = c3801;
        long jMo6619 = this.f10243.mo6619();
        boolean z = abstractC3457 == this.f10246.mo5506() && i == this.f10246.mo5510();
        long jM5693 = 0;
        if (c38012 != null && c38012.m6122()) {
            if (z && this.f10246.mo5502() == c38012.f11630 && this.f10246.mo5503() == c38012.f11631) {
                jM5693 = this.f10246.mo5512();
            }
        } else if (z) {
            jM5693 = this.f10246.mo5497();
        } else if (!abstractC3457.m5686()) {
            jM5693 = abstractC3457.mo1226(i, this.f10244, 0L).m5693();
        }
        return new InterfaceC3466.C3467(jMo6619, abstractC3457, i, c38012, jM5693, this.f10246.mo5512(), this.f10246.mo5499());
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final InterfaceC3466.C3467 m5698(C3464 c3464) {
        C0567.m1856(this.f10246);
        if (c3464 == null) {
            int iMo5510 = this.f10246.mo5510();
            C3465 c3465 = this.f10245;
            C3464 c34642 = null;
            int i = 0;
            while (true) {
                if (i >= c3465.f10250.size()) {
                    break;
                }
                C3464 c34643 = c3465.f10250.get(i);
                int iMo1223 = c3465.f10256.mo1223(c34643.f10247.f11629);
                if (iMo1223 != -1 && c3465.f10256.m5682(iMo1223, c3465.f10252).f10225 == iMo5510) {
                    if (c34642 != null) {
                        c34642 = null;
                        break;
                    }
                    c34642 = c34643;
                }
                i++;
            }
            if (c34642 == null) {
                AbstractC3457 abstractC3457Mo5506 = this.f10246.mo5506();
                if (!(iMo5510 < abstractC3457Mo5506.mo1228())) {
                    abstractC3457Mo5506 = AbstractC3457.f10223;
                }
                return m5697(abstractC3457Mo5506, iMo5510, (InterfaceC3800.C3801) null);
            }
            c3464 = c34642;
        }
        return m5697(c3464.f10248, c3464.f10249, c3464.f10247);
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4175
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void mo5699() {
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3481
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo5700(float f) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5737();
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ֏ */
    public final void mo5663(int i) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5727();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4175
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo5701(int i, int i2) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5726();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ֏ */
    public final void mo5664(int i, int i2, int i3, float f) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5750();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ֏ */
    public final void mo5665(int i, long j) {
        m5705();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5721();
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ֏ */
    public final void mo5666(int i, long j, long j2) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5746();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ֏ */
    public final void mo5667(Surface surface) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5714();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1956(ExoPlaybackException exoPlaybackException) {
        m5705();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5722();
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m5702(Exception exc) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5728();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ֏ */
    public final void mo5668(String str, long j, long j2) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5735();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ֏ */
    public final void mo5669(C3431 c3431) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5738();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1957(C3439 c3439) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5720();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1958(AbstractC3457 abstractC3457, int i) {
        C3465 c3465 = this.f10245;
        for (int i2 = 0; i2 < c3465.f10250.size(); i2++) {
            C3464 c3464M5713 = c3465.m5713(c3465.f10250.get(i2), abstractC3457);
            c3465.f10250.set(i2, c3464M5713);
            c3465.f10251.put(c3464M5713.f10247, c3464M5713);
        }
        C3464 c3464 = c3465.f10255;
        if (c3464 != null) {
            c3465.f10255 = c3465.m5713(c3464, abstractC3457);
        }
        c3465.f10256 = abstractC3457;
        c3465.f10254 = c3465.f10253;
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5739();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    @Deprecated
    /* JADX INFO: renamed from: ֏ */
    public /* synthetic */ void mo1959(AbstractC3457 abstractC3457, Object obj, int i) {
        C3441.m5636(this, abstractC3457, obj, i);
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3481
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void mo5703(C3478 c3478) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5736();
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ֏ */
    public final void mo5670(C3510 c3510) {
        m5705();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5723();
        }
    }

    @Override // p138.p176.p177.p190.p210.InterfaceC3718
    /* JADX INFO: renamed from: ֏ */
    public final void mo5671(C3710 c3710) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5742();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1960(C3829 c3829, C4039 c4039) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5749();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1961(boolean z) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5724();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ֏ */
    public final void mo1962(boolean z, int i) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5753();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ؠ */
    public final void mo1963() {
        C3465 c3465 = this.f10245;
        if (c3465.f10257) {
            c3465.f10257 = false;
            c3465.f10254 = c3465.f10253;
            m5706();
            Iterator<InterfaceC3466> it = this.f10242.iterator();
            while (it.hasNext()) {
                it.next().m5715();
            }
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ؠ */
    public final void mo1964(int i) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5717();
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m5704(int i, InterfaceC3800.C3801 c3801) {
        m5696(i, c3801);
        C3465 c3465 = this.f10245;
        C3464 c3464Remove = c3465.f10251.remove(c3801);
        boolean z = false;
        if (c3464Remove != null) {
            c3465.f10250.remove(c3464Remove);
            C3464 c3464 = c3465.f10255;
            if (c3464 != null && c3801.equals(c3464.f10247)) {
                c3465.f10255 = c3465.f10250.isEmpty() ? null : c3465.f10250.get(0);
            }
            if (!c3465.f10250.isEmpty()) {
                c3465.f10253 = c3465.f10250.get(0);
            }
            z = true;
        }
        if (z) {
            Iterator<InterfaceC3466> it = this.f10242.iterator();
            while (it.hasNext()) {
                it.next().m5751();
            }
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ؠ */
    public final void mo5672(String str, long j, long j2) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5735();
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ؠ */
    public final void mo5673(C3431 c3431) {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5738();
        }
    }

    @Override // p138.p176.p177.p190.p192.InterfaceC3482
    /* JADX INFO: renamed from: ؠ */
    public final void mo5674(C3510 c3510) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5752();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ؠ */
    public final void mo1965(boolean z) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5729();
        }
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final InterfaceC3466.C3467 m5705() {
        return m5698(this.f10245.f10254);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ހ */
    public void mo1966(int i) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5741();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ހ */
    public final void mo5675(C3510 c3510) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5752();
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ހ */
    public void mo1967(boolean z) {
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5747();
        }
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final InterfaceC3466.C3467 m5706() {
        C3465 c3465 = this.f10245;
        return m5698((c3465.f10250.isEmpty() || c3465.f10256.m5686() || c3465.f10257) ? null : c3465.f10250.get(0));
    }

    @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
    /* JADX INFO: renamed from: ށ */
    public final void mo1968(int i) {
        C3465 c3465 = this.f10245;
        c3465.f10254 = c3465.f10253;
        m5706();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5716();
        }
    }

    @Override // p138.p176.p177.p190.p240.InterfaceC4176
    /* JADX INFO: renamed from: ށ */
    public final void mo5676(C3510 c3510) {
        m5705();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5723();
        }
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final InterfaceC3466.C3467 m5707() {
        return m5698(this.f10245.f10255);
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final void m5708() {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5744();
        }
    }

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final void m5709() {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5733();
        }
    }

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final void m5710() {
        m5707();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5754();
        }
    }

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final void m5711() {
        m5705();
        Iterator<InterfaceC3466> it = this.f10242.iterator();
        while (it.hasNext()) {
            it.next().m5743();
        }
    }

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final void m5712() {
        for (C3464 c3464 : new ArrayList(this.f10245.f10250)) {
            m5704(c3464.f10249, c3464.f10247);
        }
    }
}
