package L0;

import android.os.Looper;
import e0.C0853a;
import u0.C1579o;
import u0.C1584u;
import u0.C1588y;
import x0.AbstractC1709a;

/* JADX INFO: loaded from: classes.dex */
public final class W extends AbstractC0146a {

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final C0853a f3732h;
    public final A1.G i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final E0.h f3733j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final C4.f f3734k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final int f3735l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final C1579o f3736m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public boolean f3737n = true;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public long f3738o = -9223372036854775807L;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public boolean f3739p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public boolean f3740q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public z0.y f3741r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public C1588y f3742s;

    public W(C1588y c1588y, C0853a c0853a, A1.G g8, E0.h hVar, C4.f fVar, int i, C1579o c1579o) {
        this.f3742s = c1588y;
        this.f3732h = c0853a;
        this.i = g8;
        this.f3733j = hVar;
        this.f3734k = fVar;
        this.f3735l = i;
        this.f3736m = c1579o;
    }

    @Override // L0.AbstractC0146a
    public final A a(C c3, P0.e eVar, long j8) {
        z0.h hVarC = this.f3732h.c();
        z0.y yVar = this.f3741r;
        if (yVar != null) {
            ((z0.l) hVarC).k(yVar);
        }
        C1584u c1584u = g().f17396b;
        c1584u.getClass();
        AbstractC1709a.k(this.f3762g);
        A1.y yVar2 = new A1.y((T0.p) this.i.f63r);
        int i = 0;
        E0.e eVar2 = new E0.e(this.f3759d.f1973c, i, c3);
        E0.e eVar3 = new E0.e(this.f3758c.f1973c, i, c3);
        long jL = x0.v.L(c1584u.f17388e);
        return new T(c1584u.f17384a, hVarC, yVar2, this.f3733j, eVar2, this.f3734k, eVar3, this, eVar, this.f3735l, this.f3736m, jL, null);
    }

    @Override // L0.AbstractC0146a
    public final synchronized C1588y g() {
        return this.f3742s;
    }

    @Override // L0.AbstractC0146a
    public final void k(z0.y yVar) {
        this.f3741r = yVar;
        Looper looperMyLooper = Looper.myLooper();
        looperMyLooper.getClass();
        C0.l lVar = this.f3762g;
        AbstractC1709a.k(lVar);
        E0.h hVar = this.f3733j;
        hVar.e(looperMyLooper, lVar);
        hVar.m();
        s();
    }

    @Override // L0.AbstractC0146a
    public final void m(A a3) {
        T t6 = (T) a3;
        if (t6.f3699M) {
            for (b0 b0Var : t6.f3696J) {
                b0Var.j();
                K4.c cVar = b0Var.f3776h;
                if (cVar != null) {
                    cVar.J(b0Var.f3773e);
                    b0Var.f3776h = null;
                    b0Var.f3775g = null;
                }
            }
        }
        t6.f3690B.c(t6);
        t6.f3694G.removeCallbacksAndMessages(null);
        t6.H = null;
        t6.f3716e0 = true;
    }

    @Override // L0.AbstractC0146a
    public final void o() {
        this.f3733j.a();
    }

    @Override // L0.AbstractC0146a
    public final synchronized void r(C1588y c1588y) {
        this.f3742s = c1588y;
    }

    public final void s() {
        long j8 = this.f3738o;
        boolean z8 = this.f3739p;
        boolean z9 = this.f3740q;
        C1588y c1588yG = g();
        u0.S g0Var = new g0(-9223372036854775807L, -9223372036854775807L, j8, j8, 0L, 0L, z8, false, false, null, c1588yG, z9 ? c1588yG.f17397c : null);
        if (this.f3737n) {
            g0Var = new U(g0Var);
        }
        l(g0Var);
    }

    public final void t(long j8, T0.z zVar, boolean z8) {
        if (j8 == -9223372036854775807L) {
            j8 = this.f3738o;
        }
        boolean zB = zVar.b();
        if (!this.f3737n && this.f3738o == j8 && this.f3739p == zB && this.f3740q == z8) {
            return;
        }
        this.f3738o = j8;
        this.f3739p = zB;
        this.f3740q = z8;
        this.f3737n = false;
        s();
    }

    @Override // L0.AbstractC0146a
    public final void i() {
    }
}
