Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 jr.java 源代码,内容仅作参考
package com.yandex.mobile.ads.impl;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.media.AudioTrack;
import android.media.MediaFormat;
import android.media.metrics.LogSessionId;
import android.os.Handler;
import android.os.Looper;
import android.util.Pair;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.TextureView;
import androidx.annotation.DoNotInline;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.bytedance.sdk.openadsdk.api.init.PAGSdk;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.yandex.mobile.ads.exo.metadata.Metadata;
import com.yandex.mobile.ads.impl.a70;
import com.yandex.mobile.ads.impl.bb;
import com.yandex.mobile.ads.impl.eb;
import com.yandex.mobile.ads.impl.gr;
import com.yandex.mobile.ads.impl.hz0;
import com.yandex.mobile.ads.impl.jr;
import com.yandex.mobile.ads.impl.lr;
import com.yandex.mobile.ads.impl.mp0;
import com.yandex.mobile.ads.impl.na0;
import com.yandex.mobile.ads.impl.qp0;
import com.yandex.mobile.ads.impl.s21;
import com.yandex.mobile.ads.impl.t41;
import com.yandex.mobile.ads.impl.u11;
import com.yandex.mobile.ads.impl.wa0;
import com.yandex.mobile.ads.impl.za0;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeoutException;
public final class jr extends jd implements gr {
private int A;
private int B;
private boolean C;
private int D;
private qy0 E;
private hz0 F;
private mp0.a G;
private na0 H;
@Nullable
private AudioTrack I;
@Nullable
private Object J;
@Nullable
private Surface K;
@Nullable
private TextureView L;
private int M;
private int N;
private int O;
private int P;
private ab Q;
private float R;
private boolean S;
private boolean T;
private boolean U;
private yn V;
private na0 W;
private gp0 X;
private int Y;
private long Z;
final n51 f66696b;
final mp0.a f66697c;
private final fj f66698d;
private final mp0 f66699e;
private final qt0[] f66700f;
private final m51 f66701g;
private final ax f66702h;
private final lr f66703i;
private final a70<mp0.b> f66704j;
private final CopyOnWriteArraySet<gr.a> f66705k;
private final t41.b f66706l;
private final ArrayList f66707m;
private final boolean f66708n;
private final wa0.a f66709o;
private final k8 f66710p;
private final Looper f66711q;
private final gc f66712r;
private final o31 f66713s;
private final b f66714t;
private final bb f66715u;
private final eb f66716v;
private final s21 f66717w;
private final mg1 f66718x;
private final ih1 f66719y;
private final long f66720z;
@RequiresApi(31)
public static final class a {
@DoNotInline
public static pp0 a(Context context, jr jrVar, boolean z11) {
LogSessionId logSessionId;
oa0 a11 = oa0.a(context);
if (a11 == null) {
y70.d("ExoPlayerImpl", "MediaMetricsService unavailable.");
logSessionId = LogSessionId.LOG_SESSION_ID_NONE;
return new pp0(logSessionId);
}
if (z11) {
jrVar.a(a11);
}
return new pp0(a11.b());
}
}
public final class b implements rd1, gb, h41, uc0, SurfaceHolder.Callback, TextureView.SurfaceTextureListener, u11.b, eb.b, bb.b, s21.a, gr.a {
private b() {
}
@Override
public final void a(String str, long j11, long j12) {
jr.this.f66710p.a(str, j11, j12);
}
@Override
public final void onCues(final List<xk> list) {
a70 a70Var = jr.this.f66704j;
a70Var.a(27, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).onCues(list);
}
});
a70Var.a();
}
@Override
public final void onSkipSilenceEnabledChanged(final boolean z11) {
if (jr.this.S != z11) {
jr.this.S = z11;
a70 a70Var = jr.this.f66704j;
a70Var.a(23, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).onSkipSilenceEnabledChanged(z11);
}
});
a70Var.a();
}
}
@Override
public final void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i11, int i12) {
jr.a(jr.this, surfaceTexture);
jr.this.a(i11, i12);
}
@Override
public final boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
jr.this.a((Surface) null);
jr.this.a(0, 0);
return true;
}
@Override
public final void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i11, int i12) {
jr.this.a(i11, i12);
}
@Override
public final void surfaceChanged(SurfaceHolder surfaceHolder, int i11, int i12, int i13) {
jr.this.a(i12, i13);
}
@Override
public final void surfaceCreated(SurfaceHolder surfaceHolder) {
jr.this.getClass();
}
@Override
public final void surfaceDestroyed(SurfaceHolder surfaceHolder) {
jr.this.getClass();
jr.this.a(0, 0);
}
public b(jr jrVar, int i11) {
this();
}
@Override
public final void a(final vd1 vd1Var) {
jr.this.getClass();
a70 a70Var = jr.this.f66704j;
a70Var.a(25, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).a(vd1.this);
}
});
a70Var.a();
}
@Override
public final void b(qu quVar, @Nullable zl zlVar) {
jr.this.getClass();
jr.this.f66710p.b(quVar, zlVar);
}
@Override
public final void c(vl vlVar) {
jr.this.f66710p.c(vlVar);
jr.this.getClass();
jr.this.getClass();
}
@Override
public final void d(vl vlVar) {
jr.this.getClass();
jr.this.f66710p.d(vlVar);
}
@Override
public final void b(int i11, long j11) {
jr.this.f66710p.b(i11, j11);
}
@Override
public final void b(vl vlVar) {
jr.this.getClass();
jr.this.f66710p.b(vlVar);
}
@Override
public final void c(Exception exc) {
jr.this.f66710p.c(exc);
}
@Override
public final void a(Object obj, long j11) {
jr.this.f66710p.a(obj, j11);
if (jr.this.J == obj) {
a70 a70Var = jr.this.f66704j;
a70Var.a(26, new a70.a() {
@Override
public final void invoke(Object obj2) {
((mp0.b) obj2).onRenderedFirstFrame();
}
});
a70Var.a();
}
}
public final void c() {
final yn b11 = jr.b(jr.this.f66717w);
if (b11.equals(jr.this.V)) {
return;
}
jr.this.V = b11;
a70 a70Var = jr.this.f66704j;
a70Var.a(29, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).a(yn.this);
}
});
a70Var.a();
}
@Override
public final void b(String str, long j11, long j12) {
jr.this.f66710p.b(str, j11, j12);
}
@Override
public final void b(String str) {
jr.this.f66710p.b(str);
}
@Override
public final void b(Exception exc) {
jr.this.f66710p.b(exc);
}
@Override
public final void b() {
jr.this.a((Surface) null);
}
@Override
public final void a(String str) {
jr.this.f66710p.a(str);
}
@Override
public final void a(int i11, long j11) {
jr.this.f66710p.a(i11, j11);
}
@Override
public final void a(qu quVar, @Nullable zl zlVar) {
jr.this.getClass();
jr.this.f66710p.a(quVar, zlVar);
}
@Override
public final void a(long j11) {
jr.this.f66710p.a(j11);
}
@Override
public final void a(int i11, long j11, long j12) {
jr.this.f66710p.a(i11, j11, j12);
}
@Override
public final void a(vl vlVar) {
jr.this.f66710p.a(vlVar);
jr.this.getClass();
jr.this.getClass();
}
@Override
public final void a(Exception exc) {
jr.this.f66710p.a(exc);
}
@Override
public final void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
}
@Override
public final void a(final zk zkVar) {
jr.this.getClass();
a70 a70Var = jr.this.f66704j;
a70Var.a(27, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).a(zk.this);
}
});
a70Var.a();
}
@Override
public final void a(final Metadata metadata) {
jr jrVar = jr.this;
na0 na0Var = jrVar.W;
na0Var.getClass();
na0.a aVar = new na0.a(na0Var, 0);
for (int i11 = 0; i11 < metadata.c(); i11++) {
metadata.a(i11).a(aVar);
}
jrVar.W = new na0(aVar, 0);
na0 c11 = jr.c(jr.this);
if (!c11.equals(jr.this.H)) {
jr.this.H = c11;
jr.this.f66704j.a(14, new a70.a() {
@Override
public final void invoke(Object obj) {
jr.b.this.a((mp0.b) obj);
}
});
}
jr.this.f66704j.a(28, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).a(Metadata.this);
}
});
jr.this.f66704j.a();
}
public void a(mp0.b bVar) {
bVar.a(jr.this.H);
}
@Override
public final void a(Surface surface) {
jr.this.a(surface);
}
public final void a(final boolean z11, final int i11) {
a70 a70Var = jr.this.f66704j;
a70Var.a(30, new a70.a() {
@Override
public final void invoke(Object obj) {
mp0.b bVar = (mp0.b) obj;
bVar.a(z11, i11);
}
});
a70Var.a();
}
@Override
public final void a() {
jr.h(jr.this);
}
}
public static final class c implements wc1, cg, qp0.b {
@Nullable
private wc1 f66722b;
@Nullable
private cg f66723c;
@Nullable
private wc1 f66724d;
@Nullable
private cg f66725e;
private c() {
}
@Override
public final void a(int i11, @Nullable Object obj) {
if (i11 == 7) {
this.f66722b = (wc1) obj;
return;
}
if (i11 == 8) {
this.f66723c = (cg) obj;
return;
}
if (i11 != 10000) {
return;
}
u11 u11Var = (u11) obj;
if (u11Var == null) {
this.f66724d = null;
this.f66725e = null;
} else {
this.f66724d = u11Var.b();
this.f66725e = u11Var.a();
}
}
@Override
public final void f() {
cg cgVar = this.f66725e;
if (cgVar != null) {
cgVar.f();
}
cg cgVar2 = this.f66723c;
if (cgVar2 != null) {
cgVar2.f();
}
}
public c(int i11) {
this();
}
@Override
public final void a(long j11, long j12, qu quVar, @Nullable MediaFormat mediaFormat) {
wc1 wc1Var = this.f66724d;
if (wc1Var != null) {
wc1Var.a(j11, j12, quVar, mediaFormat);
}
wc1 wc1Var2 = this.f66722b;
if (wc1Var2 != null) {
wc1Var2.a(j11, j12, quVar, mediaFormat);
}
}
@Override
public final void a(long j11, float[] fArr) {
cg cgVar = this.f66725e;
if (cgVar != null) {
cgVar.a(j11, fArr);
}
cg cgVar2 = this.f66723c;
if (cgVar2 != null) {
cgVar2.a(j11, fArr);
}
}
}
public static final class d implements ya0 {
private final Object f66726a;
private t41 f66727b;
public d(t41 t41Var, Object obj) {
this.f66726a = obj;
this.f66727b = t41Var;
}
@Override
public final t41 b() {
return this.f66727b;
}
@Override
public final Object a() {
return this.f66726a;
}
}
static {
mr.a("goog.exo.exoplayer");
}
@SuppressLint({"HandlerLeak"})
public jr(gr.b bVar) {
boolean z11;
pp0 a11;
fj fjVar = new fj();
this.f66698d = fjVar;
try {
y70.c("ExoPlayerImpl", "Init " + Integer.toHexString(System.identityHashCode(this)) + " [ExoPlayerLib/2.18.1] [" + b81.f63990e + "]");
Context applicationContext = bVar.f65794a.getApplicationContext();
k8 apply = bVar.f65801h.apply(bVar.f65795b);
this.f66710p = apply;
this.Q = bVar.f65803j;
this.M = bVar.f65804k;
int i11 = 0;
this.S = false;
this.f66720z = bVar.f65809p;
b bVar2 = new b(this, i11);
this.f66714t = bVar2;
Object cVar = new c(i11);
Handler handler = new Handler(bVar.f65802i);
qt0[] a12 = bVar.f65796c.get().a(handler, bVar2, bVar2, bVar2, bVar2);
this.f66700f = a12;
if (a12.length > 0) {
z11 = true;
} else {
z11 = false;
}
w9.b(z11);
m51 m51Var = bVar.f65798e.get();
this.f66701g = m51Var;
this.f66709o = bVar.f65797d.get();
gc gcVar = bVar.f65800g.get();
this.f66712r = gcVar;
this.f66708n = bVar.f65805l;
this.E = bVar.f65806m;
Looper looper = bVar.f65802i;
this.f66711q = looper;
o31 o31Var = bVar.f65795b;
this.f66713s = o31Var;
this.f66699e = this;
this.f66704j = new a70<>(looper, o31Var, new a70.b() {
@Override
public final void a(Object obj, iu iuVar) {
jr.this.a((mp0.b) obj, iuVar);
}
});
this.f66705k = new CopyOnWriteArraySet<>();
this.f66707m = new ArrayList();
this.F = new hz0.a();
n51 n51Var = new n51(new st0[a12.length], new wr[a12.length], c61.f64297b, null);
this.f66696b = n51Var;
this.f66706l = new t41.b();
mp0.a a13 = new mp0.a.C0818a().a(1, 2, 3, 13, 14, 15, 16, 17, 18, 19, 31, 20, 30, 21, 22, 23, 24, 25, 26, 27, 28).a(m51Var.c(), 29).a();
this.f66697c = a13;
this.G = new mp0.a.C0818a().a(a13).a(4).a(10).a();
this.f66702h = o31Var.a(looper, null);
lr.e eVar = new lr.e() {
@Override
public final void a(lr.d dVar) {
jr.this.b(dVar);
}
};
this.X = gp0.a(n51Var);
apply.a(this, looper);
int i12 = b81.f63986a;
if (i12 < 31) {
a11 = new pp0();
} else {
a11 = a.a(applicationContext, this, bVar.f65810q);
}
this.f66703i = new lr(a12, m51Var, n51Var, bVar.f65799f.get(), gcVar, 0, apply, this.E, bVar.f65807n, bVar.f65808o, false, looper, o31Var, eVar, a11);
this.R = 1.0f;
na0 na0Var = na0.G;
this.H = na0Var;
this.W = na0Var;
this.Y = -1;
if (i12 < 21) {
this.P = f();
} else {
this.P = b81.a(applicationContext);
}
int i13 = zk.f72203a;
this.T = true;
b(apply);
gcVar.a(new Handler(looper), apply);
a(bVar2);
bb bbVar = new bb(bVar.f65794a, handler, bVar2);
this.f66715u = bbVar;
bbVar.a();
eb ebVar = new eb(bVar.f65794a, handler, bVar2);
this.f66716v = ebVar;
ebVar.d();
s21 s21Var = new s21(bVar.f65794a, handler, bVar2);
this.f66717w = s21Var;
s21Var.a(b81.c(this.Q.f63677c));
mg1 mg1Var = new mg1(bVar.f65794a);
this.f66718x = mg1Var;
mg1Var.a();
ih1 ih1Var = new ih1(bVar.f65794a);
this.f66719y = ih1Var;
ih1Var.a();
this.V = b(s21Var);
int i14 = vd1.f70651e;
m51Var.a(this.Q);
a(1, 10, Integer.valueOf(this.P));
a(2, 10, Integer.valueOf(this.P));
a(1, 3, this.Q);
a(2, 4, Integer.valueOf(this.M));
a(2, 5, (Object) 0);
a(1, 9, Boolean.valueOf(this.S));
a(2, 7, cVar);
a(6, 8, cVar);
fjVar.e();
} catch (Throwable th2) {
this.f66698d.e();
throw th2;
}
}
public static int a(boolean z11, int i11) {
return (!z11 || i11 == 1) ? 1 : 2;
}
public static void c(mp0.b bVar) {
bVar.b(fr.a(new vr(1), 1003));
}
private void h() {
mp0.a aVar = this.G;
mp0 mp0Var = this.f66699e;
mp0.a aVar2 = this.f66697c;
int i11 = b81.f63986a;
boolean isPlayingAd = mp0Var.isPlayingAd();
boolean isCurrentMediaItemSeekable = mp0Var.isCurrentMediaItemSeekable();
boolean hasPreviousMediaItem = mp0Var.hasPreviousMediaItem();
boolean hasNextMediaItem = mp0Var.hasNextMediaItem();
boolean isCurrentMediaItemLive = mp0Var.isCurrentMediaItemLive();
boolean isCurrentMediaItemDynamic = mp0Var.isCurrentMediaItemDynamic();
boolean c11 = mp0Var.getCurrentTimeline().c();
boolean z11 = !isPlayingAd;
boolean z12 = false;
mp0.a.C0818a a11 = new mp0.a.C0818a().a(aVar2).a(z11, 4).a(isCurrentMediaItemSeekable && !isPlayingAd, 5).a(hasPreviousMediaItem && !isPlayingAd, 6).a(!c11 && (hasPreviousMediaItem || !isCurrentMediaItemLive || isCurrentMediaItemSeekable) && !isPlayingAd, 7).a(hasNextMediaItem && !isPlayingAd, 8).a(!c11 && (hasNextMediaItem || (isCurrentMediaItemLive && isCurrentMediaItemDynamic)) && !isPlayingAd, 9).a(z11, 10).a(isCurrentMediaItemSeekable && !isPlayingAd, 11);
if (isCurrentMediaItemSeekable && !isPlayingAd) {
z12 = true;
}
mp0.a a12 = a11.a(z12, 12).a();
this.G = a12;
if (a12.equals(aVar)) {
return;
}
this.f66704j.a(13, new a70.a() {
@Override
public final void invoke(Object obj) {
jr.this.d((mp0.b) obj);
}
});
}
public final void e() {
i();
}
@Override
public final long getContentPosition() {
i();
if (isPlayingAd()) {
gp0 gp0Var = this.X;
gp0Var.f65768a.a(gp0Var.f65769b.f69547a, this.f66706l);
gp0 gp0Var2 = this.X;
if (gp0Var2.f65770c == C.TIME_UNSET) {
return b81.b(gp0Var2.f65768a.a(getCurrentMediaItemIndex(), this.f66618a, 0L).f69794m);
}
return b81.b(this.f66706l.f69771e) + b81.b(this.X.f65770c);
}
return getCurrentPosition();
}
@Override
public final int getCurrentAdGroupIndex() {
i();
if (isPlayingAd()) {
return this.X.f65769b.f69548b;
}
return -1;
}
@Override
public final int getCurrentAdIndexInAdGroup() {
i();
if (isPlayingAd()) {
return this.X.f65769b.f69549c;
}
return -1;
}
@Override
public final int getCurrentMediaItemIndex() {
i();
int c11 = c();
if (c11 == -1) {
return 0;
}
return c11;
}
@Override
public final int getCurrentPeriodIndex() {
i();
if (this.X.f65768a.c()) {
return 0;
}
gp0 gp0Var = this.X;
return gp0Var.f65768a.a(gp0Var.f65769b.f69547a);
}
@Override
public final long getCurrentPosition() {
long j11;
i();
gp0 gp0Var = this.X;
if (gp0Var.f65768a.c()) {
j11 = b81.a(this.Z);
} else if (gp0Var.f65769b.a()) {
j11 = gp0Var.f65785r;
} else {
t41 t41Var = gp0Var.f65768a;
wa0.b bVar = gp0Var.f65769b;
long j12 = gp0Var.f65785r;
t41Var.a(bVar.f69547a, this.f66706l);
j11 = this.f66706l.f69771e + j12;
}
return b81.b(j11);
}
@Override
public final t41 getCurrentTimeline() {
i();
return this.X.f65768a;
}
@Override
public final c61 getCurrentTracks() {
i();
return this.X.f65776i.f67869d;
}
@Override
public final long getDuration() {
i();
if (isPlayingAd()) {
gp0 gp0Var = this.X;
wa0.b bVar = gp0Var.f65769b;
gp0Var.f65768a.a(bVar.f69547a, this.f66706l);
return b81.b(this.f66706l.a(bVar.f69548b, bVar.f69549c));
}
t41 currentTimeline = getCurrentTimeline();
if (currentTimeline.c()) {
return C.TIME_UNSET;
}
return b81.b(currentTimeline.a(getCurrentMediaItemIndex(), this.f66618a, 0L).f69795n);
}
@Override
public final boolean getPlayWhenReady() {
i();
return this.X.f65779l;
}
@Override
public final int getPlaybackState() {
i();
return this.X.f65772e;
}
@Override
public final int getPlaybackSuppressionReason() {
i();
return this.X.f65780m;
}
@Override
public final long getTotalBufferedDuration() {
i();
return b81.b(this.X.f65784q);
}
@Override
public final float getVolume() {
i();
return this.R;
}
@Override
public final boolean isPlayingAd() {
i();
return this.X.f65769b.a();
}
@Override
public final void prepare() {
int i11;
i();
boolean playWhenReady = getPlayWhenReady();
int i12 = 2;
int a11 = this.f66716v.a(playWhenReady, 2);
if (playWhenReady && a11 != 1) {
i11 = 2;
} else {
i11 = 1;
}
a(a11, i11, playWhenReady);
gp0 gp0Var = this.X;
if (gp0Var.f65772e != 1) {
return;
}
gp0 a12 = gp0Var.a((fr) null);
if (a12.f65768a.c()) {
i12 = 4;
}
gp0 a13 = a12.a(i12);
this.A++;
this.f66703i.i();
a(a13, 1, 1, false, 5, C.TIME_UNSET);
}
@Override
public final void release() {
AudioTrack audioTrack;
StringBuilder a11 = j50.a("Release ");
a11.append(Integer.toHexString(System.identityHashCode(this)));
a11.append(" [");
a11.append("ExoPlayerLib/2.18.1");
a11.append("] [");
a11.append(b81.f63990e);
a11.append("] [");
a11.append(mr.a());
a11.append("]");
y70.c("ExoPlayerImpl", a11.toString());
i();
if (b81.f63986a < 21 && (audioTrack = this.I) != null) {
audioTrack.release();
this.I = null;
}
this.f66715u.a();
this.f66717w.c();
this.f66718x.a(false);
this.f66719y.a(false);
this.f66716v.c();
if (!this.f66703i.k()) {
a70<mp0.b> a70Var = this.f66704j;
a70Var.a(10, new a70.a() {
@Override
public final void invoke(Object obj) {
jr.c((mp0.b) obj);
}
});
a70Var.a();
}
this.f66704j.b();
this.f66702h.a();
this.f66712r.a(this.f66710p);
gp0 a12 = this.X.a(1);
this.X = a12;
gp0 a13 = a12.a(a12.f65769b);
this.X = a13;
a13.f65783p = a13.f65785r;
this.X.f65784q = 0L;
this.f66710p.release();
this.f66701g.d();
g();
Surface surface = this.K;
if (surface != null) {
surface.release();
this.K = null;
}
int i11 = zk.f72203a;
}
@Override
public final void setPlayWhenReady(boolean z11) {
i();
int a11 = this.f66716v.a(z11, getPlaybackState());
int i11 = 1;
if (z11 && a11 != 1) {
i11 = 2;
}
a(a11, i11, z11);
}
@Override
public final void setVideoTextureView(@Nullable TextureView textureView) {
SurfaceTexture surfaceTexture;
i();
if (textureView == null) {
i();
g();
a((Surface) null);
a(0, 0);
return;
}
g();
this.L = textureView;
if (textureView.getSurfaceTextureListener() != null) {
y70.d("ExoPlayerImpl", "Replacing existing SurfaceTextureListener.");
}
textureView.setSurfaceTextureListener(this.f66714t);
if (textureView.isAvailable()) {
surfaceTexture = textureView.getSurfaceTexture();
} else {
surfaceTexture = null;
}
if (surfaceTexture == null) {
a((Surface) null);
a(0, 0);
} else {
Surface surface = new Surface(surfaceTexture);
a(surface);
this.K = surface;
a(textureView.getWidth(), textureView.getHeight());
}
}
@Override
public final void setVolume(float f11) {
i();
int i11 = b81.f63986a;
final float max = Math.max(0.0f, Math.min(f11, 1.0f));
if (this.R == max) {
return;
}
this.R = max;
a(1, 2, Float.valueOf(this.f66716v.b() * max));
a70<mp0.b> a70Var = this.f66704j;
a70Var.a(22, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).onVolumeChanged(max);
}
});
a70Var.a();
}
@Override
public final void stop() {
i();
i();
this.f66716v.a(getPlayWhenReady(), 1);
a((fr) null);
int i11 = zk.f72203a;
}
public static void e(gp0 gp0Var, mp0.b bVar) {
bVar.onPlayerStateChanged(gp0Var.f65779l, gp0Var.f65772e);
}
public static void f(gp0 gp0Var, mp0.b bVar) {
bVar.onPlaybackStateChanged(gp0Var.f65772e);
}
public static void g(gp0 gp0Var, mp0.b bVar) {
bVar.onPlaybackSuppressionReasonChanged(gp0Var.f65780m);
}
public static void i(gp0 gp0Var, mp0.b bVar) {
bVar.a(gp0Var.f65781n);
}
public final void d() {
i();
}
public static void d(gp0 gp0Var, mp0.b bVar) {
boolean z11 = gp0Var.f65774g;
bVar.b();
bVar.onIsLoadingChanged(gp0Var.f65774g);
}
public static void e(jr jrVar) {
jrVar.a(1, 2, Float.valueOf(jrVar.R * jrVar.f66716v.b()));
}
private int f() {
AudioTrack audioTrack = this.I;
if (audioTrack != null && audioTrack.getAudioSessionId() != 0) {
this.I.release();
this.I = null;
}
if (this.I == null) {
this.I = new AudioTrack(3, PAGSdk.INIT_LOCAL_FAIL_CODE, 4, 2, 2, 0, 0);
}
return this.I.getAudioSessionId();
}
private void g() {
TextureView textureView = this.L;
if (textureView != null) {
if (textureView.getSurfaceTextureListener() != this.f66714t) {
y70.d("ExoPlayerImpl", "SurfaceTextureListener already unset or replaced.");
} else {
this.L.setSurfaceTextureListener(null);
}
this.L = null;
}
}
private void i() {
this.f66698d.b();
if (Thread.currentThread() != this.f66711q.getThread()) {
Object[] objArr = {Thread.currentThread().getName(), this.f66711q.getThread().getName()};
int i11 = b81.f63986a;
String format = String.format(Locale.US, "Player is accessed on the wrong thread.\nCurrent thread: '%s'\nExpected thread: '%s'\nSee https://exoplayer.dev/issues/player-accessed-on-wrong-thread", objArr);
if (!this.T) {
y70.b("ExoPlayerImpl", format, this.U ? null : new IllegalStateException());
this.U = true;
return;
}
throw new IllegalStateException(format);
}
}
@Override
public final void b(mp0.b bVar) {
bVar.getClass();
this.f66704j.a((a70<mp0.b>) bVar);
}
private int c() {
if (this.X.f65768a.c()) {
return this.Y;
}
gp0 gp0Var = this.X;
return gp0Var.f65768a.a(gp0Var.f65769b.f69547a, this.f66706l).f69769c;
}
public void b(final lr.d dVar) {
this.f66702h.a(new Runnable() {
@Override
public final void run() {
jr.this.a(dVar);
}
});
}
public void d(mp0.b bVar) {
bVar.a(this.G);
}
public static void b(gp0 gp0Var, mp0.b bVar) {
bVar.b(gp0Var.f65773f);
}
public static void a(jr jrVar, SurfaceTexture surfaceTexture) {
jrVar.getClass();
Surface surface = new Surface(surfaceTexture);
jrVar.a(surface);
jrVar.K = surface;
}
public static void b(gp0 gp0Var, int i11, mp0.b bVar) {
bVar.onPlayWhenReadyChanged(gp0Var.f65779l, i11);
}
public static void c(gp0 gp0Var, mp0.b bVar) {
bVar.a(gp0Var.f65776i.f67869d);
}
public static yn b(s21 s21Var) {
return new yn(0, s21Var.b(), s21Var.a());
}
public static na0 c(jr jrVar) {
t41 currentTimeline = jrVar.getCurrentTimeline();
if (currentTimeline.c()) {
return jrVar.W;
}
ka0 ka0Var = currentTimeline.a(jrVar.getCurrentMediaItemIndex(), jrVar.f66618a, 0L).f69784c;
na0 na0Var = jrVar.W;
na0Var.getClass();
return new na0(new na0.a(na0Var, 0).a(ka0Var.f66843d), 0);
}
@Override
public final void a(mp0.b bVar) {
bVar.getClass();
this.f66704j.b(bVar);
}
public void a(mp0.b bVar, iu iuVar) {
bVar.a();
}
public final void a(gr.a aVar) {
this.f66705k.add(aVar);
}
@Override
@Nullable
public final fr a() {
i();
return this.X.f65773f;
}
@Override
public final void a(rr0 rr0Var) {
long j11;
long j12;
i();
List singletonList = Collections.singletonList(rr0Var);
i();
i();
c();
getCurrentPosition();
this.A++;
if (!this.f66707m.isEmpty()) {
int size = this.f66707m.size();
for (int i11 = size - 1; i11 >= 0; i11--) {
this.f66707m.remove(i11);
}
this.F = this.F.c(size);
}
ArrayList arrayList = new ArrayList();
for (int i12 = 0; i12 < singletonList.size(); i12++) {
za0.c cVar = new za0.c((wa0) singletonList.get(i12), this.f66708n);
arrayList.add(cVar);
this.f66707m.add(i12 + 0, new d(cVar.f72113a.f(), cVar.f72114b));
}
this.F = this.F.b(arrayList.size());
eq0 eq0Var = new eq0(this.f66707m, this.F);
if (!eq0Var.c() && -1 >= eq0Var.b()) {
throw new k00();
}
int a11 = eq0Var.a(false);
gp0 a12 = a(this.X, eq0Var, a(eq0Var, a11, C.TIME_UNSET));
int i13 = a12.f65772e;
if (a11 != -1 && i13 != 1) {
i13 = (eq0Var.c() || a11 >= eq0Var.b()) ? 4 : 2;
}
gp0 a13 = a12.a(i13);
this.f66703i.a(a11, b81.a(C.TIME_UNSET), this.F, arrayList);
boolean z11 = (this.X.f65769b.f69547a.equals(a13.f65769b.f69547a) || this.X.f65768a.c()) ? false : true;
if (a13.f65768a.c()) {
j12 = b81.a(this.Z);
} else if (a13.f65769b.a()) {
j12 = a13.f65785r;
} else {
t41 t41Var = a13.f65768a;
wa0.b bVar = a13.f65769b;
long j13 = a13.f65785r;
t41Var.a(bVar.f69547a, this.f66706l);
j11 = j13 + this.f66706l.f69771e;
a(a13, 0, 1, z11, 4, j11);
}
j11 = j12;
a(a13, 0, 1, z11, 4, j11);
}
public static void h(jr jrVar) {
int playbackState = jrVar.getPlaybackState();
if (playbackState != 1) {
if (playbackState == 2 || playbackState == 3) {
jrVar.i();
jrVar.f66718x.a(jrVar.getPlayWhenReady() && !jrVar.X.f65782o);
jrVar.f66719y.a(jrVar.getPlayWhenReady());
return;
}
if (playbackState != 4) {
throw new IllegalStateException();
}
}
jrVar.f66718x.a(false);
jrVar.f66719y.a(false);
}
public static void h(gp0 gp0Var, mp0.b bVar) {
bVar.onIsPlayingChanged(gp0Var.f65772e == 3 && gp0Var.f65779l && gp0Var.f65780m == 0);
}
public final void a(oa0 oa0Var) {
this.f66710p.a(oa0Var);
}
private void a(@Nullable fr frVar) {
long j11;
long j12;
gp0 gp0Var = this.X;
gp0 a11 = gp0Var.a(gp0Var.f65769b);
a11.f65783p = a11.f65785r;
a11.f65784q = 0L;
gp0 a12 = a11.a(1);
if (frVar != null) {
a12 = a12.a(frVar);
}
gp0 gp0Var2 = a12;
this.A++;
this.f66703i.q();
boolean z11 = gp0Var2.f65768a.c() && !this.X.f65768a.c();
if (gp0Var2.f65768a.c()) {
j12 = b81.a(this.Z);
} else if (gp0Var2.f65769b.a()) {
j12 = gp0Var2.f65785r;
} else {
t41 t41Var = gp0Var2.f65768a;
wa0.b bVar = gp0Var2.f65769b;
long j13 = gp0Var2.f65785r;
t41Var.a(bVar.f69547a, this.f66706l);
j11 = j13 + this.f66706l.f69771e;
a(gp0Var2, 0, 1, z11, 4, j11);
}
j11 = j12;
a(gp0Var2, 0, 1, z11, 4, j11);
}
public void a(lr.d dVar) {
long j11;
boolean z11;
int i11 = this.A - dVar.f67421c;
this.A = i11;
boolean z12 = true;
if (dVar.f67422d) {
this.B = dVar.f67423e;
this.C = true;
}
if (dVar.f67424f) {
this.D = dVar.f67425g;
}
if (i11 == 0) {
t41 t41Var = dVar.f67420b.f65768a;
if (!this.X.f65768a.c() && t41Var.c()) {
this.Y = -1;
this.Z = 0L;
}
if (!t41Var.c()) {
List<t41> d11 = ((eq0) t41Var).d();
w9.b(d11.size() == this.f66707m.size());
for (int i12 = 0; i12 < d11.size(); i12++) {
((d) this.f66707m.get(i12)).f66727b = d11.get(i12);
}
}
boolean z13 = this.C;
long j12 = C.TIME_UNSET;
if (z13) {
if (dVar.f67420b.f65769b.equals(this.X.f65769b) && dVar.f67420b.f65771d == this.X.f65785r) {
z12 = false;
}
if (z12) {
if (!t41Var.c() && !dVar.f67420b.f65769b.a()) {
gp0 gp0Var = dVar.f67420b;
wa0.b bVar = gp0Var.f65769b;
long j13 = gp0Var.f65771d;
t41Var.a(bVar.f69547a, this.f66706l);
j12 = j13 + this.f66706l.f69771e;
} else {
j12 = dVar.f67420b.f65771d;
}
}
z11 = z12;
j11 = j12;
} else {
j11 = -9223372036854775807L;
z11 = false;
}
this.C = false;
a(dVar.f67420b, 1, this.D, z11, this.B, j11);
}
}
private void a(final gp0 gp0Var, final int i11, final int i12, boolean z11, final int i13, long j11) {
Pair pair;
int i14;
final ka0 ka0Var;
boolean z12;
boolean z13;
boolean z14;
Object obj;
int i15;
ka0 ka0Var2;
Object obj2;
int i16;
long j12;
long j13;
long j14;
long a11;
Object obj3;
ka0 ka0Var3;
Object obj4;
int i17;
gp0 gp0Var2 = this.X;
this.X = gp0Var;
boolean z15 = !gp0Var2.f65768a.equals(gp0Var.f65768a);
t41 t41Var = gp0Var2.f65768a;
t41 t41Var2 = gp0Var.f65768a;
if (t41Var2.c() && t41Var.c()) {
pair = new Pair(Boolean.FALSE, -1);
} else if (t41Var2.c() != t41Var.c()) {
pair = new Pair(Boolean.TRUE, 3);
} else if (!t41Var.a(t41Var.a(gp0Var2.f65769b.f69547a, this.f66706l).f69769c, this.f66618a, 0L).f69782a.equals(t41Var2.a(t41Var2.a(gp0Var.f65769b.f69547a, this.f66706l).f69769c, this.f66618a, 0L).f69782a)) {
if (z11 && i13 == 0) {
i14 = 1;
} else if (z11 && i13 == 1) {
i14 = 2;
} else {
if (!z15) {
throw new IllegalStateException();
}
i14 = 3;
}
pair = new Pair(Boolean.TRUE, Integer.valueOf(i14));
} else if (z11 && i13 == 0 && gp0Var2.f65769b.f69550d < gp0Var.f65769b.f69550d) {
pair = new Pair(Boolean.TRUE, 0);
} else {
pair = new Pair(Boolean.FALSE, -1);
}
boolean booleanValue = ((Boolean) pair.first).booleanValue();
final int intValue = ((Integer) pair.second).intValue();
na0 na0Var = this.H;
if (booleanValue) {
ka0 ka0Var4 = !gp0Var.f65768a.c() ? gp0Var.f65768a.a(gp0Var.f65768a.a(gp0Var.f65769b.f69547a, this.f66706l).f69769c, this.f66618a, 0L).f69784c : null;
this.W = na0.G;
ka0Var = ka0Var4;
} else {
ka0Var = null;
}
if (booleanValue || !gp0Var2.f65777j.equals(gp0Var.f65777j)) {
na0 na0Var2 = this.W;
na0Var2.getClass();
na0.a aVar = new na0.a(na0Var2, 0);
List<Metadata> list = gp0Var.f65777j;
for (int i18 = 0; i18 < list.size(); i18++) {
Metadata metadata = list.get(i18);
for (int i19 = 0; i19 < metadata.c(); i19++) {
metadata.a(i19).a(aVar);
}
}
this.W = new na0(aVar, 0);
t41 currentTimeline = getCurrentTimeline();
if (currentTimeline.c()) {
na0Var = this.W;
} else {
ka0 ka0Var5 = currentTimeline.a(getCurrentMediaItemIndex(), this.f66618a, 0L).f69784c;
na0 na0Var3 = this.W;
na0Var3.getClass();
na0Var = new na0(new na0.a(na0Var3, 0).a(ka0Var5.f66843d), 0);
}
}
boolean z16 = !na0Var.equals(this.H);
this.H = na0Var;
boolean z17 = gp0Var2.f65779l != gp0Var.f65779l;
boolean z18 = gp0Var2.f65772e != gp0Var.f65772e;
if (z18 || z17) {
int playbackState = getPlaybackState();
if (playbackState != 1) {
if (playbackState == 2 || playbackState == 3) {
i();
this.f66718x.a(getPlayWhenReady() && !this.X.f65782o);
this.f66719y.a(getPlayWhenReady());
} else if (playbackState != 4) {
throw new IllegalStateException();
}
}
this.f66718x.a(false);
this.f66719y.a(false);
}
boolean z19 = gp0Var2.f65774g != gp0Var.f65774g;
if (!gp0Var2.f65768a.equals(gp0Var.f65768a)) {
this.f66704j.a(0, new a70.a() {
@Override
public final void invoke(Object obj5) {
jr.a(gp0.this, i11, (mp0.b) obj5);
}
});
}
if (z11) {
t41.b bVar = new t41.b();
if (gp0Var2.f65768a.c()) {
z12 = z17;
z13 = z19;
obj = null;
i15 = -1;
ka0Var2 = null;
obj2 = null;
i16 = -1;
} else {
Object obj5 = gp0Var2.f65769b.f69547a;
gp0Var2.f65768a.a(obj5, bVar);
int i21 = bVar.f69769c;
int a12 = gp0Var2.f65768a.a(obj5);
z12 = z17;
z13 = z19;
obj2 = obj5;
obj = gp0Var2.f65768a.a(i21, this.f66618a, 0L).f69782a;
ka0Var2 = this.f66618a.f69784c;
i15 = i21;
i16 = a12;
}
if (i13 == 0) {
if (gp0Var2.f65769b.a()) {
wa0.b bVar2 = gp0Var2.f65769b;
j14 = bVar.a(bVar2.f69548b, bVar2.f69549c);
a11 = a(gp0Var2);
} else if (gp0Var2.f65769b.f69551e != -1) {
j14 = a(this.X);
a11 = j14;
} else {
j12 = bVar.f69771e;
j13 = bVar.f69770d;
j14 = j12 + j13;
a11 = j14;
}
} else if (gp0Var2.f65769b.a()) {
j14 = gp0Var2.f65785r;
a11 = a(gp0Var2);
} else {
j12 = bVar.f69771e;
j13 = gp0Var2.f65785r;
j14 = j12 + j13;
a11 = j14;
}
long b11 = b81.b(j14);
long b12 = b81.b(a11);
wa0.b bVar3 = gp0Var2.f65769b;
final mp0.c cVar = new mp0.c(obj, i15, ka0Var2, obj2, i16, b11, b12, bVar3.f69548b, bVar3.f69549c);
int currentMediaItemIndex = getCurrentMediaItemIndex();
if (this.X.f65768a.c()) {
z14 = z18;
obj3 = null;
ka0Var3 = null;
obj4 = null;
i17 = -1;
} else {
gp0 gp0Var3 = this.X;
Object obj6 = gp0Var3.f65769b.f69547a;
gp0Var3.f65768a.a(obj6, this.f66706l);
int a13 = this.X.f65768a.a(obj6);
z14 = z18;
Object obj7 = this.X.f65768a.a(currentMediaItemIndex, this.f66618a, 0L).f69782a;
i17 = a13;
ka0Var3 = this.f66618a.f69784c;
obj3 = obj7;
obj4 = obj6;
}
long b13 = b81.b(j11);
long b14 = this.X.f65769b.a() ? b81.b(a(this.X)) : b13;
wa0.b bVar4 = this.X.f65769b;
final mp0.c cVar2 = new mp0.c(obj3, currentMediaItemIndex, ka0Var3, obj4, i17, b13, b14, bVar4.f69548b, bVar4.f69549c);
this.f66704j.a(11, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.a(i13, cVar, cVar2, (mp0.b) obj8);
}
});
} else {
z12 = z17;
z13 = z19;
z14 = z18;
}
if (booleanValue) {
this.f66704j.a(1, new a70.a() {
@Override
public final void invoke(Object obj8) {
((mp0.b) obj8).a(ka0.this, intValue);
}
});
}
if (gp0Var2.f65773f != gp0Var.f65773f) {
this.f66704j.a(10, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.a(gp0.this, (mp0.b) obj8);
}
});
if (gp0Var.f65773f != null) {
this.f66704j.a(10, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.b(gp0.this, (mp0.b) obj8);
}
});
}
}
n51 n51Var = gp0Var2.f65776i;
n51 n51Var2 = gp0Var.f65776i;
if (n51Var != n51Var2) {
this.f66701g.a(n51Var2.f67870e);
this.f66704j.a(2, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.c(gp0.this, (mp0.b) obj8);
}
});
}
if (z16) {
final na0 na0Var4 = this.H;
this.f66704j.a(14, new a70.a() {
@Override
public final void invoke(Object obj8) {
((mp0.b) obj8).a(na0.this);
}
});
}
if (z13) {
this.f66704j.a(3, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.d(gp0.this, (mp0.b) obj8);
}
});
}
if (z14 || z12) {
this.f66704j.a(-1, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.e(gp0.this, (mp0.b) obj8);
}
});
}
if (z14) {
this.f66704j.a(4, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.f(gp0.this, (mp0.b) obj8);
}
});
}
if (z12) {
this.f66704j.a(5, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.b(gp0.this, i12, (mp0.b) obj8);
}
});
}
if (gp0Var2.f65780m != gp0Var.f65780m) {
this.f66704j.a(6, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.g(gp0.this, (mp0.b) obj8);
}
});
}
if ((gp0Var2.f65772e == 3 && gp0Var2.f65779l && gp0Var2.f65780m == 0) != (gp0Var.f65772e == 3 && gp0Var.f65779l && gp0Var.f65780m == 0)) {
this.f66704j.a(7, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.h(gp0.this, (mp0.b) obj8);
}
});
}
if (!gp0Var2.f65781n.equals(gp0Var.f65781n)) {
this.f66704j.a(12, new a70.a() {
@Override
public final void invoke(Object obj8) {
jr.i(gp0.this, (mp0.b) obj8);
}
});
}
h();
this.f66704j.a();
if (gp0Var2.f65782o != gp0Var.f65782o) {
Iterator<gr.a> it = this.f66705k.iterator();
while (it.hasNext()) {
it.next().a();
}
}
}
public static void a(gp0 gp0Var, int i11, mp0.b bVar) {
t41 t41Var = gp0Var.f65768a;
bVar.a(i11);
}
public static void a(int i11, mp0.c cVar, mp0.c cVar2, mp0.b bVar) {
bVar.c();
bVar.a(cVar, cVar2, i11);
}
public static void a(gp0 gp0Var, mp0.b bVar) {
bVar.a(gp0Var.f65773f);
}
private static long a(gp0 gp0Var) {
t41.d dVar = new t41.d();
t41.b bVar = new t41.b();
gp0Var.f65768a.a(gp0Var.f65769b.f69547a, bVar);
long j11 = gp0Var.f65770c;
if (j11 == C.TIME_UNSET) {
return gp0Var.f65768a.a(bVar.f69769c, dVar, 0L).f69794m;
}
return bVar.f69771e + j11;
}
private gp0 a(gp0 gp0Var, t41 t41Var, @Nullable Pair<Object, Long> pair) {
wa0.b bVar;
n51 n51Var;
gp0 a11;
long j11;
w9.a(t41Var.c() || pair != null);
t41 t41Var2 = gp0Var.f65768a;
gp0 a12 = gp0Var.a(t41Var);
if (t41Var.c()) {
wa0.b a13 = gp0.a();
long a14 = b81.a(this.Z);
gp0 a15 = a12.a(a13, a14, a14, a14, 0L, g51.f65589d, this.f66696b, com.yandex.mobile.ads.embedded.guava.collect.p.i()).a(a13);
a15.f65783p = a15.f65785r;
return a15;
}
Object obj = a12.f65769b.f69547a;
int i11 = b81.f63986a;
boolean z11 = !obj.equals(pair.first);
wa0.b bVar2 = z11 ? new wa0.b(pair.first) : a12.f65769b;
long longValue = ((Long) pair.second).longValue();
long a16 = b81.a(getContentPosition());
if (!t41Var2.c()) {
a16 -= t41Var2.a(obj, this.f66706l).f69771e;
}
if (z11 || longValue < a16) {
w9.b(!bVar2.a());
g51 g51Var = z11 ? g51.f65589d : a12.f65775h;
if (z11) {
bVar = bVar2;
n51Var = this.f66696b;
} else {
bVar = bVar2;
n51Var = a12.f65776i;
}
gp0 a17 = a12.a(bVar, longValue, longValue, longValue, 0L, g51Var, n51Var, z11 ? com.yandex.mobile.ads.embedded.guava.collect.p.i() : a12.f65777j).a(bVar);
a17.f65783p = longValue;
return a17;
}
if (longValue == a16) {
int a18 = t41Var.a(a12.f65778k.f69547a);
if (a18 != -1 && t41Var.a(a18, this.f66706l, false).f69769c == t41Var.a(bVar2.f69547a, this.f66706l).f69769c) {
return a12;
}
t41Var.a(bVar2.f69547a, this.f66706l);
if (bVar2.a()) {
j11 = this.f66706l.a(bVar2.f69548b, bVar2.f69549c);
} else {
j11 = this.f66706l.f69770d;
}
a11 = a12.a(bVar2, a12.f65785r, a12.f65785r, a12.f65771d, j11 - a12.f65785r, a12.f65775h, a12.f65776i, a12.f65777j).a(bVar2);
a11.f65783p = j11;
} else {
w9.b(!bVar2.a());
long max = Math.max(0L, a12.f65784q - (longValue - a16));
long j12 = a12.f65783p;
if (a12.f65778k.equals(a12.f65769b)) {
j12 = longValue + max;
}
a11 = a12.a(bVar2, longValue, longValue, longValue, max, a12.f65775h, a12.f65776i, a12.f65777j);
a11.f65783p = j12;
}
return a11;
}
@Nullable
private Pair<Object, Long> a(t41 t41Var, int i11, long j11) {
if (t41Var.c()) {
this.Y = i11;
if (j11 == C.TIME_UNSET) {
j11 = 0;
}
this.Z = j11;
return null;
}
if (i11 == -1 || i11 >= t41Var.b()) {
i11 = t41Var.a(false);
j11 = b81.b(t41Var.a(i11, this.f66618a, 0L).f69794m);
}
return t41Var.a(this.f66618a, this.f66706l, i11, b81.a(j11));
}
public void a(@Nullable Surface surface) {
ArrayList arrayList = new ArrayList();
boolean z11 = false;
for (qt0 qt0Var : this.f66700f) {
if (qt0Var.m() == 2) {
int c11 = c();
lr lrVar = this.f66703i;
arrayList.add(new qp0(lrVar, qt0Var, this.X.f65768a, c11 == -1 ? 0 : c11, this.f66713s, lrVar.d()).a(1).a(surface).e());
}
}
Object obj = this.J;
if (obj != null && obj != surface) {
try {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((qp0) it.next()).a(this.f66720z);
}
} catch (InterruptedException unused) {
Thread.currentThread().interrupt();
} catch (TimeoutException unused2) {
z11 = true;
}
Object obj2 = this.J;
Surface surface2 = this.K;
if (obj2 == surface2) {
surface2.release();
this.K = null;
}
}
this.J = surface;
if (z11) {
a(fr.a(new vr(3), 1003));
}
}
public void a(final int i11, final int i12) {
if (i11 == this.N && i12 == this.O) {
return;
}
this.N = i11;
this.O = i12;
a70<mp0.b> a70Var = this.f66704j;
a70Var.a(24, new a70.a() {
@Override
public final void invoke(Object obj) {
((mp0.b) obj).onSurfaceSizeChanged(i11, i12);
}
});
a70Var.a();
}
public void a(int i11, int i12, boolean z11) {
int i13 = 0;
boolean z12 = z11 && i11 != -1;
if (z12 && i11 != 1) {
i13 = 1;
}
gp0 gp0Var = this.X;
if (gp0Var.f65779l == z12 && gp0Var.f65780m == i13) {
return;
}
this.A++;
gp0 gp0Var2 = new gp0(gp0Var.f65768a, gp0Var.f65769b, gp0Var.f65770c, gp0Var.f65771d, gp0Var.f65772e, gp0Var.f65773f, gp0Var.f65774g, gp0Var.f65775h, gp0Var.f65776i, gp0Var.f65777j, gp0Var.f65778k, z12, i13, gp0Var.f65781n, gp0Var.f65783p, gp0Var.f65784q, gp0Var.f65785r, gp0Var.f65782o);
this.f66703i.a(z12, i13);
a(gp0Var2, 0, i12, false, 5, C.TIME_UNSET);
}
private void a(int i11, int i12, @Nullable Object obj) {
for (qt0 qt0Var : this.f66700f) {
if (qt0Var.m() == i11) {
int c11 = c();
lr lrVar = this.f66703i;
new qp0(lrVar, qt0Var, this.X.f65768a, c11 == -1 ? 0 : c11, this.f66713s, lrVar.d()).a(i12).a(obj).e();
}
}
}
}