package com.fyber.inneractive.sdk.player.exoplayer2; import android.os.Handler; import android.os.HandlerThread; import android.os.Message; import android.os.SystemClock; import android.util.Log; import android.util.Pair; import com.fyber.inneractive.sdk.player.exoplayer2.e; import com.fyber.inneractive.sdk.player.exoplayer2.q; import com.fyber.inneractive.sdk.player.exoplayer2.source.o; import com.fyber.inneractive.sdk.player.exoplayer2.source.p; import com.fyber.inneractive.sdk.player.exoplayer2.source.u; import com.fyber.inneractive.sdk.player.exoplayer2.util.s; import com.mbridge.msdk.playercommon.exoplayer2.C; import java.io.IOException; /* loaded from: classes2.dex */ public final class h implements Handler.Callback, o.a, p.a { public a A; public a B; public q C; public final o[] a; public final com.fyber.inneractive.sdk.player.exoplayer2.a[] b; public final com.fyber.inneractive.sdk.player.exoplayer2.trackselection.g c; public final com.fyber.inneractive.sdk.player.exoplayer2.c d; public final com.fyber.inneractive.sdk.player.exoplayer2.util.o e; public final Handler f; public final HandlerThread g; public final Handler h; public final q.c i; public final q.b j; public b k; public n l; public o m; public com.fyber.inneractive.sdk.player.exoplayer2.util.g n; public com.fyber.inneractive.sdk.player.exoplayer2.source.p o; public o[] p; public boolean q; public boolean r; public boolean s; public boolean t; public int u = 1; public long v; public int w; public c x; public long y; public a z; public static final class a { public final com.fyber.inneractive.sdk.player.exoplayer2.source.o a; public final Object b; public final com.fyber.inneractive.sdk.player.exoplayer2.source.q[] c; public final boolean[] d; public final long e; public int f; public long g; public boolean h; public boolean i; public boolean j; public a k; public boolean l; public com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h m; public final o[] n; public final com.fyber.inneractive.sdk.player.exoplayer2.a[] o; public final com.fyber.inneractive.sdk.player.exoplayer2.trackselection.g p; public final com.fyber.inneractive.sdk.player.exoplayer2.c q; public final com.fyber.inneractive.sdk.player.exoplayer2.source.p r; public com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h s; public a(o[] oVarArr, com.fyber.inneractive.sdk.player.exoplayer2.a[] aVarArr, long j, com.fyber.inneractive.sdk.player.exoplayer2.trackselection.g gVar, com.fyber.inneractive.sdk.player.exoplayer2.c cVar, com.fyber.inneractive.sdk.player.exoplayer2.source.p pVar, Object obj, int i, boolean z, long j2) { this.n = oVarArr; this.o = aVarArr; this.e = j; this.p = gVar; this.q = cVar; this.r = pVar; this.b = com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(obj); this.f = i; this.h = z; this.g = j2; this.c = new com.fyber.inneractive.sdk.player.exoplayer2.source.q[oVarArr.length]; this.d = new boolean[oVarArr.length]; this.a = pVar.a(i, cVar.a(), j2); } public final long a() { return this.e - this.g; } public final long a(long j, boolean z, boolean[] zArr) { int i; com.fyber.inneractive.sdk.player.exoplayer2.trackselection.f fVar = this.m.b; int i2 = 0; while (true) { boolean z2 = true; if (i2 >= fVar.a) { break; } boolean[] zArr2 = this.d; if (!z) { com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h hVar = this.m; com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h hVar2 = this.s; if (hVar2 == null) { hVar.getClass(); } else if (s.a(hVar.b.b[i2], hVar2.b.b[i2]) && s.a(hVar.d[i2], hVar2.d[i2])) { zArr2[i2] = z2; i2++; } } z2 = false; zArr2[i2] = z2; i2++; } long a = this.a.a((com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[]) fVar.b.clone(), this.d, this.c, zArr, j); this.s = this.m; this.j = false; int i3 = 0; while (true) { com.fyber.inneractive.sdk.player.exoplayer2.source.q[] qVarArr = this.c; if (i3 >= qVarArr.length) { break; } if (qVarArr[i3] != null) { com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(fVar.b[i3] != null); this.j = true; } else { com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(fVar.b[i3] == null); } i3++; } com.fyber.inneractive.sdk.player.exoplayer2.c cVar = this.q; o[] oVarArr = this.n; u uVar = this.m.a; cVar.f = 0; for (int i4 = 0; i4 < oVarArr.length; i4++) { if (fVar.b[i4] != null) { int i5 = cVar.f; int k = oVarArr[i4].k(); int i6 = s.a; if (k == 0) { i = 16777216; } else if (k == 1) { i = C.DEFAULT_AUDIO_BUFFER_SIZE; } else if (k == 2) { i = C.DEFAULT_VIDEO_BUFFER_SIZE; } else { if (k != 3 && k != 4) { throw new IllegalStateException(); } i = 131072; } cVar.f = i5 + i; } } cVar.a.a(cVar.f); return a; } } public static final class b { public final int a; public final long b; public volatile long c; public b(int i, long j) { this.a = i; this.b = j; this.c = j; } } public static final class c { public final q a; public final int b; public final long c; public c(q qVar, int i, long j) { this.a = qVar; this.b = i; this.c = j; } } public static final class d { public final q a; public final Object b; public final b c; public final int d; public d(q qVar, Object obj, b bVar, int i) { this.a = qVar; this.b = obj; this.c = bVar; this.d = i; } } public h(o[] oVarArr, com.fyber.inneractive.sdk.player.exoplayer2.trackselection.b bVar, com.fyber.inneractive.sdk.player.exoplayer2.c cVar, boolean z, f fVar, b bVar2, e eVar) { this.a = oVarArr; this.c = bVar; this.d = cVar; this.r = z; this.h = fVar; this.k = bVar2; this.b = new com.fyber.inneractive.sdk.player.exoplayer2.a[oVarArr.length]; for (int i = 0; i < oVarArr.length; i++) { oVarArr[i].setIndex(i); this.b[i] = oVarArr[i].l(); } this.e = new com.fyber.inneractive.sdk.player.exoplayer2.util.o(); this.p = new o[0]; this.i = new q.c(); this.j = new q.b(); this.l = n.d; HandlerThread handlerThread = new HandlerThread("ExoPlayerImplInternal:Handler", -16); this.g = handlerThread; handlerThread.start(); this.f = new Handler(handlerThread.getLooper(), this); } @Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p.a public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.s sVar, com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.e eVar) { this.f.obtainMessage(7, Pair.create(sVar, eVar)).sendToTarget(); } public final synchronized void c() { if (this.q) { return; } this.f.sendEmptyMessage(6); while (!this.q) { try { wait(); } catch (InterruptedException unused) { Thread.currentThread().interrupt(); } } this.g.quit(); } public final void d() { b(true); this.d.a(true); a(1); synchronized (this) { this.q = true; notifyAll(); } } @Override // android.os.Handler.Callback public final boolean handleMessage(Message message) { try { switch (message.what) { case 0: a((com.fyber.inneractive.sdk.player.exoplayer2.source.p) message.obj, message.arg1 != 0); return true; case 1: c(message.arg1 != 0); return true; case 2: a(); return true; case 3: b((c) message.obj); return true; case 4: a((n) message.obj); return true; case 5: b(true); this.d.a(true); a(1); return true; case 6: d(); return true; case 7: a((Pair) message.obj); return true; case 8: a((com.fyber.inneractive.sdk.player.exoplayer2.source.o) message.obj); return true; case 9: com.fyber.inneractive.sdk.player.exoplayer2.source.o oVar = (com.fyber.inneractive.sdk.player.exoplayer2.source.o) message.obj; a aVar = this.z; if (aVar != null && aVar.a == oVar) { b(); } return true; case 10: e(); return true; case 11: a((e.c[]) message.obj); return true; default: return false; } } catch (com.fyber.inneractive.sdk.player.exoplayer2.d e) { Log.e("ExoPlayerImplInternal", "Renderer error.", e); this.h.obtainMessage(8, e).sendToTarget(); b(true); this.d.a(true); a(1); return true; } catch (IOException e2) { Log.e("ExoPlayerImplInternal", "Source error.", e2); this.h.obtainMessage(8, new com.fyber.inneractive.sdk.player.exoplayer2.d(e2)).sendToTarget(); b(true); this.d.a(true); a(1); return true; } catch (RuntimeException e3) { Log.e("ExoPlayerImplInternal", "Internal runtime error.", e3); this.h.obtainMessage(8, new com.fyber.inneractive.sdk.player.exoplayer2.d(e3)).sendToTarget(); b(true); this.d.a(true); a(1); return true; } } public final void a(int i) { if (this.u != i) { this.u = i; this.h.obtainMessage(1, i, 0).sendToTarget(); } } public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.p pVar, boolean z) { this.h.sendEmptyMessage(0); b(true); this.d.a(false); if (z) { this.k = new b(0, C.TIME_UNSET); } this.o = pVar; pVar.a(this); a(2); this.f.sendEmptyMessage(2); } public final void f() throws com.fyber.inneractive.sdk.player.exoplayer2.d { a aVar = this.B; if (aVar == null) { return; } long c2 = aVar.a.c(); if (c2 != C.TIME_UNSET) { a(c2); } else { o oVar = this.m; if (oVar != null && !oVar.a()) { long m = this.n.m(); this.y = m; com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar2 = this.e; oVar2.b = m; if (oVar2.a) { oVar2.c = SystemClock.elapsedRealtime(); } } else { this.y = this.e.m(); } c2 = Math.abs(this.y - this.B.a()); } this.k.c = c2; this.v = SystemClock.elapsedRealtime() * 1000; long e = this.p.length == 0 ? Long.MIN_VALUE : this.B.a.e(); b bVar = this.k; if (e == Long.MIN_VALUE) { long j = this.C.a(this.B.f, this.j, false).d; } bVar.getClass(); } public final void b(c cVar) throws com.fyber.inneractive.sdk.player.exoplayer2.d { if (this.C == null) { this.w++; this.x = cVar; return; } Pair a2 = a(cVar); if (a2 == null) { b bVar = new b(0, 0L); this.k = bVar; this.h.obtainMessage(4, 1, 0, bVar).sendToTarget(); this.k = new b(0, C.TIME_UNSET); a(4); b(false); return; } int i = cVar.c == C.TIME_UNSET ? 1 : 0; int intValue = ((Integer) a2.first).intValue(); long longValue = ((Long) a2.second).longValue(); try { b bVar2 = this.k; if (intValue == bVar2.a && longValue / 1000 == bVar2.c / 1000) { return; } long a3 = a(intValue, longValue); int i2 = i | (longValue == a3 ? 0 : 1); b bVar3 = new b(intValue, a3); this.k = bVar3; this.h.obtainMessage(4, i2, 0, bVar3).sendToTarget(); } finally { b bVar4 = new b(intValue, longValue); this.k = bVar4; this.h.obtainMessage(4, i, 0, bVar4).sendToTarget(); } } /* JADX WARN: Code restructure failed: missing block: B:94:0x0159, code lost: if (r0 != r14.A) goto L94; */ /* JADX WARN: Code restructure failed: missing block: B:95:0x015b, code lost: r2 = false; */ /* JADX WARN: Code restructure failed: missing block: B:97:0x015c, code lost: r0 = r0.k; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void e() throws com.fyber.inneractive.sdk.player.exoplayer2.d { /* Method dump skipped, instructions count: 353 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.h.e():void"); } public final long a(int i, long j) throws com.fyber.inneractive.sdk.player.exoplayer2.d { a aVar; com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar = this.e; if (oVar.a) { oVar.b = oVar.m(); if (oVar.a) { oVar.c = SystemClock.elapsedRealtime(); } oVar.a = false; } for (o oVar2 : this.p) { if (oVar2.e() == 2) { oVar2.stop(); } } this.s = false; a(2); a aVar2 = this.B; if (aVar2 == null) { a aVar3 = this.z; if (aVar3 != null) { try { aVar3.r.a(aVar3.a); } catch (RuntimeException e) { Log.e("ExoPlayerImplInternal", "Period release failed.", e); } } aVar = null; } else { aVar = null; while (aVar2 != null) { if (aVar2.f == i && aVar2.i) { aVar = aVar2; } else { try { aVar2.r.a(aVar2.a); } catch (RuntimeException e2) { Log.e("ExoPlayerImplInternal", "Period release failed.", e2); } } aVar2 = aVar2.k; } } a aVar4 = this.B; if (aVar4 != aVar || aVar4 != this.A) { for (o oVar3 : this.p) { oVar3.c(); } this.p = new o[0]; this.n = null; this.m = null; this.B = null; } if (aVar != null) { aVar.k = null; this.z = aVar; this.A = aVar; a(aVar); a aVar5 = this.B; if (aVar5.j) { j = aVar5.a.b(j); } a(j); b(); } else { this.z = null; this.A = null; this.B = null; a(j); } this.f.sendEmptyMessage(2); return j; } public final void c(boolean z) throws com.fyber.inneractive.sdk.player.exoplayer2.d { this.s = false; this.r = z; if (!z) { com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar = this.e; if (oVar.a) { oVar.b = oVar.m(); if (oVar.a) { oVar.c = SystemClock.elapsedRealtime(); } oVar.a = false; } for (o oVar2 : this.p) { if (oVar2.e() == 2) { oVar2.stop(); } } f(); b(false); return; } int i = this.u; if (i != 3) { if (i == 2) { this.f.sendEmptyMessage(2); return; } return; } this.s = false; com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar3 = this.e; if (!oVar3.a) { oVar3.c = SystemClock.elapsedRealtime(); oVar3.a = true; } for (o oVar4 : this.p) { oVar4.start(); } this.f.sendEmptyMessage(2); } public final void b(boolean z) { this.f.removeMessages(2); this.s = false; com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar = this.e; if (oVar.a) { oVar.b = oVar.m(); if (oVar.a) { oVar.c = SystemClock.elapsedRealtime(); } oVar.a = false; } this.n = null; this.m = null; this.y = 60000000L; for (o oVar2 : this.p) { try { if (oVar2.e() == 2) { oVar2.stop(); } oVar2.c(); } catch (com.fyber.inneractive.sdk.player.exoplayer2.d e) { e = e; Log.e("ExoPlayerImplInternal", "Stop failed.", e); } catch (RuntimeException e2) { e = e2; Log.e("ExoPlayerImplInternal", "Stop failed.", e); } } this.p = new o[0]; a aVar = this.B; if (aVar == null) { aVar = this.z; } while (aVar != null) { try { aVar.r.a(aVar.a); } catch (RuntimeException e3) { Log.e("ExoPlayerImplInternal", "Period release failed.", e3); } aVar = aVar.k; } this.z = null; this.A = null; this.B = null; if (this.t) { this.t = false; this.h.obtainMessage(2, 0, 0).sendToTarget(); } if (z) { com.fyber.inneractive.sdk.player.exoplayer2.source.p pVar = this.o; if (pVar != null) { pVar.b(); this.o = null; } this.C = null; } } /* JADX WARN: Code restructure failed: missing block: B:145:0x0452, code lost: r33.s = r33.r; a(2); r0 = r33.e; */ /* JADX WARN: Code restructure failed: missing block: B:146:0x045d, code lost: if (r0.a == false) goto L264; */ /* JADX WARN: Code restructure failed: missing block: B:147:0x045f, code lost: r0.b = r0.m(); */ /* JADX WARN: Code restructure failed: missing block: B:148:0x0467, code lost: if (r0.a == false) goto L263; */ /* JADX WARN: Code restructure failed: missing block: B:149:0x0469, code lost: r0.c = android.os.SystemClock.elapsedRealtime(); */ /* JADX WARN: Code restructure failed: missing block: B:150:0x046f, code lost: r0.a = false; */ /* JADX WARN: Code restructure failed: missing block: B:151:0x0471, code lost: r0 = r33.p; r1 = r0.length; r3 = 0; */ /* JADX WARN: Code restructure failed: missing block: B:152:0x0475, code lost: if (r3 >= r1) goto L305; */ /* JADX WARN: Code restructure failed: missing block: B:153:0x0477, code lost: r4 = r0[r3]; */ /* JADX WARN: Code restructure failed: missing block: B:154:0x047d, code lost: if (r4.e() != 2) goto L307; */ /* JADX WARN: Code restructure failed: missing block: B:155:0x047f, code lost: r4.stop(); */ /* JADX WARN: Code restructure failed: missing block: B:157:0x0482, code lost: r3 = r3 + 1; */ /* JADX WARN: Removed duplicated region for block: B:126:0x040e */ /* JADX WARN: Removed duplicated region for block: B:189:0x0194 A[LOOP:7: B:189:0x0194->B:197:0x01b4, LOOP_START] */ /* JADX WARN: Removed duplicated region for block: B:271:0x0183 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void a() throws com.fyber.inneractive.sdk.player.exoplayer2.d, java.io.IOException { /* Method dump skipped, instructions count: 1215 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.h.a():void"); } public final void b() { a aVar = this.z; long a2 = !aVar.i ? 0L : aVar.a.a(); if (a2 == Long.MIN_VALUE) { if (this.t) { this.t = false; this.h.obtainMessage(2, 0, 0).sendToTarget(); return; } return; } long abs = Math.abs(this.y - this.z.a()); boolean a3 = this.d.a(a2 - abs); if (this.t != a3) { this.t = a3; this.h.obtainMessage(2, a3 ? 1 : 0, 0).sendToTarget(); } if (a3) { a aVar2 = this.z; aVar2.l = false; aVar2.a.a(abs); return; } this.z.l = true; } public final void a(long j, long j2) { this.f.removeMessages(2); long elapsedRealtime = (j + j2) - SystemClock.elapsedRealtime(); if (elapsedRealtime <= 0) { this.f.sendEmptyMessage(2); } else { this.f.sendEmptyMessageDelayed(2, elapsedRealtime); } } public final void a(long j) throws com.fyber.inneractive.sdk.player.exoplayer2.d { a aVar = this.B; long a2 = aVar == null ? j + 60000000 : j + aVar.a(); this.y = a2; com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar = this.e; oVar.b = a2; if (oVar.a) { oVar.c = SystemClock.elapsedRealtime(); } for (o oVar2 : this.p) { oVar2.a(this.y); } } public final void a(n nVar) { n a2; com.fyber.inneractive.sdk.player.exoplayer2.util.g gVar = this.n; if (gVar != null) { a2 = gVar.a(nVar); } else { a2 = this.e.a(nVar); } this.l = a2; this.h.obtainMessage(7, a2).sendToTarget(); } public final void a(e.c[] cVarArr) throws com.fyber.inneractive.sdk.player.exoplayer2.d { try { for (e.c cVar : cVarArr) { cVar.a.a(cVar.b, cVar.c); } if (this.o != null) { this.f.sendEmptyMessage(2); } synchronized (this) { notifyAll(); } } catch (Throwable th) { synchronized (this) { notifyAll(); throw th; } } } public final boolean a(boolean z) { long e; a aVar = this.z; if (!aVar.i) { e = aVar.g; } else { e = aVar.a.e(); } if (e == Long.MIN_VALUE) { a aVar2 = this.z; if (aVar2.h) { return true; } e = this.C.a(aVar2.f, this.j, false).d; } com.fyber.inneractive.sdk.player.exoplayer2.c cVar = this.d; long abs = e - Math.abs(this.y - this.z.a()); long j = z ? cVar.e : cVar.d; return j <= 0 || abs >= j; } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:15:0x00da */ /* JADX WARN: Removed duplicated region for block: B:17:0x00ed */ /* JADX WARN: Removed duplicated region for block: B:90:0x00d5 */ /* JADX WARN: Type inference failed for: r0v27 */ /* JADX WARN: Type inference failed for: r0v32 */ /* JADX WARN: Type inference failed for: r0v4, types: [boolean, int] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void a(android.util.Pair r19) throws com.fyber.inneractive.sdk.player.exoplayer2.d { /* Method dump skipped, instructions count: 639 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.h.a(android.util.Pair):void"); } public final Pair a(c cVar) { q qVar = cVar.a; if (qVar.c()) { qVar = this.C; } try { Pair a2 = a(qVar, cVar.b, cVar.c, 0L); q qVar2 = this.C; if (qVar2 == qVar) { return a2; } int a3 = qVar2.a(qVar.a(((Integer) a2.first).intValue(), this.j, true).b); if (a3 != -1) { return Pair.create(Integer.valueOf(a3), a2.second); } int intValue = ((Integer) a2.first).intValue(); q qVar3 = this.C; int i = -1; while (i == -1 && intValue < qVar.a() - 1) { intValue++; i = qVar3.a(qVar.a(intValue, this.j, true).b); } if (i == -1) { return null; } return a(this.C, this.C.a(i, this.j, false).c, C.TIME_UNSET, 0L); } catch (IndexOutOfBoundsException unused) { throw new l(); } } public final Pair a(q qVar, int i, long j, long j2) { int b2 = qVar.b(); if (i >= 0 && i < b2) { qVar.a(i, this.i, j2); if (j == C.TIME_UNSET) { j = this.i.e; if (j == C.TIME_UNSET) { return null; } } q.c cVar = this.i; int i2 = cVar.c; long j3 = cVar.g + j; long j4 = qVar.a(i2, this.j, false).d; while (j4 != C.TIME_UNSET && j3 >= j4 && i2 < this.i.d) { j3 -= j4; i2++; j4 = qVar.a(i2, this.j, false).d; } return Pair.create(Integer.valueOf(i2), Long.valueOf(j3)); } throw new IndexOutOfBoundsException(); } /* JADX WARN: Removed duplicated region for block: B:11:0x005c */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.o r7) throws com.fyber.inneractive.sdk.player.exoplayer2.d { /* r6 = this; com.fyber.inneractive.sdk.player.exoplayer2.h$a r0 = r6.z if (r0 == 0) goto L6d com.fyber.inneractive.sdk.player.exoplayer2.source.o r1 = r0.a if (r1 == r7) goto L9 goto L6d L9: r7 = 1 r0.i = r7 com.fyber.inneractive.sdk.player.exoplayer2.trackselection.g r7 = r0.p com.fyber.inneractive.sdk.player.exoplayer2.a[] r2 = r0.o com.fyber.inneractive.sdk.player.exoplayer2.source.u r1 = r1.d() com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h r7 = r7.a(r2, r1) com.fyber.inneractive.sdk.player.exoplayer2.trackselection.h r1 = r0.s r2 = 0 if (r1 != 0) goto L21 r7.getClass() goto L49 L21: r3 = r2 L22: com.fyber.inneractive.sdk.player.exoplayer2.trackselection.f r4 = r7.b int r5 = r4.a if (r3 >= r5) goto L4b com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] r4 = r4.b r4 = r4[r3] com.fyber.inneractive.sdk.player.exoplayer2.trackselection.f r5 = r1.b com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] r5 = r5.b r5 = r5[r3] boolean r4 = com.fyber.inneractive.sdk.player.exoplayer2.util.s.a(r4, r5) if (r4 == 0) goto L49 com.fyber.inneractive.sdk.player.exoplayer2.p[] r4 = r7.d r4 = r4[r3] com.fyber.inneractive.sdk.player.exoplayer2.p[] r5 = r1.d r5 = r5[r3] boolean r4 = com.fyber.inneractive.sdk.player.exoplayer2.util.s.a(r4, r5) if (r4 == 0) goto L49 int r3 = r3 + 1 goto L22 L49: r0.m = r7 L4b: long r3 = r0.g com.fyber.inneractive.sdk.player.exoplayer2.o[] r7 = r0.n int r7 = r7.length boolean[] r7 = new boolean[r7] long r1 = r0.a(r3, r2, r7) r0.g = r1 com.fyber.inneractive.sdk.player.exoplayer2.h$a r7 = r6.B if (r7 != 0) goto L6a com.fyber.inneractive.sdk.player.exoplayer2.h$a r7 = r6.z r6.A = r7 long r0 = r7.g r6.a(r0) com.fyber.inneractive.sdk.player.exoplayer2.h$a r7 = r6.A r6.a(r7) L6a: r6.b() L6d: return */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.h.a(com.fyber.inneractive.sdk.player.exoplayer2.source.o):void"); } public final void a(a aVar) throws com.fyber.inneractive.sdk.player.exoplayer2.d { if (this.B == aVar) { return; } boolean[] zArr = new boolean[this.a.length]; int i = 0; int i2 = 0; while (true) { o[] oVarArr = this.a; if (i < oVarArr.length) { o oVar = oVarArr[i]; boolean z = oVar.e() != 0; zArr[i] = z; com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar = aVar.m.b.b[i]; if (eVar != null) { i2++; } if (z && (eVar == null || (oVar.h() && oVar.d() == this.B.c[i]))) { if (oVar == this.m) { com.fyber.inneractive.sdk.player.exoplayer2.util.o oVar2 = this.e; com.fyber.inneractive.sdk.player.exoplayer2.util.g gVar = this.n; oVar2.getClass(); oVar2.b = gVar.m(); if (oVar2.a) { oVar2.c = SystemClock.elapsedRealtime(); } oVar2.d = gVar.i(); this.n = null; this.m = null; } if (oVar.e() == 2) { oVar.stop(); } oVar.c(); } i++; } else { this.B = aVar; this.h.obtainMessage(3, aVar.m).sendToTarget(); a(zArr, i2); return; } } } public final void a(boolean[] zArr, int i) throws com.fyber.inneractive.sdk.player.exoplayer2.d { this.p = new o[i]; int i2 = 0; int i3 = 0; while (true) { o[] oVarArr = this.a; if (i2 >= oVarArr.length) { return; } o oVar = oVarArr[i2]; com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar = this.B.m.b.b[i2]; if (eVar != null) { int i4 = i3 + 1; this.p[i3] = oVar; if (oVar.e() == 0) { p pVar = this.B.m.d[i2]; boolean z = this.r && this.u == 3; boolean z2 = !zArr[i2] && z; int length = eVar.length(); j[] jVarArr = new j[length]; for (int i5 = 0; i5 < length; i5++) { jVarArr[i5] = eVar.a(i5); } a aVar = this.B; oVar.a(pVar, jVarArr, aVar.c[i2], this.y, z2, aVar.a()); com.fyber.inneractive.sdk.player.exoplayer2.util.g j = oVar.j(); if (j != null) { if (this.n == null) { this.n = j; this.m = oVar; j.a(this.l); } else { throw new com.fyber.inneractive.sdk.player.exoplayer2.d(new IllegalStateException("Multiple renderer media clocks enabled.")); } } if (z) { oVar.start(); } } i3 = i4; } i2++; } } }