package c.i.a.c.d2; import androidx.annotation.Nullable; import c.i.a.c.a2.l; import c.i.a.c.d2.b0; import c.i.a.c.d2.y; import c.i.a.c.h2.j; import c.i.a.c.h2.m; import c.i.a.c.h2.r; import c.i.a.c.h2.u; import c.i.a.c.h2.x; import c.i.a.c.r1; import c.i.a.c.v0; import c.i.a.c.z1.p; import c.i.a.c.z1.s; import c.i.a.c.z1.t; import com.google.android.exoplayer2.drm.DrmSession; import com.google.android.exoplayer2.upstream.Loader; import java.util.Objects; /* compiled from: ProgressiveMediaSource */ public final class c0 extends j implements b0.b { public final v0 g; public final v0.g h; public final j.a i; public final l j; public final s k; public final u l; public final int m; public boolean n = true; public long o = -9223372036854775807L; public boolean p; public boolean q; @Nullable public x r; /* compiled from: ProgressiveMediaSource */ public class a extends p { public a(c0 c0Var, r1 r1Var) { super(r1Var); } @Override // c.i.a.c.r1 public r1.c o(int i, r1.c cVar, long j) { this.b.o(i, cVar, j); cVar.n = true; return cVar; } } /* compiled from: ProgressiveMediaSource */ public static final class b implements a0 { public final j.a a; public l b; /* renamed from: c reason: collision with root package name */ public t f784c = new p(); public u d = new r(); public int e = 1048576; public b(j.a aVar, l lVar) { this.a = aVar; this.b = lVar; } } public c0(v0 v0Var, j.a aVar, l lVar, s sVar, u uVar, int i) { v0.g gVar = v0Var.b; Objects.requireNonNull(gVar); this.h = gVar; this.g = v0Var; this.i = aVar; this.j = lVar; this.k = sVar; this.l = uVar; this.m = i; } @Override // c.i.a.c.d2.y public v0 e() { return this.g; } @Override // c.i.a.c.d2.y public void g() { } @Override // c.i.a.c.d2.y public void i(v vVar) { b0 b0Var = (b0) vVar; if (b0Var.F) { e0[] e0VarArr = b0Var.C; for (e0 e0Var : e0VarArr) { e0Var.h(); DrmSession drmSession = e0Var.h; if (drmSession != null) { drmSession.b(e0Var.d); e0Var.h = null; e0Var.g = null; } } } Loader loader = b0Var.u; Loader.d dVar = loader.d; if (dVar != null) { dVar.a(true); } loader.f2267c.execute(new Loader.g(b0Var)); loader.f2267c.shutdown(); b0Var.f781z.removeCallbacksAndMessages(null); b0Var.A = null; b0Var.V = true; } @Override // c.i.a.c.d2.y public v m(y.a aVar, m mVar, long j) { j a2 = this.i.a(); x xVar = this.r; if (xVar != null) { a2.d(xVar); } return new b0(this.h.a, a2, this.j, this.k, this.d.g(0, aVar), this.l, this.f795c.g(0, aVar, 0), this, mVar, this.h.f, this.m); } @Override // c.i.a.c.d2.j public void p(@Nullable x xVar) { this.r = xVar; this.k.a(); s(); } @Override // c.i.a.c.d2.j public void r() { this.k.release(); } public final void s() { r1 i0Var = new i0(this.o, this.p, false, this.q, null, this.g); if (this.n) { i0Var = new a(this, i0Var); } q(i0Var); } public void t(long j, boolean z2, boolean z3) { if (j == -9223372036854775807L) { j = this.o; } if (this.n || this.o != j || this.p != z2 || this.q != z3) { this.o = j; this.p = z2; this.q = z3; this.n = false; s(); } } }