package P0;

import I3.y;
import android.os.Looper;
import android.os.SystemClock;
import c0.ThreadFactoryC0564a;
import java.io.IOException;
import java.util.concurrent.Executors;
import x0.AbstractC1709a;
import x0.v;

/* JADX INFO: loaded from: classes.dex */
public final class m {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final B1.f f5301d = new B1.f(0, -9223372036854775807L, false);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final B1.f f5302e = new B1.f(2, -9223372036854775807L, false);

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final B1.f f5303f = new B1.f(3, -9223372036854775807L, false);

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Q0.a f5304a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public i f5305b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public IOException f5306c;

    /* JADX WARN: Illegal instructions before constructor call */
    public m(String str) {
        String strConcat = "ExoPlayer:Loader:".concat(str);
        int i = v.f18553a;
        this(new Q0.a(Executors.newSingleThreadExecutor(new ThreadFactoryC0564a(1, strConcat)), new y(11)));
    }

    public final void a() {
        i iVar = this.f5305b;
        AbstractC1709a.k(iVar);
        iVar.a(false);
    }

    public final boolean b() {
        return this.f5305b != null;
    }

    public final void c(k kVar) {
        i iVar = this.f5305b;
        if (iVar != null) {
            iVar.a(true);
        }
        Q0.a aVar = this.f5304a;
        if (kVar != null) {
            aVar.execute(new M4.k(7, kVar));
        }
        y yVar = aVar.f5550r;
        aVar.f5549q.shutdown();
    }

    public final void d(j jVar, h hVar, int i) {
        Looper looperMyLooper = Looper.myLooper();
        AbstractC1709a.k(looperMyLooper);
        this.f5306c = null;
        i iVar = new i(this, looperMyLooper, jVar, hVar, i, SystemClock.elapsedRealtime());
        AbstractC1709a.j(this.f5305b == null);
        this.f5305b = iVar;
        iVar.b();
    }

    public m(Q0.a aVar) {
        this.f5304a = aVar;
    }
}
