package com.google.android.gms.internal.ads;

import android.content.Context;
import android.media.MediaFormat;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
import android.os.Trace;
import android.util.Pair;
import androidx.annotation.Nullable;
import androidx.media3.common.PlaybackException;
import androidx.media3.exoplayer.MediaPeriodQueue;
import androidx.media3.exoplayer.analytics.AnalyticsListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class ci2 implements Handler.Callback, zo2, i, ui2, ah2, yi2, m10, b1 {
    public static final long D0 = bb1.o(10000);
    public boolean A0;
    public final wg2 C0;
    public final bh2 Q;
    public final ArrayList R;
    public final sl0 S;
    public final ai2 T;
    public final li2 U;
    public final vi2 V;
    public final long W;
    public final mk2 X;
    public final mj2 Y;
    public final sq0 Z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final hj2[] f9909a;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public final boolean f9910a0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final pf2[] f9911b;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public final d20 f9912b0;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final boolean[] f9913c;

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public jj2 f9914c0;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final j f9915d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final k f9917e;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final fi2 f9919f;

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final q f9921g;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public int f9922g0;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final sq0 f9923h;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public wi2 f9924h0;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final xi2 f9925i;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public zh2 f9926i0;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final Looper f9927j;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final tj f9929k;

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

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

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

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

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

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

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    public int f9940s0;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public long f9941t0;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public long f9942u0;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public int f9943v0;

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

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    public gh2 f9946y0;

    @Nullable
    private bi2 zzE;

    @Nullable
    private bi2 zzS;

    @Nullable
    private zziw zzX;
    public long z0 = -9223372036854775807L;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    public int f9937p0 = 0;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public boolean f9938q0 = false;

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public boolean f9930k0 = false;
    public float B0 = 1.0f;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public ij2 f9916d0 = ij2.f12541b;

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

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

    public ci2(Context context, ej2[] ej2VarArr, ej2[] ej2VarArr2, j jVar, k kVar, fi2 fi2Var, q qVar, int i10, boolean z10, mj2 mj2Var, jj2 jj2Var, wg2 wg2Var, long j10, boolean z11, boolean z12, Looper looper, sl0 sl0Var, ai2 ai2Var, mk2 mk2Var, @Nullable xi2 xi2Var, gh2 gh2Var, b1 b1Var) {
        this.T = ai2Var;
        this.f9915d = jVar;
        this.f9917e = kVar;
        this.f9919f = fi2Var;
        this.f9921g = qVar;
        this.f9914c0 = jj2Var;
        this.C0 = wg2Var;
        this.W = j10;
        this.S = sl0Var;
        this.X = mk2Var;
        this.f9946y0 = gh2Var;
        this.Y = mj2Var;
        this.f9933m = fi2Var.zzf();
        fi2Var.zzg();
        mi miVar = mk.f14242a;
        wi2 wi2VarA = wi2.a(kVar);
        this.f9924h0 = wi2VarA;
        this.f9926i0 = new zh2(wi2VarA);
        int length = ej2VarArr.length;
        this.f9911b = new pf2[2];
        this.f9913c = new boolean[2];
        fj2 fj2VarZzg = jVar.zzg();
        this.f9909a = new hj2[2];
        boolean z13 = false;
        for (int i11 = 0; i11 < 2; i11++) {
            ej2 ej2Var = ej2VarArr[i11];
            pf2 pf2Var = (pf2) ej2Var;
            pf2Var.f15396d = i11;
            pf2Var.f15397e = mk2Var;
            pf2Var.f15398f = sl0Var;
            pf2[] pf2VarArr = this.f9911b;
            pf2 pf2Var2 = (pf2) ej2Var;
            pf2Var2.getClass();
            pf2VarArr[i11] = pf2Var2;
            this.f9911b[i11].E(fj2VarZzg);
            ej2 ej2Var2 = ej2VarArr2[i11];
            if (ej2Var2 != null) {
                pf2 pf2Var3 = (pf2) ej2Var2;
                pf2Var3.f15396d = i11;
                pf2Var3.f15397e = mk2Var;
                pf2Var3.f15398f = sl0Var;
                z13 = true;
            }
            this.f9909a[i11] = new hj2(ej2VarArr[i11], ej2Var2, i11);
        }
        this.f9910a0 = z13;
        this.Q = new bh2(this);
        this.R = new ArrayList();
        this.f9929k = new tj();
        this.f9931l = new gj();
        jVar.c(this, qVar);
        this.f9944w0 = true;
        h71 h71Var = (h71) sl0Var;
        sq0 sq0VarZzd = h71Var.zzd(looper, null);
        this.Z = sq0VarZzd;
        this.U = new li2(mj2Var, sq0VarZzd, new jc1(this, 20), gh2Var);
        this.V = new vi2(this, mj2Var, sq0VarZzd, mk2Var);
        xi2 xi2Var2 = new xi2(null);
        this.f9925i = xi2Var2;
        Looper looperA = xi2Var2.a();
        this.f9927j = looperA;
        sq0 sq0VarZzd2 = h71Var.zzd(looperA, this);
        this.f9923h = sq0VarZzd2;
        this.f9912b0 = new d20(context, looperA, this);
        ((u71) ((h81) sq0VarZzd2).zzd(35, new b1() { // from class: com.google.android.gms.internal.ads.wh2
            @Override // com.google.android.gms.internal.ads.b1
            public final /* synthetic */ void zzcS(long j11, long j12, zn2 zn2Var, MediaFormat mediaFormat) {
                this.f18062a.zzcS(j11, j12, zn2Var, mediaFormat);
            }
        })).a();
    }

    public static int S(tj tjVar, gj gjVar, int i10, boolean z10, Object obj, mk mkVar, mk mkVar2) {
        Object obj2 = mkVar.b(mkVar.n(obj, gjVar).f11762a, tjVar, 0L).f16910a;
        for (int i11 = 0; i11 < mkVar2.a(); i11++) {
            if (mkVar2.b(i11, tjVar, 0L).f16910a.equals(obj2)) {
                return i11;
            }
        }
        int iE = mkVar.e(obj);
        int iC = mkVar.c();
        int iL = iE;
        int i12 = 0;
        int iE2 = -1;
        while (true) {
            if (i12 >= iC || iE2 != -1) {
                break;
            }
            iL = mkVar.l(iL, gjVar, tjVar, i10, z10);
            if (iL == -1) {
                iE2 = -1;
                break;
            }
            iE2 = mkVar2.e(mkVar.f(iL));
            i12++;
        }
        if (iE2 == -1) {
            return -1;
        }
        return mkVar2.d(iE2, gjVar, false).f11762a;
    }

    public static final void w(aj2 aj2Var) {
        synchronized (aj2Var) {
        }
        try {
            aj2Var.f8715a.zzx(aj2Var.f8717c, aj2Var.zze());
        } finally {
            aj2Var.c(true);
        }
    }

    @Nullable
    private static Pair zzaD(mk mkVar, bi2 bi2Var, boolean z10, int i10, boolean z11, tj tjVar, gj gjVar) {
        Pair pairM;
        mk mkVar2 = bi2Var.f9551a;
        if (mkVar.g()) {
            return null;
        }
        mk mkVar3 = true == mkVar2.g() ? mkVar : mkVar2;
        try {
            pairM = mkVar3.m(tjVar, gjVar, bi2Var.f9552b, bi2Var.f9553c);
        } catch (IndexOutOfBoundsException unused) {
        }
        if (mkVar.equals(mkVar3)) {
            return pairM;
        }
        if (mkVar.e(pairM.first) != -1) {
            return (mkVar3.n(pairM.first, gjVar).f11764c && mkVar3.b(gjVar.f11762a, tjVar, 0L).f16919j == mkVar3.e(pairM.first)) ? mkVar.m(tjVar, gjVar, mkVar.n(pairM.first, gjVar).f11762a, bi2Var.f9553c) : pairM;
        }
        int iS = S(tjVar, gjVar, i10, z11, pairM.first, mkVar3, mkVar);
        if (iS != -1) {
            return mkVar.m(tjVar, gjVar, iS, -9223372036854775807L);
        }
        return null;
    }

    private static final boolean zzaF(@Nullable ji2 ji2Var) {
        if (ji2Var != null) {
            try {
                ap2 ap2Var = ji2Var.f12877a;
                if (ji2Var.f12881e) {
                    kq2[] kq2VarArr = ji2Var.f12879c;
                    for (int i10 = 0; i10 < 2; i10++) {
                        kq2 kq2Var = kq2VarArr[i10];
                        if (kq2Var != null) {
                            kq2Var.zzc();
                        }
                    }
                } else {
                    ap2Var.a();
                }
                if ((!ji2Var.f12881e ? 0L : ap2Var.zzl()) != Long.MIN_VALUE) {
                    return true;
                }
            } catch (IOException unused) {
            }
        }
        return false;
    }

    public final boolean A() {
        ji2 ji2VarZzm = this.U.zzm();
        long j10 = ji2VarZzm.f12883g.f13275e;
        if (!ji2VarZzm.f12881e) {
            return false;
        }
        if (j10 == -9223372036854775807L || this.f9924h0.f18080q < j10) {
            return true;
        }
        return !P();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:228:0x0428  */
    /* JADX WARN: Removed duplicated region for block: B:231:0x043a  */
    /* JADX WARN: Removed duplicated region for block: B:233:0x0442  */
    /* JADX WARN: Removed duplicated region for block: B:241:0x045f  */
    /* JADX WARN: Removed duplicated region for block: B:243:0x0463  */
    /* JADX WARN: Removed duplicated region for block: B:244:0x0466  */
    /* JADX WARN: Removed duplicated region for block: B:247:0x0472  */
    /* JADX WARN: Removed duplicated region for block: B:248:0x0475  */
    /* JADX WARN: Removed duplicated region for block: B:252:0x049e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void B(mk mkVar, boolean z10) throws Throwable {
        cp2 cp2Var;
        gj gjVar;
        long j10;
        long j11;
        tj tjVar;
        long j12;
        Object obj;
        int iK;
        long jMax;
        boolean z11;
        boolean z12;
        int i10;
        boolean z13;
        long j13;
        long jMin;
        cp2 cp2Var2;
        long jD;
        cp2 cp2Var3;
        boolean z14;
        int i11;
        boolean z15;
        long jP;
        int i12;
        long jLongValue;
        int iK2;
        int i13;
        boolean z16;
        int i14;
        boolean z17;
        ci2 ci2Var;
        int i15;
        int i16;
        int i17;
        boolean z18;
        bi2 bi2Var;
        int i18;
        boolean z19;
        ci2 ci2Var2 = this;
        wi2 wi2Var = ci2Var2.f9924h0;
        bi2 bi2Var2 = ci2Var2.zzS;
        int i19 = ci2Var2.f9937p0;
        boolean z20 = ci2Var2.f9938q0;
        int i20 = -1;
        if (mkVar.g()) {
            cp2Var3 = wi2.f18063s;
            j10 = -9223372036854775807L;
            z14 = true;
            z15 = false;
            i11 = 0;
            jP = 0;
            jD = 0;
            ci2Var = ci2Var2;
        } else {
            gj gjVar2 = ci2Var2.f9931l;
            cp2 cp2Var4 = wi2Var.f18065b;
            Object obj2 = cp2Var4.f10025a;
            mk mkVar2 = wi2Var.f18064a;
            boolean z21 = mkVar2.g() || mkVar2.n(cp2Var4.f10025a, gjVar2).f11764c;
            long j14 = (cp2Var4.b() || z21) ? wi2Var.f18066c : wi2Var.f18080q;
            tj tjVar2 = ci2Var2.f9929k;
            if (bi2Var2 != null) {
                cp2Var = cp2Var4;
                long j15 = j14;
                Pair pairZzaD = zzaD(mkVar, bi2Var2, true, i19, z20, tjVar2, gjVar2);
                if (pairZzaD == null) {
                    iK2 = mkVar.k(z20);
                    obj = obj2;
                    gjVar = gjVar2;
                    jLongValue = j15;
                    z16 = false;
                    i14 = 0;
                    z17 = true;
                } else {
                    if (bi2Var2.f9553c == -9223372036854775807L) {
                        gjVar = gjVar2;
                        iK2 = mkVar.n(pairZzaD.first, gjVar).f11762a;
                        obj = obj2;
                        jLongValue = j15;
                        i13 = 0;
                    } else {
                        gjVar = gjVar2;
                        obj = pairZzaD.first;
                        jLongValue = ((Long) pairZzaD.second).longValue();
                        iK2 = -1;
                        i13 = 1;
                    }
                    z16 = wi2Var.f18068e == 4;
                    i14 = i13;
                    z17 = false;
                }
                i10 = i14;
                z12 = z17;
                j12 = 0;
                iK = iK2;
                z11 = z16;
                tjVar = tjVar2;
                j11 = j15;
                j10 = jLongValue;
            } else {
                cp2Var = cp2Var4;
                gjVar = gjVar2;
                j10 = j14;
                mk mkVar3 = wi2Var.f18064a;
                if (mkVar3.g()) {
                    iK = mkVar.k(z20);
                    obj = obj2;
                    tjVar = tjVar2;
                    j11 = j10;
                    j12 = 0;
                } else if (mkVar.e(obj2) == -1) {
                    int iS = S(tjVar2, gjVar, i19, z20, obj2, mkVar3, mkVar);
                    if (iS == -1) {
                        iS = mkVar.k(z20);
                        z13 = true;
                    } else {
                        z13 = false;
                    }
                    iK = iS;
                    z12 = z13;
                    obj = obj2;
                    tjVar = tjVar2;
                    j11 = j10;
                    j12 = 0;
                    z11 = false;
                    i10 = 0;
                } else if (j10 == -9223372036854775807L) {
                    j10 = j10;
                    obj = obj2;
                    tjVar = tjVar2;
                    j12 = 0;
                    z11 = false;
                    z12 = false;
                    i10 = 0;
                    iK = mkVar.n(obj2, gjVar).f11762a;
                    j11 = j10;
                } else if (z21) {
                    mkVar3.n(obj2, gjVar);
                    tjVar = tjVar2;
                    if (mkVar3.b(gjVar.f11762a, tjVar, 0L).f16919j == mkVar3.e(obj2)) {
                        j12 = 0;
                        j11 = j10;
                        Pair pairM = mkVar.m(tjVar, gjVar, mkVar.n(obj2, gjVar).f11762a, j11);
                        obj = pairM.first;
                        jMax = ((Long) pairM.second).longValue();
                    } else {
                        j12 = 0;
                        if (mkVar.n(obj2, gjVar).f11763b != -9223372036854775807L) {
                            long j16 = gjVar.f11763b - 1;
                            String str = bb1.f9474a;
                            j11 = j10;
                            jMax = Math.max(0L, Math.min(j11, j16));
                        } else {
                            j11 = j10;
                            jMax = j11;
                        }
                        obj = obj2;
                    }
                    j10 = jMax;
                    iK = -1;
                    z11 = false;
                    z12 = false;
                    i10 = 1;
                } else {
                    j11 = j10;
                    tjVar = tjVar2;
                    j12 = 0;
                    j10 = j11;
                    obj = obj2;
                    iK = -1;
                }
                z11 = false;
                z12 = false;
                i10 = 0;
            }
            if (iK != -1) {
                j13 = j11;
                Pair pairM2 = mkVar.m(tjVar, gjVar, iK, -9223372036854775807L);
                obj = pairM2.first;
                jMin = ((Long) pairM2.second).longValue();
                j10 = -9223372036854775807L;
            } else {
                j13 = j11;
                jMin = j10;
            }
            ci2 ci2Var3 = this;
            cp2 cp2VarZ = ci2Var3.U.z(mkVar, obj, jMin);
            boolean zEquals = obj2.equals(obj);
            boolean z22 = (!zEquals || cp2Var.b() || cp2VarZ.b()) ? false : true;
            gj gjVarN = mkVar.n(obj, gjVar);
            if (!z21 && j13 == j10 && obj2.equals(cp2VarZ.f10025a)) {
                if (cp2Var.b()) {
                    cp2Var2 = cp2Var;
                    gjVarN.b(cp2Var2.f10026b);
                } else {
                    cp2Var2 = cp2Var;
                }
                if (cp2VarZ.b()) {
                    gjVarN.b(-1);
                }
            } else {
                cp2Var2 = cp2Var;
            }
            if (true == z22) {
                cp2VarZ = cp2Var2;
            }
            if (!cp2VarZ.b()) {
                if (zEquals && cp2Var2.b()) {
                    a aVarA = mkVar.n(obj, gjVar).f11765d.a(cp2Var2.f10026b);
                    aVarA.getClass();
                    long j17 = wi2Var.f18066c;
                    jD = 0;
                    if (j17 == -9223372036854775807L || j17 < 0) {
                        int i21 = aVarA.f8426a;
                        int i22 = cp2Var2.f10027c;
                        if (i21 > i22 && aVarA.f8429d[i22] == 2) {
                            long j18 = mkVar.n(obj, gjVar).f11763b;
                            if (j18 != -9223372036854775807L) {
                                jMin = Math.min(j18 - 1, jMin);
                            }
                            j10 = jMin;
                        }
                    }
                }
                cp2Var3 = cp2VarZ;
                z14 = z12;
                i11 = i10;
                long j19 = jMin;
                z15 = z11;
                jP = j19;
                ci2Var = ci2Var3;
            } else if (cp2VarZ.equals(cp2Var2)) {
                jMin = wi2Var.f18080q;
            } else {
                mkVar.n(cp2VarZ.f10025a, gjVar);
                int i23 = cp2VarZ.f10027c;
                a aVarA2 = gjVar.f11765d.a(cp2VarZ.f10026b);
                int i24 = 0;
                while (true) {
                    int[] iArr = aVarA2.f8429d;
                    if (i24 >= iArr.length || (i12 = iArr[i24]) == 0 || i12 == 1) {
                        break;
                    } else {
                        i24++;
                    }
                }
                if (i23 == i24) {
                    gjVar.f11765d.getClass();
                }
                jMin = 0;
            }
            jD = 0;
            cp2Var3 = cp2VarZ;
            z14 = z12;
            i11 = i10;
            long j192 = jMin;
            z15 = z11;
            jP = j192;
            ci2Var = ci2Var3;
        }
        boolean z23 = (ci2Var.f9924h0.f18065b.equals(cp2Var3) && jP == ci2Var.f9924h0.f18080q) ? false : true;
        if (z14) {
            try {
                if (ci2Var.f9924h0.f18068e != 1) {
                    i16 = 4;
                    try {
                        ci2Var.b(4);
                    } catch (Throwable th) {
                        th = th;
                        i10 = 4;
                        i17 = 0;
                        bi2Var = null;
                        z18 = i17;
                        wi2 wi2Var2 = ci2Var.f9924h0;
                        bi2 bi2Var3 = bi2Var;
                        C(mkVar, cp2Var3, wi2Var2.f18064a, wi2Var2.f18065b, 1 == i11 ? jP : -9223372036854775807L, false);
                        if (!z23 || j10 != ci2Var.f9924h0.f18066c) {
                            wi2 wi2Var3 = ci2Var.f9924h0;
                            Object obj3 = wi2Var3.f18065b.f10025a;
                            mk mkVar4 = wi2Var3.f18064a;
                            boolean z24 = (z23 || !z10 || mkVar4.g() || mkVar4.n(obj3, ci2Var.f9931l).f11764c) ? z18 : true;
                            ci2Var.f9924h0 = J(cp2Var3, jP, j10, !z24 ? jP : ci2Var.f9924h0.f18067d, z24, mkVar.e(obj3) != -1 ? i10 : 3);
                        }
                        F();
                        ci2Var.u(mkVar, ci2Var.f9924h0.f18064a);
                        ci2Var.f9924h0 = ci2Var.f9924h0.c(mkVar);
                        if (!mkVar.g()) {
                            ci2Var.zzS = bi2Var3;
                        }
                        ci2Var.M(z18);
                        ((h81) ci2Var.f9923h).a(2);
                        throw th;
                    }
                } else {
                    i16 = 4;
                }
                i15 = 0;
            } catch (Throwable th2) {
                th = th2;
                i15 = 0;
                i16 = 4;
                i17 = i15;
                i10 = i16;
                bi2Var = null;
                z18 = i17;
                wi2 wi2Var22 = ci2Var.f9924h0;
                bi2 bi2Var32 = bi2Var;
                C(mkVar, cp2Var3, wi2Var22.f18064a, wi2Var22.f18065b, 1 == i11 ? jP : -9223372036854775807L, false);
                if (!z23) {
                    wi2 wi2Var32 = ci2Var.f9924h0;
                    Object obj32 = wi2Var32.f18065b.f10025a;
                    mk mkVar42 = wi2Var32.f18064a;
                    if (z23) {
                        ci2Var.f9924h0 = J(cp2Var3, jP, j10, !z24 ? jP : ci2Var.f9924h0.f18067d, z24, mkVar.e(obj32) != -1 ? i10 : 3);
                    }
                }
                F();
                ci2Var.u(mkVar, ci2Var.f9924h0.f18064a);
                ci2Var.f9924h0 = ci2Var.f9924h0.c(mkVar);
                if (!mkVar.g()) {
                }
                ci2Var.M(z18);
                ((h81) ci2Var.f9923h).a(2);
                throw th;
            }
            try {
                ci2Var.s(false, false, false, true);
            } catch (Throwable th3) {
                th = th3;
                i17 = i15;
                i10 = i16;
                bi2Var = null;
                z18 = i17;
                wi2 wi2Var222 = ci2Var.f9924h0;
                bi2 bi2Var322 = bi2Var;
                C(mkVar, cp2Var3, wi2Var222.f18064a, wi2Var222.f18065b, 1 == i11 ? jP : -9223372036854775807L, false);
                if (!z23) {
                }
                F();
                ci2Var.u(mkVar, ci2Var.f9924h0.f18064a);
                ci2Var.f9924h0 = ci2Var.f9924h0.c(mkVar);
                if (!mkVar.g()) {
                }
                ci2Var.M(z18);
                ((h81) ci2Var.f9923h).a(2);
                throw th;
            }
        } else {
            i15 = 0;
            i16 = 4;
        }
        hj2[] hj2VarArr = ci2Var.f9909a;
        for (int i25 = i15; i25 < 2; i25++) {
            hj2VarArr[i25].C(mkVar);
        }
        try {
            if (z23) {
                int i26 = i15;
                i18 = i16;
                z19 = i26;
                if (!mkVar.g()) {
                    li2 li2Var = ci2Var.U;
                    for (ji2 ji2VarZzm = li2Var.zzm(); ji2VarZzm != null; ji2VarZzm = ji2VarZzm.zzp()) {
                        if (ji2VarZzm.f12883g.f13271a.equals(cp2Var3)) {
                            ki2 ki2VarY = li2Var.y(mkVar, ji2VarZzm.f12883g);
                            ji2VarZzm.f12883g = ki2VarY;
                            ap2 ap2Var = ji2VarZzm.f12877a;
                            if (ap2Var instanceof jo2) {
                                long j20 = ki2VarY.f13274d;
                                if (j20 == -9223372036854775807L) {
                                    j20 = Long.MIN_VALUE;
                                }
                                ((jo2) ap2Var).f12951d = j20;
                            }
                        }
                    }
                    li2 li2Var2 = ci2Var.U;
                    jP = p(cp2Var3, jP, li2Var2.zzm() != li2Var2.zzn() ? true : i26 == true ? 1 : 0, z15);
                    z19 = i26;
                }
            } else {
                try {
                    li2 li2Var3 = ci2Var.U;
                    long jD2 = li2Var3.zzn() == null ? jD : ci2Var.D(li2Var3.zzn());
                    if (R() && li2Var3.zzo() != null) {
                        jD = ci2Var.D(li2Var3.zzo());
                    }
                    boolean z25 = i15;
                    long j21 = jD2;
                    i18 = i16;
                    int iX = li2Var3.x(mkVar, ci2Var.f9941t0, j21, jD);
                    if ((iX & 1) != 0) {
                        ci2Var.g(z25);
                        z19 = z25;
                    } else {
                        z19 = z25;
                        if ((iX & 2) != 0) {
                            y();
                            z19 = z25;
                        }
                    }
                } catch (Throwable th4) {
                    th = th4;
                    i20 = i15;
                    i10 = i16;
                    bi2Var = null;
                    z18 = i20;
                    wi2 wi2Var2222 = ci2Var.f9924h0;
                    bi2 bi2Var3222 = bi2Var;
                    C(mkVar, cp2Var3, wi2Var2222.f18064a, wi2Var2222.f18065b, 1 == i11 ? jP : -9223372036854775807L, false);
                    if (!z23) {
                    }
                    F();
                    ci2Var.u(mkVar, ci2Var.f9924h0.f18064a);
                    ci2Var.f9924h0 = ci2Var.f9924h0.c(mkVar);
                    if (!mkVar.g()) {
                    }
                    ci2Var.M(z18);
                    ((h81) ci2Var.f9923h).a(2);
                    throw th;
                }
            }
            wi2 wi2Var4 = ci2Var.f9924h0;
            C(mkVar, cp2Var3, wi2Var4.f18064a, wi2Var4.f18065b, 1 != i11 ? -9223372036854775807L : jP, false);
            if (z23 || j10 != ci2Var.f9924h0.f18066c) {
                wi2 wi2Var5 = ci2Var.f9924h0;
                Object obj4 = wi2Var5.f18065b.f10025a;
                mk mkVar5 = wi2Var5.f18064a;
                boolean z26 = (!z23 || !z10 || mkVar5.g() || mkVar5.n(obj4, ci2Var.f9931l).f11764c) ? z19 : true;
                ci2Var.f9924h0 = J(cp2Var3, jP, j10, z26 ? jP : ci2Var.f9924h0.f18067d, z26, mkVar.e(obj4) == -1 ? i18 : 3);
            }
            F();
            ci2Var.u(mkVar, ci2Var.f9924h0.f18064a);
            ci2Var.f9924h0 = ci2Var.f9924h0.c(mkVar);
            if (!mkVar.g()) {
                ci2Var.zzS = null;
            }
            ci2Var.M(z19);
            ((h81) ci2Var.f9923h).a(2);
        } catch (Throwable th5) {
            th = th5;
        }
    }

    public final void C(mk mkVar, cp2 cp2Var, mk mkVar2, cp2 cp2Var2, long j10, boolean z10) {
        if (!m(mkVar, cp2Var)) {
            wd wdVar = cp2Var.b() ? wd.f18030d : this.f9924h0.f18077n;
            bh2 bh2Var = this.Q;
            if (bh2Var.zzj().equals(wdVar)) {
                return;
            }
            ((h81) this.f9923h).b(16);
            bh2Var.c(wdVar);
            G(this.f9924h0.f18077n, wdVar.f18031a, false, false);
            return;
        }
        Object obj = cp2Var.f10025a;
        gj gjVar = this.f9931l;
        int i10 = mkVar.n(obj, gjVar).f11762a;
        tj tjVar = this.f9929k;
        mkVar.b(i10, tjVar, 0L);
        s2 s2Var = tjVar.zzj;
        String str = bb1.f9474a;
        wg2 wg2Var = this.C0;
        wg2Var.getClass();
        s2Var.getClass();
        long jP = bb1.p(-9223372036854775807L);
        wg2Var.f18046c = jP;
        wg2Var.f18049f = jP;
        wg2Var.f18050g = jP;
        wg2Var.f18053j = 0.97f;
        wg2Var.f18052i = 1.03f;
        wg2Var.c();
        if (j10 != -9223372036854775807L) {
            wg2Var.f18047d = l(mkVar, obj, j10);
            wg2Var.c();
            return;
        }
        if (!Objects.equals(!mkVar2.g() ? mkVar2.b(mkVar2.n(cp2Var2.f10025a, gjVar).f11762a, tjVar, 0L).f16910a : null, tjVar.f16910a) || z10) {
            wg2Var.f18047d = -9223372036854775807L;
            wg2Var.c();
        }
    }

    public final long D(ji2 ji2Var) {
        if (ji2Var == null) {
            return 0L;
        }
        long jMax = ji2Var.f12891o;
        if (ji2Var.f12881e) {
            for (int i10 = 0; i10 < 2; i10++) {
                hj2[] hj2VarArr = this.f9909a;
                if (hj2VarArr[i10].zzp(ji2Var)) {
                    long jZzf = hj2VarArr[i10].zzf(ji2Var);
                    if (jZzf == Long.MIN_VALUE) {
                        return Long.MIN_VALUE;
                    }
                    jMax = Math.max(jZzf, jMax);
                }
            }
        }
        return jMax;
    }

    public final void E() {
        li2 li2Var = this.U;
        li2Var.v();
        ji2 ji2VarZzl = li2Var.zzl();
        if (ji2VarZzl != null) {
            if (!ji2VarZzl.f12880d || ji2VarZzl.f12881e) {
                ap2 ap2Var = ji2VarZzl.f12877a;
                if (ap2Var.zzn()) {
                    return;
                }
                mk mkVar = this.f9924h0.f18064a;
                cp2 cp2Var = ji2VarZzl.f12883g.f13271a;
                if (ji2VarZzl.f12881e) {
                    ap2Var.zzi();
                }
                if (this.f9919f.zzj()) {
                    boolean z10 = true;
                    if (!ji2VarZzl.f12880d) {
                        long j10 = ji2VarZzl.f12883g.f13272b;
                        ji2VarZzl.f12880d = true;
                        ap2Var.i(this, j10);
                        return;
                    }
                    gi2 gi2Var = new gi2();
                    gi2Var.f11759a = this.f9941t0 - ji2VarZzl.f12891o;
                    float f10 = this.Q.zzj().f18031a;
                    ih1.x(f10 > 0.0f || f10 == -3.4028235E38f);
                    gi2Var.f11760b = f10;
                    long j11 = this.f9935n0;
                    if (j11 < 0) {
                        if (j11 == -9223372036854775807L) {
                            j11 = -9223372036854775807L;
                        } else {
                            z10 = false;
                        }
                    }
                    ih1.x(z10);
                    gi2Var.f11761c = j11;
                    hi2 hi2Var = new hi2(gi2Var);
                    ih1.b1(ji2VarZzl.m());
                    ap2Var.g(hi2Var);
                }
            }
        }
    }

    public final void F() {
        ji2 ji2VarZzm = this.U.zzm();
        boolean z10 = false;
        if (ji2VarZzm != null && ji2VarZzm.f12883g.f13277g && this.f9930k0) {
            z10 = true;
        }
        this.f9932l0 = z10;
    }

    public final void G(wd wdVar, float f10, boolean z10, boolean z11) {
        int i10;
        if (z10) {
            if (z11) {
                this.f9926i0.a(1);
            }
            wi2 wi2Var = this.f9924h0;
            this.f9924h0 = new wi2(wi2Var.f18064a, wi2Var.f18065b, wi2Var.f18066c, wi2Var.f18067d, wi2Var.f18068e, wi2Var.zzf, wi2Var.f18069f, wi2Var.f18070g, wi2Var.f18071h, wi2Var.f18072i, wi2Var.f18073j, wi2Var.f18074k, wi2Var.f18075l, wi2Var.f18076m, wdVar, wi2Var.f18078o, wi2Var.f18079p, wi2Var.f18080q, wi2Var.f18081r, false);
        }
        float f11 = wdVar.f18031a;
        ji2 ji2VarZzm = this.U.zzm();
        while (true) {
            i10 = 0;
            if (ji2VarZzm == null) {
                break;
            }
            d[] dVarArr = ji2VarZzm.f12890n.f13048c;
            int length = dVarArr.length;
            while (i10 < length) {
                d dVar = dVarArr[i10];
                i10++;
            }
            ji2VarZzm = ji2VarZzm.zzp();
        }
        hj2[] hj2VarArr = this.f9909a;
        while (i10 < 2) {
            hj2VarArr[i10].B(f10, f11);
            i10++;
        }
    }

    public final void H() {
        boolean zE;
        boolean z10;
        li2 li2Var = this.U;
        long j10 = -9223372036854775807L;
        if (zzaF(li2Var.zzk())) {
            ji2 ji2VarZzk = li2Var.zzk();
            long jN = N(!ji2VarZzk.f12881e ? 0L : ji2VarZzk.f12877a.zzl());
            if (ji2VarZzk != li2Var.zzm()) {
                long j11 = ji2VarZzk.f12883g.f13272b;
            }
            long j12 = m(this.f9924h0.f18064a, ji2VarZzk.f12883g.f13271a) ? this.C0.f18051h : -9223372036854775807L;
            mk2 mk2Var = this.X;
            mk mkVar = this.f9924h0.f18064a;
            cp2 cp2Var = ji2VarZzk.f12883g.f13271a;
            float f10 = this.Q.zzj().f18031a;
            boolean z11 = this.f9924h0.f18074k;
            ei2 ei2Var = new ei2(mk2Var, mkVar, cp2Var, jN, f10, this.f9934m0, j12);
            fi2 fi2Var = this.f9919f;
            zE = fi2Var.e(ei2Var);
            ji2 ji2VarZzm = li2Var.zzm();
            if (!zE && ji2VarZzm.f12881e && jN < 500000 && this.f9933m > 0) {
                ji2VarZzm.f12877a.b(this.f9924h0.f18080q);
                zE = fi2Var.e(ei2Var);
            }
        } else {
            zE = false;
        }
        this.f9936o0 = zE;
        if (zE) {
            ji2 ji2VarZzk2 = li2Var.zzk();
            ji2VarZzk2.getClass();
            gi2 gi2Var = new gi2();
            gi2Var.f11759a = this.f9941t0 - ji2VarZzk2.f12891o;
            float f11 = this.Q.zzj().f18031a;
            ih1.x(f11 > 0.0f || f11 == -3.4028235E38f);
            gi2Var.f11760b = f11;
            long j13 = this.f9935n0;
            if (j13 < 0) {
                if (j13 != -9223372036854775807L) {
                    j10 = j13;
                    z10 = false;
                }
                ih1.x(z10);
                gi2Var.f11761c = j10;
                hi2 hi2Var = new hi2(gi2Var);
                ih1.b1(ji2VarZzk2.m());
                ji2VarZzk2.f12877a.g(hi2Var);
            } else {
                j10 = j13;
            }
            z10 = true;
            ih1.x(z10);
            gi2Var.f11761c = j10;
            hi2 hi2Var2 = new hi2(gi2Var);
            ih1.b1(ji2VarZzk2.m());
            ji2VarZzk2.f12877a.g(hi2Var2);
        }
        I();
    }

    public final void I() {
        ji2 ji2VarZzk = this.U.zzk();
        boolean z10 = true;
        if (!this.f9936o0 && (ji2VarZzk == null || !ji2VarZzk.f12877a.zzn())) {
            z10 = false;
        }
        wi2 wi2Var = this.f9924h0;
        if (z10 != wi2Var.f18069f) {
            this.f9924h0 = wi2Var.e(z10);
        }
    }

    public final wi2 J(cp2 cp2Var, long j10, long j11, long j12, boolean z10, int i10) {
        rq2 rq2Var;
        k kVar;
        List list;
        zzguf zzgufVarG;
        ji2 ji2VarZzm;
        rq2 rq2Var2;
        this.f9944w0 = (!this.f9944w0 && j10 == this.f9924h0.f18080q && cp2Var.equals(this.f9924h0.f18065b)) ? false : true;
        F();
        wi2 wi2Var = this.f9924h0;
        rq2 rq2Var3 = wi2Var.f18070g;
        k kVar2 = wi2Var.f18071h;
        List list2 = wi2Var.f18072i;
        if (this.V.f17648j) {
            li2 li2Var = this.U;
            ji2 ji2VarZzm2 = li2Var.zzm();
            rq2 rq2Var4 = ji2VarZzm2 == null ? rq2.f16203d : ji2VarZzm2.f12889m;
            k kVar3 = ji2VarZzm2 == null ? this.f9917e : ji2VarZzm2.f12890n;
            d[] dVarArr = kVar3.f13048c;
            as1 as1Var = new as1(4);
            int length = dVarArr.length;
            int i11 = 0;
            boolean z11 = false;
            while (i11 < length) {
                d dVar = dVarArr[i11];
                if (dVar != null) {
                    ta taVar = dVar.zzb(0).zzl;
                    if (taVar == null) {
                        rq2Var2 = rq2Var4;
                        as1Var.a(new ta(new z9[0]));
                    } else {
                        rq2Var2 = rq2Var4;
                        as1Var.a(taVar);
                        z11 = true;
                    }
                } else {
                    rq2Var2 = rq2Var4;
                }
                i11++;
                rq2Var4 = rq2Var2;
            }
            rq2 rq2Var5 = rq2Var4;
            if (z11) {
                zzgufVarG = as1Var.g();
            } else {
                bs1 bs1Var = zzguf.f19771b;
                zzgufVarG = zzgwa.f19786e;
            }
            if (ji2VarZzm2 != null) {
                ki2 ki2Var = ji2VarZzm2.f12883g;
                if (ki2Var.f13273c != j11) {
                    ji2VarZzm2.f12883g = ki2Var.b(j11);
                }
            }
            if (li2Var.zzm() == li2Var.zzn() && (ji2VarZzm = li2Var.zzm()) != null) {
                k kVar4 = ji2VarZzm.f12890n;
                int i12 = 0;
                while (true) {
                    hj2[] hj2VarArr = this.f9909a;
                    if (i12 >= 2) {
                        break;
                    }
                    if (kVar4.a(i12)) {
                        if (hj2VarArr[i12].u() != 1) {
                            break;
                        }
                        kVar4.f13047b[i12].getClass();
                    }
                    i12++;
                }
            }
            list = zzgufVarG;
            kVar = kVar3;
            rq2Var = rq2Var5;
        } else if (cp2Var.equals(wi2Var.f18065b)) {
            rq2Var = rq2Var3;
            kVar = kVar2;
            list = list2;
        } else {
            kVar = this.f9917e;
            rq2Var = rq2.f16203d;
            list = zzgwa.f19786e;
        }
        if (z10) {
            zh2 zh2Var = this.f9926i0;
            if (!zh2Var.f19287d || zh2Var.f19288e == 5) {
                zh2Var.f19284a = true;
                zh2Var.f19287d = true;
                zh2Var.f19288e = i10;
            } else {
                ih1.x(i10 == 5);
            }
        }
        wi2 wi2Var2 = this.f9924h0;
        return wi2Var2.b(cp2Var, j10, j11, j12, N(wi2Var2.f18078o), rq2Var, kVar, list);
    }

    public final void K(boolean[] zArr, long j10) throws zziw {
        hj2[] hj2VarArr;
        ji2 ji2VarZzn = this.U.zzn();
        k kVar = ji2VarZzn.f12890n;
        int i10 = 0;
        while (true) {
            hj2VarArr = this.f9909a;
            if (i10 >= 2) {
                break;
            }
            if (!kVar.a(i10)) {
                hj2VarArr[i10].g();
            }
            i10++;
        }
        for (int i11 = 0; i11 < 2; i11++) {
            if (kVar.a(i11) && !hj2VarArr[i11].zzp(ji2VarZzn)) {
                L(ji2VarZzn, i11, zArr[i11], j10);
            }
        }
    }

    public final void L(ji2 ji2Var, int i10, boolean z10, long j10) throws zziw {
        hj2 hj2Var = this.f9909a[i10];
        if (hj2Var.l()) {
            return;
        }
        boolean z11 = ji2Var == this.U.zzm();
        k kVar = ji2Var.f12890n;
        gj2 gj2Var = kVar.f13047b[i10];
        d dVar = kVar.f13048c[i10];
        boolean z12 = P() && this.f9924h0.f18068e == 3;
        boolean z13 = !z10 && z12;
        this.f9940s0++;
        hj2Var.L(gj2Var, dVar, ji2Var.f12879c[i10], this.f9941t0, z13, z11, j10, ji2Var.f12891o, ji2Var.f12883g.f13271a, this.Q);
        hj2Var.zzy(11, new vh2(this), ji2Var);
        if (z12 && z11) {
            hj2Var.J();
        }
    }

    public final void M(boolean z10) {
        ji2 ji2VarZzk = this.U.zzk();
        cp2 cp2Var = ji2VarZzk == null ? this.f9924h0.f18065b : ji2VarZzk.f12883g.f13271a;
        boolean z11 = !this.f9924h0.f18073j.equals(cp2Var);
        if (z11) {
            this.f9924h0 = this.f9924h0.f(cp2Var);
        }
        wi2 wi2Var = this.f9924h0;
        wi2Var.f18078o = ji2VarZzk == null ? wi2Var.f18080q : ji2VarZzk.e();
        wi2 wi2Var2 = this.f9924h0;
        wi2Var2.f18079p = N(wi2Var2.f18078o);
        if ((z11 || z10) && ji2VarZzk != null && ji2VarZzk.f12881e) {
            O(ji2VarZzk.f12883g.f13271a, ji2VarZzk.f12889m, ji2VarZzk.f12890n);
        }
    }

    public final long N(long j10) {
        ji2 ji2VarZzk = this.U.zzk();
        if (ji2VarZzk == null) {
            return 0L;
        }
        return Math.max(0L, j10 - (this.f9941t0 - ji2VarZzk.f12891o));
    }

    public final void O(cp2 cp2Var, rq2 rq2Var, k kVar) {
        li2 li2Var = this.U;
        ji2 ji2VarZzk = li2Var.zzk();
        ji2VarZzk.getClass();
        if (ji2VarZzk != li2Var.zzm()) {
            long j10 = ji2VarZzk.f12883g.f13272b;
        }
        long jN = N(ji2VarZzk.e());
        long j11 = m(this.f9924h0.f18064a, ji2VarZzk.f12883g.f13271a) ? this.C0.f18051h : -9223372036854775807L;
        mk2 mk2Var = this.X;
        mk mkVar = this.f9924h0.f18064a;
        float f10 = this.Q.zzj().f18031a;
        boolean z10 = this.f9924h0.f18074k;
        this.f9919f.f(new ei2(mk2Var, mkVar, cp2Var, jN, f10, this.f9934m0, j11), kVar.f13048c);
    }

    public final boolean P() {
        wi2 wi2Var = this.f9924h0;
        return wi2Var.f18074k && wi2Var.f18076m == 0;
    }

    public final void Q(int i10) {
        hj2 hj2Var = this.f9909a[i10];
        try {
            ji2 ji2VarZzm = this.U.zzm();
            ji2VarZzm.getClass();
            hj2Var.I(ji2VarZzm);
        } catch (IOException | RuntimeException e10) {
            hj2Var.u();
            throw e10;
        }
    }

    public final boolean R() {
        if (!this.f9910a0) {
            return false;
        }
        for (int i10 = 0; i10 < 2; i10++) {
            if (this.f9909a[i10].s()) {
                return true;
            }
        }
        return false;
    }

    public final void a(IOException iOException, int i10) {
        zziw zziwVar = new zziw(0, iOException, i10);
        ji2 ji2VarZzm = this.U.zzm();
        if (ji2VarZzm != null) {
            zziwVar = zziwVar.zzd(ji2VarZzm.f12883g.f13271a);
        }
        vt0.zzf("ExoPlayerImplInternal", "Playback error", zziwVar);
        r(false, false);
        this.f9924h0 = this.f9924h0.zzf(zziwVar);
    }

    public final void b(int i10) {
        wi2 wi2Var = this.f9924h0;
        if (wi2Var.f18068e != i10) {
            if (i10 != 2) {
                this.f9945x0 = -9223372036854775807L;
            }
            this.f9924h0 = wi2Var.d(i10);
        }
    }

    public final void c() {
        zh2 zh2Var = this.f9926i0;
        wi2 wi2Var = this.f9924h0;
        boolean z10 = zh2Var.f19284a | (zh2Var.f19285b != wi2Var);
        zh2Var.f19284a = z10;
        zh2Var.f19285b = wi2Var;
        if (z10) {
            uh2 uh2Var = ((mh2) this.T).f14238a;
            uh2Var.getClass();
            ((h81) uh2Var.f17265j).c(new nw0(uh2Var, zh2Var, 21));
            this.f9926i0 = new zh2(this.f9924h0);
        }
    }

    @Override // com.google.android.gms.internal.ads.zo2
    public final /* bridge */ /* synthetic */ void d(lq2 lq2Var) {
        ((u71) ((h81) this.f9923h).zzd(9, (ap2) lq2Var)).a();
    }

    @Override // com.google.android.gms.internal.ads.zo2
    public final void e(ap2 ap2Var) {
        ((u71) ((h81) this.f9923h).zzd(8, ap2Var)).a();
    }

    public final void f(int i10, int i11, int i12, boolean z10) {
        boolean z11;
        if (!z10) {
            z11 = false;
        } else if (i10 != -1) {
            z11 = true;
        } else {
            i10 = -1;
            z11 = false;
        }
        if (i10 == -1) {
            i12 = 2;
        } else if (i12 == 2) {
            i12 = 1;
        }
        boolean z12 = this.f9918e0;
        if (i10 == 0) {
            i11 = 1;
        } else if (i11 == 1) {
            i11 = z12 ? 4 : 0;
        }
        wi2 wi2Var = this.f9924h0;
        if (wi2Var.f18074k == z11 && wi2Var.f18076m == i11 && wi2Var.f18075l == i12) {
            return;
        }
        this.f9924h0 = wi2Var.g(i12, i11, z11);
        v(false, false);
        li2 li2Var = this.U;
        for (ji2 ji2VarZzm = li2Var.zzm(); ji2VarZzm != null; ji2VarZzm = ji2VarZzm.zzp()) {
            for (d dVar : ji2VarZzm.f12890n.f13048c) {
            }
        }
        if (!P()) {
            i();
            j();
            this.f9924h0.getClass();
            li2Var.o(this.f9941t0);
            return;
        }
        int i13 = this.f9924h0.f18068e;
        sq0 sq0Var = this.f9923h;
        if (i13 != 3) {
            if (i13 == 2) {
                ((h81) sq0Var).a(2);
            }
        } else {
            bh2 bh2Var = this.Q;
            bh2Var.f9542d = true;
            bh2Var.f9539a.a();
            h();
            ((h81) sq0Var).a(2);
        }
    }

    public final void g(boolean z10) throws zziw {
        cp2 cp2Var = this.U.zzm().f12883g.f13271a;
        long jP = p(cp2Var, this.f9924h0.f18080q, true, false);
        if (jP != this.f9924h0.f18080q) {
            wi2 wi2Var = this.f9924h0;
            this.f9924h0 = J(cp2Var, jP, wi2Var.f18066c, wi2Var.f18067d, z10, 5);
        }
    }

    public final void h() {
        ji2 ji2VarZzm = this.U.zzm();
        if (ji2VarZzm == null) {
            return;
        }
        k kVar = ji2VarZzm.f12890n;
        for (int i10 = 0; i10 < 2; i10++) {
            if (kVar.a(i10)) {
                this.f9909a[i10].J();
            }
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:437:0x0731, code lost:
    
        if (((long) ((r2.b() - r37.f9941t0) / r37.Q.zzj().f18031a)) <= 10000000) goto L443;
     */
    /* JADX WARN: Removed duplicated region for block: B:334:0x057e  */
    /* JADX WARN: Removed duplicated region for block: B:358:0x05d6 A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TRY_ENTER, TRY_LEAVE, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:360:0x05e4 A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x09b1, zziw -> 0x09b4, TRY_ENTER, TryCatch #20 {RuntimeException -> 0x09b1, blocks: (B:332:0x0576, B:335:0x0584, B:356:0x05d2, B:361:0x05e7, B:407:0x06b0, B:502:0x085a, B:525:0x08d5, B:528:0x08df, B:530:0x08e3, B:532:0x08e9, B:534:0x08ef, B:536:0x08f9, B:541:0x0903, B:543:0x090c, B:554:0x093b, B:411:0x06be, B:482:0x0817, B:486:0x0821, B:360:0x05e4), top: B:844:0x0576 }] */
    /* JADX WARN: Removed duplicated region for block: B:402:0x06a6  */
    /* JADX WARN: Removed duplicated region for block: B:409:0x06b6  */
    /* JADX WARN: Removed duplicated region for block: B:411:0x06be A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x09b1, zziw -> 0x09b4, TRY_LEAVE, TryCatch #20 {RuntimeException -> 0x09b1, blocks: (B:332:0x0576, B:335:0x0584, B:356:0x05d2, B:361:0x05e7, B:407:0x06b0, B:502:0x085a, B:525:0x08d5, B:528:0x08df, B:530:0x08e3, B:532:0x08e9, B:534:0x08ef, B:536:0x08f9, B:541:0x0903, B:543:0x090c, B:554:0x093b, B:411:0x06be, B:482:0x0817, B:486:0x0821, B:360:0x05e4), top: B:844:0x0576 }] */
    /* JADX WARN: Removed duplicated region for block: B:459:0x0795 A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:471:0x07d5 A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, LOOP:23: B:470:0x07d3->B:471:0x07d5, LOOP_END, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:474:0x07e3 A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:476:0x07f2  */
    /* JADX WARN: Removed duplicated region for block: B:504:0x0860 A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TRY_ENTER, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:508:0x086a  */
    /* JADX WARN: Removed duplicated region for block: B:528:0x08df A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x09b1, zziw -> 0x09b4, TryCatch #20 {RuntimeException -> 0x09b1, blocks: (B:332:0x0576, B:335:0x0584, B:356:0x05d2, B:361:0x05e7, B:407:0x06b0, B:502:0x085a, B:525:0x08d5, B:528:0x08df, B:530:0x08e3, B:532:0x08e9, B:534:0x08ef, B:536:0x08f9, B:541:0x0903, B:543:0x090c, B:554:0x093b, B:411:0x06be, B:482:0x0817, B:486:0x0821, B:360:0x05e4), top: B:844:0x0576 }] */
    /* JADX WARN: Removed duplicated region for block: B:539:0x08ff A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TRY_ENTER, TRY_LEAVE, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:545:0x091e A[Catch: RuntimeException -> 0x0043, IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, zziw -> 0x0056, TRY_ENTER, TryCatch #12 {zziw -> 0x0056, blocks: (B:7:0x0018, B:36:0x0059, B:38:0x005f, B:39:0x0065, B:41:0x006f, B:43:0x0075, B:45:0x0079, B:48:0x0085, B:53:0x008f, B:55:0x0093, B:62:0x00a5, B:64:0x00b0, B:66:0x00b4, B:67:0x00bb, B:80:0x00d7, B:82:0x00e0, B:83:0x00e8, B:92:0x0104, B:93:0x0113, B:102:0x0135, B:106:0x0146, B:113:0x0164, B:115:0x0173, B:116:0x017b, B:122:0x018c, B:119:0x0183, B:123:0x0191, B:127:0x01ad, B:129:0x01c3, B:131:0x01cc, B:138:0x01de, B:139:0x01ef, B:153:0x0223, B:157:0x022a, B:159:0x0233, B:161:0x023f, B:162:0x0247, B:163:0x0252, B:164:0x0266, B:165:0x027e, B:167:0x0289, B:169:0x0298, B:170:0x029c, B:171:0x02ad, B:173:0x02bc, B:175:0x02cd, B:176:0x02da, B:177:0x02ed, B:184:0x02fe, B:186:0x0310, B:187:0x031a, B:189:0x0322, B:192:0x032e, B:194:0x033a, B:197:0x0345, B:200:0x034e, B:203:0x035d, B:207:0x0364, B:209:0x036c, B:211:0x0370, B:213:0x0375, B:215:0x037f, B:216:0x0384, B:220:0x038b, B:222:0x039b, B:226:0x03a5, B:223:0x039f, B:225:0x03a2, B:227:0x03aa, B:229:0x03bc, B:233:0x03c6, B:230:0x03c0, B:232:0x03c3, B:234:0x03cb, B:235:0x03d0, B:237:0x03dc, B:238:0x03e6, B:240:0x03ec, B:248:0x0408, B:295:0x04f0, B:297:0x04f7, B:301:0x0503, B:303:0x050a, B:304:0x0512, B:309:0x051b, B:310:0x0521, B:311:0x052a, B:313:0x053d, B:325:0x0557, B:337:0x0591, B:339:0x059b, B:341:0x05a3, B:352:0x05c4, B:354:0x05ca, B:355:0x05cf, B:348:0x05b3, B:350:0x05b7, B:358:0x05d6, B:364:0x05ee, B:366:0x05f2, B:368:0x05f6, B:370:0x05fc, B:372:0x0602, B:374:0x0608, B:376:0x060e, B:378:0x0616, B:382:0x0635, B:384:0x063e, B:385:0x0643, B:387:0x0647, B:389:0x064d, B:391:0x0655, B:393:0x065d, B:395:0x067a, B:396:0x0684, B:398:0x068d, B:400:0x069b, B:504:0x0860, B:506:0x0866, B:509:0x086e, B:510:0x0878, B:512:0x087c, B:516:0x08a1, B:518:0x08a7, B:520:0x08af, B:522:0x08c6, B:523:0x08cb, B:539:0x08ff, B:545:0x091e, B:547:0x0927, B:549:0x092f, B:413:0x06c4, B:416:0x06cb, B:419:0x06d4, B:421:0x06d8, B:423:0x06e0, B:424:0x06e3, B:426:0x06e9, B:428:0x06f3, B:430:0x06fb, B:432:0x0709, B:434:0x0711, B:443:0x073a, B:445:0x076b, B:447:0x076f, B:451:0x0780, B:480:0x0806, B:453:0x078a, B:455:0x078e, B:459:0x0795, B:461:0x079d, B:463:0x07ba, B:466:0x07c3, B:469:0x07ce, B:471:0x07d5, B:472:0x07dd, B:474:0x07e3, B:484:0x081d, B:489:0x0826, B:492:0x0834, B:494:0x083a, B:498:0x084d, B:500:0x0854), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:553:0x0939  */
    /* JADX WARN: Removed duplicated region for block: B:558:0x0968 A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x097b, zziw -> 0x097f, TryCatch #44 {zziw -> 0x097f, RuntimeException -> 0x097b, blocks: (B:582:0x09b7, B:591:0x09d3, B:602:0x0a0b, B:556:0x0956, B:558:0x0968, B:560:0x096e, B:562:0x0973, B:567:0x0983, B:569:0x098a, B:570:0x098d, B:571:0x0996, B:573:0x099a, B:575:0x09a0, B:576:0x09a5), top: B:892:0x0956 }] */
    /* JADX WARN: Removed duplicated region for block: B:562:0x0973 A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x097b, zziw -> 0x097f, LOOP:18: B:561:0x0971->B:562:0x0973, LOOP_END, TryCatch #44 {zziw -> 0x097f, RuntimeException -> 0x097b, blocks: (B:582:0x09b7, B:591:0x09d3, B:602:0x0a0b, B:556:0x0956, B:558:0x0968, B:560:0x096e, B:562:0x0973, B:567:0x0983, B:569:0x098a, B:570:0x098d, B:571:0x0996, B:573:0x099a, B:575:0x09a0, B:576:0x09a5), top: B:892:0x0956 }] */
    /* JADX WARN: Removed duplicated region for block: B:569:0x098a A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x097b, zziw -> 0x097f, TryCatch #44 {zziw -> 0x097f, RuntimeException -> 0x097b, blocks: (B:582:0x09b7, B:591:0x09d3, B:602:0x0a0b, B:556:0x0956, B:558:0x0968, B:560:0x096e, B:562:0x0973, B:567:0x0983, B:569:0x098a, B:570:0x098d, B:571:0x0996, B:573:0x099a, B:575:0x09a0, B:576:0x09a5), top: B:892:0x0956 }] */
    /* JADX WARN: Removed duplicated region for block: B:573:0x099a A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x097b, zziw -> 0x097f, TryCatch #44 {zziw -> 0x097f, RuntimeException -> 0x097b, blocks: (B:582:0x09b7, B:591:0x09d3, B:602:0x0a0b, B:556:0x0956, B:558:0x0968, B:560:0x096e, B:562:0x0973, B:567:0x0983, B:569:0x098a, B:570:0x098d, B:571:0x0996, B:573:0x099a, B:575:0x09a0, B:576:0x09a5), top: B:892:0x0956 }] */
    /* JADX WARN: Removed duplicated region for block: B:681:0x0b63 A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x0a2f, zziw -> 0x0a33, TRY_LEAVE, TryCatch #25 {RuntimeException -> 0x0a2f, blocks: (B:624:0x0a4d, B:607:0x0a1a, B:609:0x0a21, B:617:0x0a3a, B:623:0x0a4a, B:631:0x0a70, B:633:0x0a76, B:637:0x0a83, B:650:0x0ac0, B:652:0x0ac6, B:654:0x0aca, B:679:0x0b56, B:681:0x0b63, B:683:0x0b6a, B:684:0x0b71, B:705:0x0bbd, B:708:0x0bc4, B:710:0x0bc8, B:712:0x0bd0, B:713:0x0bd3, B:714:0x0bd6, B:716:0x0bdc, B:718:0x0be5, B:720:0x0bef, B:722:0x0bf5, B:724:0x0c00, B:731:0x0c25, B:733:0x0c2b, B:737:0x0c35, B:747:0x0c50, B:744:0x0c49, B:746:0x0c4d, B:725:0x0c07, B:728:0x0c15, B:729:0x0c1d, B:730:0x0c1e, B:657:0x0ad4, B:659:0x0ad8, B:661:0x0aea, B:663:0x0af5, B:665:0x0aff, B:669:0x0b08, B:671:0x0b12, B:677:0x0b1d, B:687:0x0b78, B:689:0x0b7f, B:691:0x0b83, B:695:0x0b8c, B:697:0x0b9b, B:699:0x0ba1, B:701:0x0bab, B:702:0x0bb0, B:703:0x0bb5, B:704:0x0bba, B:639:0x0a8b, B:641:0x0a8f, B:642:0x0a96, B:646:0x0aac, B:648:0x0ab2, B:630:0x0a65, B:755:0x0c67, B:759:0x0c72, B:761:0x0c77), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:687:0x0b78 A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x0a2f, zziw -> 0x0a33, TryCatch #25 {RuntimeException -> 0x0a2f, blocks: (B:624:0x0a4d, B:607:0x0a1a, B:609:0x0a21, B:617:0x0a3a, B:623:0x0a4a, B:631:0x0a70, B:633:0x0a76, B:637:0x0a83, B:650:0x0ac0, B:652:0x0ac6, B:654:0x0aca, B:679:0x0b56, B:681:0x0b63, B:683:0x0b6a, B:684:0x0b71, B:705:0x0bbd, B:708:0x0bc4, B:710:0x0bc8, B:712:0x0bd0, B:713:0x0bd3, B:714:0x0bd6, B:716:0x0bdc, B:718:0x0be5, B:720:0x0bef, B:722:0x0bf5, B:724:0x0c00, B:731:0x0c25, B:733:0x0c2b, B:737:0x0c35, B:747:0x0c50, B:744:0x0c49, B:746:0x0c4d, B:725:0x0c07, B:728:0x0c15, B:729:0x0c1d, B:730:0x0c1e, B:657:0x0ad4, B:659:0x0ad8, B:661:0x0aea, B:663:0x0af5, B:665:0x0aff, B:669:0x0b08, B:671:0x0b12, B:677:0x0b1d, B:687:0x0b78, B:689:0x0b7f, B:691:0x0b83, B:695:0x0b8c, B:697:0x0b9b, B:699:0x0ba1, B:701:0x0bab, B:702:0x0bb0, B:703:0x0bb5, B:704:0x0bba, B:639:0x0a8b, B:641:0x0a8f, B:642:0x0a96, B:646:0x0aac, B:648:0x0ab2, B:630:0x0a65, B:755:0x0c67, B:759:0x0c72, B:761:0x0c77), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:689:0x0b7f A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x0a2f, zziw -> 0x0a33, TryCatch #25 {RuntimeException -> 0x0a2f, blocks: (B:624:0x0a4d, B:607:0x0a1a, B:609:0x0a21, B:617:0x0a3a, B:623:0x0a4a, B:631:0x0a70, B:633:0x0a76, B:637:0x0a83, B:650:0x0ac0, B:652:0x0ac6, B:654:0x0aca, B:679:0x0b56, B:681:0x0b63, B:683:0x0b6a, B:684:0x0b71, B:705:0x0bbd, B:708:0x0bc4, B:710:0x0bc8, B:712:0x0bd0, B:713:0x0bd3, B:714:0x0bd6, B:716:0x0bdc, B:718:0x0be5, B:720:0x0bef, B:722:0x0bf5, B:724:0x0c00, B:731:0x0c25, B:733:0x0c2b, B:737:0x0c35, B:747:0x0c50, B:744:0x0c49, B:746:0x0c4d, B:725:0x0c07, B:728:0x0c15, B:729:0x0c1d, B:730:0x0c1e, B:657:0x0ad4, B:659:0x0ad8, B:661:0x0aea, B:663:0x0af5, B:665:0x0aff, B:669:0x0b08, B:671:0x0b12, B:677:0x0b1d, B:687:0x0b78, B:689:0x0b7f, B:691:0x0b83, B:695:0x0b8c, B:697:0x0b9b, B:699:0x0ba1, B:701:0x0bab, B:702:0x0bb0, B:703:0x0bb5, B:704:0x0bba, B:639:0x0a8b, B:641:0x0a8f, B:642:0x0a96, B:646:0x0aac, B:648:0x0ab2, B:630:0x0a65, B:755:0x0c67, B:759:0x0c72, B:761:0x0c77), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:697:0x0b9b A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x0a2f, zziw -> 0x0a33, TryCatch #25 {RuntimeException -> 0x0a2f, blocks: (B:624:0x0a4d, B:607:0x0a1a, B:609:0x0a21, B:617:0x0a3a, B:623:0x0a4a, B:631:0x0a70, B:633:0x0a76, B:637:0x0a83, B:650:0x0ac0, B:652:0x0ac6, B:654:0x0aca, B:679:0x0b56, B:681:0x0b63, B:683:0x0b6a, B:684:0x0b71, B:705:0x0bbd, B:708:0x0bc4, B:710:0x0bc8, B:712:0x0bd0, B:713:0x0bd3, B:714:0x0bd6, B:716:0x0bdc, B:718:0x0be5, B:720:0x0bef, B:722:0x0bf5, B:724:0x0c00, B:731:0x0c25, B:733:0x0c2b, B:737:0x0c35, B:747:0x0c50, B:744:0x0c49, B:746:0x0c4d, B:725:0x0c07, B:728:0x0c15, B:729:0x0c1d, B:730:0x0c1e, B:657:0x0ad4, B:659:0x0ad8, B:661:0x0aea, B:663:0x0af5, B:665:0x0aff, B:669:0x0b08, B:671:0x0b12, B:677:0x0b1d, B:687:0x0b78, B:689:0x0b7f, B:691:0x0b83, B:695:0x0b8c, B:697:0x0b9b, B:699:0x0ba1, B:701:0x0bab, B:702:0x0bb0, B:703:0x0bb5, B:704:0x0bba, B:639:0x0a8b, B:641:0x0a8f, B:642:0x0a96, B:646:0x0aac, B:648:0x0ab2, B:630:0x0a65, B:755:0x0c67, B:759:0x0c72, B:761:0x0c77), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:707:0x0bc3  */
    /* JADX WARN: Removed duplicated region for block: B:730:0x0c1e A[Catch: IOException -> 0x0046, zzhc -> 0x004a, zzat -> 0x004e, zztg -> 0x0052, RuntimeException -> 0x0a2f, zziw -> 0x0a33, TryCatch #25 {RuntimeException -> 0x0a2f, blocks: (B:624:0x0a4d, B:607:0x0a1a, B:609:0x0a21, B:617:0x0a3a, B:623:0x0a4a, B:631:0x0a70, B:633:0x0a76, B:637:0x0a83, B:650:0x0ac0, B:652:0x0ac6, B:654:0x0aca, B:679:0x0b56, B:681:0x0b63, B:683:0x0b6a, B:684:0x0b71, B:705:0x0bbd, B:708:0x0bc4, B:710:0x0bc8, B:712:0x0bd0, B:713:0x0bd3, B:714:0x0bd6, B:716:0x0bdc, B:718:0x0be5, B:720:0x0bef, B:722:0x0bf5, B:724:0x0c00, B:731:0x0c25, B:733:0x0c2b, B:737:0x0c35, B:747:0x0c50, B:744:0x0c49, B:746:0x0c4d, B:725:0x0c07, B:728:0x0c15, B:729:0x0c1d, B:730:0x0c1e, B:657:0x0ad4, B:659:0x0ad8, B:661:0x0aea, B:663:0x0af5, B:665:0x0aff, B:669:0x0b08, B:671:0x0b12, B:677:0x0b1d, B:687:0x0b78, B:689:0x0b7f, B:691:0x0b83, B:695:0x0b8c, B:697:0x0b9b, B:699:0x0ba1, B:701:0x0bab, B:702:0x0bb0, B:703:0x0bb5, B:704:0x0bba, B:639:0x0a8b, B:641:0x0a8f, B:642:0x0a96, B:646:0x0aac, B:648:0x0ab2, B:630:0x0a65, B:755:0x0c67, B:759:0x0c72, B:761:0x0c77), top: B:841:0x0014 }] */
    /* JADX WARN: Removed duplicated region for block: B:767:0x0c95  */
    /* JADX WARN: Removed duplicated region for block: B:785:0x0ce6  */
    /* JADX WARN: Removed duplicated region for block: B:792:0x0cff  */
    /* JADX WARN: Removed duplicated region for block: B:811:0x0d62  */
    /* JADX WARN: Removed duplicated region for block: B:813:0x0d66  */
    /* JADX WARN: Removed duplicated region for block: B:816:0x0d71  */
    /* JADX WARN: Removed duplicated region for block: B:868:0x00c0 A[EXC_TOP_SPLITTER, SYNTHETIC] */
    @Override // android.os.Handler.Callback
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean handleMessage(Message message) throws Throwable {
        RuntimeException runtimeException;
        String str;
        String str2;
        zziw zziwVarZzd;
        int i10;
        boolean z10;
        zziw zziwVar;
        zziw zziwVar2;
        int i11;
        cp2 cp2Var;
        ji2 ji2VarZzn;
        ud0 ud0Var;
        String str3;
        String str4;
        boolean z11;
        long jUptimeMillis;
        h81 h81Var;
        long j10;
        li2 li2Var;
        ji2 ji2VarZzn2;
        li2 li2Var2;
        k kVar;
        long j11;
        int i12;
        int i13;
        ji2 ji2VarZzn3;
        li2 li2Var3;
        boolean z12;
        ji2 ji2VarZzm;
        ji2 ji2VarZzp;
        ji2 ji2VarZzr;
        boolean z13;
        int i14;
        int i15;
        li2 li2Var4;
        int i16;
        ji2 ji2VarZzo;
        long j12;
        li2 li2Var5;
        ki2 ki2VarZzh;
        ji2 ji2Var;
        boolean z14;
        boolean z15;
        long j13;
        boolean zC;
        String str5;
        String str6;
        ji2 ji2Var2;
        wd wdVarZzj;
        int i17;
        int i18;
        String str7 = "Playback error";
        String str8 = "ExoPlayerImplInternal";
        int i19 = 0;
        int i20 = 2;
        try {
            try {
                try {
                    ud0Var = null;
                    try {
                        try {
                            try {
                                try {
                                    try {
                                    } catch (zziw e10) {
                                        e = e10;
                                    }
                                } catch (RuntimeException e11) {
                                    e = e11;
                                    runtimeException = e;
                                    i10 = 1004;
                                    if (!(runtimeException instanceof IllegalStateException) && !(runtimeException instanceof IllegalArgumentException)) {
                                        i10 = 1000;
                                    }
                                    zziw zziwVar3 = new zziw(i19, runtimeException, i10);
                                    vt0.zzf(str2, str, zziwVar3);
                                    r(true, false);
                                    this.f9924h0 = this.f9924h0.zzf(zziwVar3);
                                    z10 = true;
                                    c();
                                    return z10;
                                }
                            } catch (RuntimeException e12) {
                                e = e12;
                            }
                        } catch (zziw e13) {
                            e = e13;
                        }
                    } catch (zziw e14) {
                        e = e14;
                    } catch (RuntimeException e15) {
                        e = e15;
                    }
                } catch (RuntimeException e16) {
                    e = e16;
                    i19 = 2;
                }
            } catch (zziw e17) {
                e = e17;
                i19 = i20;
            }
        } catch (zzat e18) {
            e = e18;
        } catch (zzhc e19) {
            e = e19;
        } catch (zztg e20) {
            e = e20;
        } catch (IOException e21) {
            e = e21;
        }
        switch (message.what) {
            case 1:
                i19 = 2;
                str4 = "Playback error";
                str3 = "ExoPlayerImplInternal";
                boolean z16 = message.arg1 != 0;
                int i21 = message.arg2;
                int i22 = i21 >> 4;
                int i23 = i21 & 15;
                try {
                    this.f9926i0.a(1);
                    f(this.f9912b0.a(this.f9924h0.f18068e, z16), i22, i23, z16);
                    break;
                } catch (zziw e22) {
                    e = e22;
                    zziwVarZzd = e;
                    str7 = str4;
                    str8 = str3;
                    if (zziwVarZzd.zzc == 1 && (ji2VarZzn = this.U.zzn()) != null && zziwVarZzd.zzh == null) {
                        zziwVarZzd = zziwVarZzd.zzd(ji2VarZzn.f12883g.f13271a);
                    }
                    if (zziwVarZzd.zzc != 1 || (cp2Var = zziwVarZzd.zzh) == null) {
                        zziwVar = this.zzX;
                        if (zziwVar != null) {
                            zziwVar.addSuppressed(zziwVarZzd);
                            zziwVarZzd = this.zzX;
                        }
                        zziwVar2 = zziwVarZzd;
                        if (zziwVar2.zzc == 1) {
                            li2 li2Var6 = this.U;
                            if (li2Var6.zzm() != li2Var6.zzn()) {
                                while (li2Var6.zzm() != li2Var6.zzn()) {
                                    li2Var6.zzr();
                                }
                                ji2 ji2VarZzm2 = li2Var6.zzm();
                                ji2VarZzm2.getClass();
                                c();
                                ki2 ki2Var = ji2VarZzm2.f12883g;
                                cp2 cp2Var2 = ki2Var.f13271a;
                                long j14 = ki2Var.f13272b;
                                this.f9924h0 = J(cp2Var2, j14, ki2Var.f13273c, j14, true, 0);
                            }
                        }
                        if (zziwVar2.zzi || !(this.zzX == null || (i11 = zziwVar2.zza) == 5004 || i11 == 5003)) {
                            vt0.zzf(str8, str7, zziwVar2);
                            z10 = true;
                            r(true, false);
                            this.f9924h0 = this.f9924h0.zzf(zziwVar2);
                        } else {
                            vt0.zzd(str8, "Recoverable renderer error", zziwVar2);
                            if (this.zzX == null) {
                                this.zzX = zziwVar2;
                            }
                            h81 h81Var2 = (h81) this.f9923h;
                            ((u71) h81Var2.zzd(25, zziwVar2)).c(h81Var2.f12056a);
                        }
                    } else {
                        int i24 = zziwVarZzd.zze;
                        li2 li2Var7 = this.U;
                        if (li2Var7.zzo() != null && li2Var7.zzo().f12883g.f13271a.equals(cp2Var) && this.f9909a[i24].E(li2Var7.zzo())) {
                            this.A0 = true;
                            y();
                            ji2 ji2VarZzo2 = li2Var7.zzo();
                            ji2 ji2VarZzm3 = li2Var7.zzm();
                            if (li2Var7.zzm() != ji2VarZzo2) {
                                while (ji2VarZzm3 != null && ji2VarZzm3.zzp() != ji2VarZzo2) {
                                    ji2VarZzm3 = ji2VarZzm3.zzp();
                                }
                            }
                            li2Var7.u(ji2VarZzm3);
                            if (this.f9924h0.f18068e != 4) {
                                H();
                                ((h81) this.f9923h).a(i19);
                            }
                        }
                    }
                    c();
                    return z10;
                }
                z10 = true;
                c();
                return z10;
            case 2:
                try {
                    jUptimeMillis = SystemClock.uptimeMillis();
                    try {
                        h81Var = (h81) this.f9923h;
                        h81Var.b(2);
                    } catch (zziw e23) {
                        e = e23;
                        i19 = 2;
                        str4 = "Playback error";
                        str3 = "ExoPlayerImplInternal";
                    }
                    break;
                } catch (zziw e24) {
                    e = e24;
                    i19 = 2;
                }
                if (!this.f9924h0.f18064a.g()) {
                    try {
                        if (this.V.b()) {
                            li2 li2Var8 = this.U;
                            li2Var8.o(this.f9941t0);
                            if (li2Var8.p() && (ki2VarZzh = li2Var8.zzh(this.f9941t0, this.f9924h0)) != null) {
                                ji2 ji2VarQ = li2Var8.q(ki2VarZzh);
                                if (!ji2VarQ.f12880d) {
                                    long j15 = ki2VarZzh.f13272b;
                                    try {
                                        ji2VarQ.f12880d = true;
                                        ji2VarQ.f12877a.i(this, j15);
                                    } catch (zziw e25) {
                                        e = e25;
                                        zziwVarZzd = e;
                                        i19 = i20;
                                        if (zziwVarZzd.zzc == 1) {
                                        }
                                        if (zziwVarZzd.zzc != 1) {
                                        }
                                        c();
                                        return z10;
                                    } catch (RuntimeException e26) {
                                        e = e26;
                                        runtimeException = e;
                                        i19 = i20;
                                        str = "Playback error";
                                        str2 = "ExoPlayerImplInternal";
                                        i10 = 1004;
                                        if (!(runtimeException instanceof IllegalStateException)) {
                                        }
                                        zziw zziwVar32 = new zziw(i19, runtimeException, i10);
                                        vt0.zzf(str2, str, zziwVar32);
                                        r(true, false);
                                        this.f9924h0 = this.f9924h0.zzf(zziwVar32);
                                        z10 = true;
                                        c();
                                        return z10;
                                    }
                                } else if (ji2VarQ.f12881e) {
                                    ((u71) h81Var.zzd(8, ji2VarQ.f12877a)).a();
                                }
                                if (li2Var8.zzm() == ji2VarQ) {
                                    q(ki2VarZzh.f13272b, true);
                                }
                                M(false);
                                if (this.f9936o0) {
                                }
                                if (this.f9932l0) {
                                    j10 = jUptimeMillis;
                                    li2Var = li2Var8;
                                    ji2VarZzn2 = li2Var.zzn();
                                    if (ji2VarZzn2 == null) {
                                    }
                                }
                                break;
                            } else {
                                if (this.f9936o0) {
                                    H();
                                } else {
                                    this.f9936o0 = zzaF(li2Var8.zzk());
                                    I();
                                }
                                if (!this.f9932l0 || !this.f9910a0 || this.A0 || R() || (ji2VarZzo = li2Var8.zzo()) == null || ji2VarZzo != li2Var8.zzn() || ji2VarZzo.zzp() == null || !ji2VarZzo.zzp().f12881e) {
                                    j10 = jUptimeMillis;
                                    li2Var = li2Var8;
                                    ji2VarZzn2 = li2Var.zzn();
                                    if (ji2VarZzn2 == null) {
                                        li2Var2 = li2Var;
                                        ji2VarZzn3 = li2Var2.zzn();
                                        if (ji2VarZzn3 == null) {
                                        }
                                    } else if (ji2VarZzn2.zzp() == null || this.f9932l0) {
                                        li2Var2 = li2Var;
                                        if (ji2VarZzn2.f12883g.f13278h || this.f9932l0) {
                                            hj2[] hj2VarArr = this.f9909a;
                                            for (int i25 = 0; i25 < 2; i25++) {
                                                hj2 hj2Var = hj2VarArr[i25];
                                                if (hj2Var.zzp(ji2VarZzn2) && hj2Var.v(ji2VarZzn2)) {
                                                    long j16 = ji2VarZzn2.f12883g.f13275e;
                                                    hj2Var.w(ji2VarZzn2, (j16 == -9223372036854775807L || j16 == Long.MIN_VALUE) ? -9223372036854775807L : j16 + ji2VarZzn2.a());
                                                }
                                            }
                                        }
                                        ji2VarZzn3 = li2Var2.zzn();
                                        if (ji2VarZzn3 == null || li2Var2.zzm() == ji2VarZzn3 || ji2VarZzn3.f12884h) {
                                            li2Var3 = li2Var2;
                                            z12 = false;
                                            while (P() && !this.f9932l0 && (ji2VarZzm = li2Var3.zzm()) != null && (ji2VarZzp = ji2VarZzm.zzp()) != null && this.f9941t0 >= ji2VarZzp.b() && ji2VarZzp.f12884h) {
                                                if (z12) {
                                                    c();
                                                }
                                                this.A0 = false;
                                                ji2VarZzr = li2Var3.zzr();
                                                ji2VarZzr.getClass();
                                                try {
                                                    if (!this.f9924h0.f18065b.f10025a.equals(ji2VarZzr.f12883g.f13271a.f10025a)) {
                                                        cp2 cp2Var3 = this.f9924h0.f18065b;
                                                        if (cp2Var3.f10026b == -1) {
                                                            cp2 cp2Var4 = ji2VarZzr.f12883g.f13271a;
                                                            if (cp2Var4.f10026b == -1 && cp2Var3.f10029e != cp2Var4.f10029e) {
                                                                z13 = true;
                                                            }
                                                            ki2 ki2Var2 = ji2VarZzr.f12883g;
                                                            cp2 cp2Var5 = ki2Var2.f13271a;
                                                            long j17 = ki2Var2.f13272b;
                                                            i19 = i20;
                                                            this.f9924h0 = J(cp2Var5, j17, ki2Var2.f13273c, j17, !z13, 0);
                                                            F();
                                                            j();
                                                            if (R() && ji2VarZzr == li2Var3.zzo()) {
                                                                hj2[] hj2VarArr2 = this.f9909a;
                                                                for (i15 = 0; i15 < i19; i15++) {
                                                                    hj2VarArr2[i15].b();
                                                                }
                                                            }
                                                            if (this.f9924h0.f18068e == 3) {
                                                                h();
                                                            }
                                                            k kVarK = li2Var3.zzm().k();
                                                            i14 = 0;
                                                            while (true) {
                                                                hj2[] hj2VarArr3 = this.f9909a;
                                                                if (i14 < i19) {
                                                                    if (kVarK.a(i14)) {
                                                                        hj2VarArr3[i14].A();
                                                                    }
                                                                    i14++;
                                                                }
                                                            }
                                                            i20 = i19;
                                                            z12 = true;
                                                        }
                                                    }
                                                    this.f9924h0 = J(cp2Var5, j17, ki2Var2.f13273c, j17, !z13, 0);
                                                    F();
                                                    j();
                                                    if (R()) {
                                                        hj2[] hj2VarArr22 = this.f9909a;
                                                        while (i15 < i19) {
                                                        }
                                                    }
                                                    if (this.f9924h0.f18068e == 3) {
                                                    }
                                                    k kVarK2 = li2Var3.zzm().k();
                                                    i14 = 0;
                                                    while (true) {
                                                        hj2[] hj2VarArr32 = this.f9909a;
                                                        if (i14 < i19) {
                                                        }
                                                        break;
                                                        i14++;
                                                    }
                                                    i20 = i19;
                                                    z12 = true;
                                                } catch (zziw e27) {
                                                    e = e27;
                                                    zziwVarZzd = e;
                                                    if (zziwVarZzd.zzc == 1) {
                                                    }
                                                    if (zziwVarZzd.zzc != 1) {
                                                    }
                                                    c();
                                                    return z10;
                                                } catch (RuntimeException e28) {
                                                    e = e28;
                                                    runtimeException = e;
                                                    str = "Playback error";
                                                    str2 = "ExoPlayerImplInternal";
                                                    i10 = 1004;
                                                    if (!(runtimeException instanceof IllegalStateException)) {
                                                    }
                                                    zziw zziwVar322 = new zziw(i19, runtimeException, i10);
                                                    vt0.zzf(str2, str, zziwVar322);
                                                    r(true, false);
                                                    this.f9924h0 = this.f9924h0.zzf(zziwVar322);
                                                    z10 = true;
                                                    c();
                                                    return z10;
                                                }
                                                z13 = false;
                                                ki2 ki2Var22 = ji2VarZzr.f12883g;
                                                cp2 cp2Var52 = ki2Var22.f13271a;
                                                long j172 = ki2Var22.f13272b;
                                                i19 = i20;
                                                break;
                                            }
                                            i19 = i20;
                                            this.f9946y0.getClass();
                                        } else {
                                            ji2 ji2VarZzn4 = li2Var2.zzn();
                                            k kVarK3 = ji2VarZzn4.k();
                                            int i26 = 1;
                                            int i27 = 0;
                                            while (true) {
                                                hj2[] hj2VarArr4 = this.f9909a;
                                                if (i27 < 2) {
                                                    int iT = hj2VarArr4[i27].t();
                                                    int iH = hj2VarArr4[i27].h(ji2VarZzn4, kVarK3, this.Q);
                                                    this.f9940s0 -= iT - hj2VarArr4[i27].t();
                                                    i26 &= iH & 1;
                                                    i27++;
                                                } else {
                                                    if (i26 != 0) {
                                                        int i28 = 0;
                                                        while (i28 < 2) {
                                                            if (!kVarK3.a(i28) || hj2VarArr4[i28].zzp(ji2VarZzn4)) {
                                                                li2Var4 = li2Var2;
                                                                i16 = i28;
                                                            } else {
                                                                li2Var4 = li2Var2;
                                                                i16 = i28;
                                                                L(ji2VarZzn4, i28, false, ji2VarZzn4.b());
                                                            }
                                                            i28 = i16 + 1;
                                                            li2Var2 = li2Var4;
                                                        }
                                                        li2Var3 = li2Var2;
                                                        li2Var3.zzn().f12884h = true;
                                                    }
                                                    z12 = false;
                                                    while (P()) {
                                                        if (z12) {
                                                        }
                                                        this.A0 = false;
                                                        ji2VarZzr = li2Var3.zzr();
                                                        ji2VarZzr.getClass();
                                                        if (!this.f9924h0.f18065b.f10025a.equals(ji2VarZzr.f12883g.f13271a.f10025a)) {
                                                        }
                                                        z13 = false;
                                                        ki2 ki2Var222 = ji2VarZzr.f12883g;
                                                        cp2 cp2Var522 = ki2Var222.f13271a;
                                                        long j1722 = ki2Var222.f13272b;
                                                        i19 = i20;
                                                        this.f9924h0 = J(cp2Var522, j1722, ki2Var222.f13273c, j1722, !z13, 0);
                                                        F();
                                                        j();
                                                        if (R()) {
                                                        }
                                                        if (this.f9924h0.f18068e == 3) {
                                                        }
                                                        k kVarK22 = li2Var3.zzm().k();
                                                        i14 = 0;
                                                        while (true) {
                                                            hj2[] hj2VarArr322 = this.f9909a;
                                                            if (i14 < i19) {
                                                            }
                                                            i14++;
                                                        }
                                                        i20 = i19;
                                                        z12 = true;
                                                        break;
                                                    }
                                                    i19 = i20;
                                                    this.f9946y0.getClass();
                                                }
                                            }
                                        }
                                    } else {
                                        ji2 ji2VarZzn5 = li2Var.zzn();
                                        if (ji2VarZzn5.f12881e) {
                                            int i29 = 0;
                                            while (true) {
                                                hj2[] hj2VarArr5 = this.f9909a;
                                                if (i29 >= 2) {
                                                    if ((!R() || li2Var.zzo() != li2Var.zzn()) && (ji2VarZzn2.zzp().f12881e || this.f9941t0 >= ji2VarZzn2.zzp().b())) {
                                                        if (ji2VarZzn2.zzp().f12881e) {
                                                            try {
                                                                ih1.b1(ji2VarZzn2.zzp().f12881e);
                                                            } catch (zziw e29) {
                                                                e = e29;
                                                                zziwVarZzd = e;
                                                                i19 = i20;
                                                                if (zziwVarZzd.zzc == 1) {
                                                                }
                                                                if (zziwVarZzd.zzc != 1) {
                                                                }
                                                                c();
                                                                return z10;
                                                            } catch (RuntimeException e30) {
                                                                e = e30;
                                                                runtimeException = e;
                                                                i19 = i20;
                                                                str = "Playback error";
                                                                str2 = "ExoPlayerImplInternal";
                                                                i10 = 1004;
                                                                if (!(runtimeException instanceof IllegalStateException)) {
                                                                }
                                                                zziw zziwVar3222 = new zziw(i19, runtimeException, i10);
                                                                vt0.zzf(str2, str, zziwVar3222);
                                                                r(true, false);
                                                                this.f9924h0 = this.f9924h0.zzf(zziwVar3222);
                                                            }
                                                        }
                                                        k kVarK4 = ji2VarZzn2.k();
                                                        ji2 ji2VarS = li2Var.s();
                                                        k kVarK5 = ji2VarS.k();
                                                        mk mkVar = this.f9924h0.f18064a;
                                                        li2 li2Var9 = li2Var;
                                                        k kVar2 = kVarK5;
                                                        C(mkVar, ji2VarS.f12883g.f13271a, mkVar, ji2VarZzn2.f12883g.f13271a, -9223372036854775807L, false);
                                                        if (ji2VarS.f12881e) {
                                                            boolean z17 = this.f9910a0;
                                                            if (z17) {
                                                                j11 = -9223372036854775807L;
                                                                if (this.z0 == -9223372036854775807L) {
                                                                }
                                                                this.z0 = j11;
                                                                if (z17 && !this.A0) {
                                                                    i13 = 0;
                                                                    while (i13 < 2) {
                                                                        k kVar3 = kVar2;
                                                                        if (kVar3.a(i13)) {
                                                                            hj2VarArr5[i13].u();
                                                                            d[] dVarArr = kVar3.f13048c;
                                                                            if (hc.zzd(dVarArr[i13].zzc().zzo, dVarArr[i13].zzc().zzk) || hj2VarArr5[i13].s()) {
                                                                            }
                                                                        }
                                                                        i13++;
                                                                        kVar2 = kVar3;
                                                                    }
                                                                    kVar = kVar2;
                                                                    li2Var2 = li2Var9;
                                                                }
                                                                long jB = ji2VarS.b();
                                                                for (i12 = 0; i12 < 2; i12++) {
                                                                    hj2VarArr5[i12].y(jB);
                                                                }
                                                                if (ji2VarS.c()) {
                                                                    li2Var2 = li2Var9;
                                                                    li2Var2.u(ji2VarS);
                                                                    M(false);
                                                                    H();
                                                                } else {
                                                                    li2Var2 = li2Var9;
                                                                }
                                                            } else {
                                                                j11 = -9223372036854775807L;
                                                            }
                                                            if (ji2VarS.f12877a.zzh() != j11) {
                                                                this.z0 = j11;
                                                                if (z17) {
                                                                    i13 = 0;
                                                                    while (i13 < 2) {
                                                                    }
                                                                    kVar = kVar2;
                                                                    li2Var2 = li2Var9;
                                                                }
                                                                long jB2 = ji2VarS.b();
                                                                while (i12 < 2) {
                                                                }
                                                                if (ji2VarS.c()) {
                                                                }
                                                            } else {
                                                                li2Var2 = li2Var9;
                                                                kVar = kVar2;
                                                            }
                                                        } else {
                                                            li2Var2 = li2Var9;
                                                            kVar = kVar2;
                                                            j11 = -9223372036854775807L;
                                                        }
                                                        int i30 = 0;
                                                        while (i30 < 2) {
                                                            hj2VarArr5[i30].x(kVarK4, kVar, ji2VarS.b());
                                                            i30++;
                                                            j11 = -9223372036854775807L;
                                                        }
                                                    }
                                                    break;
                                                } else if (hj2VarArr5[i29].F(ji2VarZzn5)) {
                                                    i29++;
                                                }
                                            }
                                        }
                                        li2Var2 = li2Var;
                                        ji2VarZzn3 = li2Var2.zzn();
                                        if (ji2VarZzn3 == null) {
                                            li2Var3 = li2Var2;
                                            z12 = false;
                                            while (P()) {
                                                break;
                                            }
                                            i19 = i20;
                                            this.f9946y0.getClass();
                                        }
                                    }
                                } else {
                                    try {
                                        ih1.b1(ji2VarZzo.zzp().f12881e);
                                        if (((long) ((r1.b() - this.f9941t0) / this.Q.zzj().f18031a)) <= 10000000) {
                                            li2Var8.t();
                                            ji2 ji2VarZzo3 = li2Var8.zzo();
                                            if (ji2VarZzo3 != null) {
                                                k kVarK6 = ji2VarZzo3.k();
                                                int i31 = 0;
                                                while (true) {
                                                    hj2[] hj2VarArr6 = this.f9909a;
                                                    if (i31 < 2) {
                                                        if (kVarK6.a(i31) && hj2VarArr6[i31].q() && !hj2VarArr6[i31].s()) {
                                                            hj2VarArr6[i31].r();
                                                            j12 = jUptimeMillis;
                                                            li2Var5 = li2Var8;
                                                            L(ji2VarZzo3, i31, false, ji2VarZzo3.b());
                                                        } else {
                                                            j12 = jUptimeMillis;
                                                            li2Var5 = li2Var8;
                                                        }
                                                        i31++;
                                                        li2Var8 = li2Var5;
                                                        jUptimeMillis = j12;
                                                    } else {
                                                        j10 = jUptimeMillis;
                                                        li2Var = li2Var8;
                                                        if (R()) {
                                                            this.z0 = ji2VarZzo3.f12877a.zzh();
                                                            if (!ji2VarZzo3.c()) {
                                                                li2Var.u(ji2VarZzo3);
                                                                M(false);
                                                                H();
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            ji2VarZzn2 = li2Var.zzn();
                                            if (ji2VarZzn2 == null) {
                                            }
                                        }
                                    } catch (zziw e31) {
                                        e = e31;
                                        zziwVarZzd = e;
                                        i19 = i20;
                                        if (zziwVarZzd.zzc == 1) {
                                        }
                                        if (zziwVarZzd.zzc != 1) {
                                        }
                                        c();
                                        return z10;
                                    } catch (RuntimeException e32) {
                                        e = e32;
                                        runtimeException = e;
                                        i19 = i20;
                                        str = "Playback error";
                                        str2 = "ExoPlayerImplInternal";
                                        i10 = 1004;
                                        if (!(runtimeException instanceof IllegalStateException)) {
                                        }
                                        zziw zziwVar32222 = new zziw(i19, runtimeException, i10);
                                        vt0.zzf(str2, str, zziwVar32222);
                                        r(true, false);
                                        this.f9924h0 = this.f9924h0.zzf(zziwVar32222);
                                        z10 = true;
                                        c();
                                        return z10;
                                    }
                                }
                            }
                        } else {
                            j10 = jUptimeMillis;
                            i19 = 2;
                        }
                    } catch (RuntimeException e33) {
                        e = e33;
                        i19 = i20;
                    }
                    try {
                        int i32 = this.f9924h0.f18068e;
                        if (i32 == 1) {
                            z10 = true;
                        } else if (i32 != 4) {
                            li2 li2Var10 = this.U;
                            ji2 ji2VarZzm4 = li2Var10.zzm();
                            if (ji2VarZzm4 == null) {
                                n(j10);
                            } else {
                                long j18 = j10;
                                Trace.beginSection("doSomeWork");
                                j();
                                if (ji2VarZzm4.f12881e) {
                                    this.f9942u0 = bb1.p(SystemClock.elapsedRealtime());
                                    ji2VarZzm4.f12877a.b(this.f9924h0.f18080q - this.f9933m);
                                    z14 = true;
                                    int i33 = 0;
                                    z15 = true;
                                    while (true) {
                                        hj2[] hj2VarArr7 = this.f9909a;
                                        if (i33 < i19) {
                                            hj2 hj2Var2 = hj2VarArr7[i33];
                                            if (hj2Var2.t() == 0) {
                                                k(i33, false);
                                                ji2Var2 = ji2VarZzm4;
                                                str5 = str7;
                                                str6 = str8;
                                            } else {
                                                ji2 ji2Var3 = ji2VarZzm4;
                                                str5 = str7;
                                                str6 = str8;
                                                hj2Var2.G(this.f9941t0, this.f9942u0);
                                                if (z15 && hj2Var2.D()) {
                                                    ji2Var2 = ji2Var3;
                                                    z15 = true;
                                                } else {
                                                    ji2Var2 = ji2Var3;
                                                    z15 = false;
                                                }
                                                boolean zH = hj2Var2.H(ji2Var2);
                                                k(i33, zH);
                                                z14 = z14 && zH;
                                                if (!zH) {
                                                    Q(i33);
                                                }
                                            }
                                            i33++;
                                            ji2VarZzm4 = ji2Var2;
                                            str7 = str5;
                                            str8 = str6;
                                        } else {
                                            ji2Var = ji2VarZzm4;
                                            str4 = str7;
                                            str3 = str8;
                                        }
                                    }
                                } else {
                                    ji2Var = ji2VarZzm4;
                                    str4 = "Playback error";
                                    str3 = "ExoPlayerImplInternal";
                                    ji2Var.f12877a.a();
                                    z14 = true;
                                    z15 = true;
                                }
                                long j19 = ji2Var.f12883g.f13275e;
                                if (z15 && ji2Var.f12881e) {
                                    j13 = -9223372036854775807L;
                                    if (j19 == -9223372036854775807L || j19 <= this.f9924h0.f18080q) {
                                        if (this.f9932l0) {
                                            this.f9932l0 = false;
                                            int i34 = this.f9924h0.f18076m;
                                            try {
                                                this.f9926i0.a(0);
                                                f(this.f9912b0.a(this.f9924h0.f18068e, false), i34, 5, false);
                                            } catch (zziw e34) {
                                                e = e34;
                                                zziwVarZzd = e;
                                                str7 = str4;
                                                str8 = str3;
                                                if (zziwVarZzd.zzc == 1) {
                                                }
                                                if (zziwVarZzd.zzc != 1) {
                                                }
                                                c();
                                                return z10;
                                            }
                                        }
                                        if (ji2Var.f12883g.f13278h) {
                                            b(4);
                                            i();
                                        }
                                        if (this.f9924h0.f18068e == i19) {
                                            int i35 = 0;
                                            while (true) {
                                                hj2[] hj2VarArr8 = this.f9909a;
                                                if (i35 < i19) {
                                                    if (hj2VarArr8[i35].zzp(ji2Var)) {
                                                        Q(i35);
                                                    }
                                                    i35++;
                                                } else {
                                                    wi2 wi2Var = this.f9924h0;
                                                    if (wi2Var.f18069f || wi2Var.f18079p >= 500000 || !zzaF(li2Var10.zzk()) || !P()) {
                                                        this.f9945x0 = -9223372036854775807L;
                                                    } else if (this.f9945x0 == -9223372036854775807L) {
                                                        this.f9945x0 = SystemClock.elapsedRealtime();
                                                    } else if (SystemClock.elapsedRealtime() - this.f9945x0 >= 4000) {
                                                        throw new zzfb(0, 4000);
                                                    }
                                                    boolean z18 = P() && this.f9924h0.f18068e == 3;
                                                    this.f9924h0.getClass();
                                                    int i36 = this.f9924h0.f18068e;
                                                    if (i36 != 4 && (z18 || i36 == i19 || (i36 == 3 && this.f9940s0 != 0))) {
                                                        n(j18);
                                                    }
                                                    Trace.endSection();
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    j13 = -9223372036854775807L;
                                }
                                wi2 wi2Var2 = this.f9924h0;
                                if (wi2Var2.f18068e != i19) {
                                    if (this.f9924h0.f18068e == 3) {
                                        if (this.f9940s0 == 0) {
                                            if (!A()) {
                                                v(P(), false);
                                                b(i19);
                                                if (this.f9934m0) {
                                                    for (ji2 ji2VarZzm5 = li2Var10.zzm(); ji2VarZzm5 != null; ji2VarZzm5 = ji2VarZzm5.zzp()) {
                                                        for (d dVar : ji2VarZzm5.k().f13048c) {
                                                        }
                                                    }
                                                    this.C0.a();
                                                }
                                                i();
                                            }
                                        } else if (!z14) {
                                            v(P(), false);
                                            b(i19);
                                            if (this.f9934m0) {
                                            }
                                            i();
                                        }
                                    }
                                    if (this.f9924h0.f18068e == i19) {
                                    }
                                } else {
                                    if (this.f9940s0 == 0) {
                                        zC = A();
                                    } else if (z14) {
                                        if (wi2Var2.f18069f) {
                                            ji2 ji2VarZzm6 = li2Var10.zzm();
                                            long jB3 = m(this.f9924h0.f18064a, ji2VarZzm6.f12883g.f13271a) ? this.C0.b() : j13;
                                            ji2 ji2VarZzk = li2Var10.zzk();
                                            boolean z19 = ji2VarZzk.c() && ji2VarZzk.f12883g.f13278h;
                                            boolean z20 = ji2VarZzk.f12883g.f13271a.b() && !ji2VarZzk.f12881e;
                                            if (!z19 && !z20) {
                                                long jN = N(ji2VarZzk.e());
                                                fi2 fi2Var = this.f9919f;
                                                mk2 mk2Var = this.X;
                                                mk mkVar2 = this.f9924h0.f18064a;
                                                cp2 cp2Var6 = ji2VarZzm6.f12883g.f13271a;
                                                float f10 = this.Q.zzj().f18031a;
                                                boolean z21 = this.f9924h0.f18074k;
                                                zC = fi2Var.c(new ei2(mk2Var, mkVar2, cp2Var6, jN, f10, this.f9934m0, jB3));
                                            }
                                        }
                                        b(3);
                                        this.zzX = null;
                                        if (P()) {
                                            v(false, false);
                                            bh2 bh2Var = this.Q;
                                            try {
                                                bh2Var.f9542d = true;
                                                bh2Var.f9539a.a();
                                                h();
                                            } catch (zziw e35) {
                                                e = e35;
                                                zziwVarZzd = e;
                                                str7 = str4;
                                                str8 = str3;
                                                if (zziwVarZzd.zzc == 1) {
                                                    zziwVarZzd = zziwVarZzd.zzd(ji2VarZzn.f12883g.f13271a);
                                                }
                                                if (zziwVarZzd.zzc != 1) {
                                                    zziwVar = this.zzX;
                                                    if (zziwVar != null) {
                                                    }
                                                    zziwVar2 = zziwVarZzd;
                                                    if (zziwVar2.zzc == 1) {
                                                    }
                                                    if (zziwVar2.zzi) {
                                                    }
                                                    vt0.zzf(str8, str7, zziwVar2);
                                                    z10 = true;
                                                    r(true, false);
                                                    this.f9924h0 = this.f9924h0.zzf(zziwVar2);
                                                    break;
                                                }
                                                c();
                                                return z10;
                                            }
                                        }
                                        if (this.f9924h0.f18068e == i19) {
                                        }
                                    } else {
                                        if (this.f9924h0.f18068e == 3) {
                                        }
                                        if (this.f9924h0.f18068e == i19) {
                                        }
                                    }
                                    if (zC) {
                                        b(3);
                                        this.zzX = null;
                                        if (P()) {
                                        }
                                    }
                                    if (this.f9924h0.f18068e == i19) {
                                    }
                                }
                            }
                        }
                    } catch (zziw e36) {
                        e = e36;
                        zziwVarZzd = e;
                        if (zziwVarZzd.zzc == 1) {
                        }
                        if (zziwVarZzd.zzc != 1) {
                        }
                        c();
                        return z10;
                    } catch (RuntimeException e37) {
                        e = e37;
                        str = str7;
                        str2 = str8;
                        runtimeException = e;
                        i10 = 1004;
                        if (!(runtimeException instanceof IllegalStateException)) {
                        }
                        zziw zziwVar322222 = new zziw(i19, runtimeException, i10);
                        vt0.zzf(str2, str, zziwVar322222);
                        r(true, false);
                        this.f9924h0 = this.f9924h0.zzf(zziwVar322222);
                    }
                    z10 = true;
                    break;
                }
                c();
                return z10;
            case 3:
                z11 = true;
                o((bi2) message.obj);
                z10 = z11;
                c();
                return z10;
            case 4:
                z11 = true;
                wd wdVar = (wd) message.obj;
                try {
                    ((h81) this.f9923h).b(16);
                    this.Q.c(wdVar);
                    wdVarZzj = this.Q.zzj();
                } catch (zziw e38) {
                    e = e38;
                } catch (RuntimeException e39) {
                    e = e39;
                }
                try {
                    G(wdVarZzj, wdVarZzj.f18031a, true, true);
                    z10 = z11;
                } catch (zziw e40) {
                    e = e40;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e41) {
                    e = e41;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar3222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar3222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar3222222);
                    z10 = true;
                }
                c();
                return z10;
            case 5:
                z11 = true;
                this.f9914c0 = (jj2) message.obj;
                z10 = z11;
                c();
                return z10;
            case 6:
                z11 = true;
                r(false, true);
                z10 = z11;
                c();
                return z10;
            case 7:
                try {
                    nn0 nn0Var = (nn0) message.obj;
                    try {
                        s(true, false, true, false);
                        i17 = 0;
                    } catch (Throwable th) {
                        th = th;
                    }
                    while (true) {
                        hj2[] hj2VarArr9 = this.f9909a;
                        if (i17 >= 2) {
                            this.f9919f.b(this.X);
                            this.f9912b0.b();
                            this.f9915d.a();
                            b(1);
                            ((h81) this.f9923h).zzm(null);
                            this.f9925i.b();
                            nn0Var.a();
                            return true;
                        }
                        try {
                            this.f9911b[i17].F();
                            hj2VarArr9[i17].i();
                            i17++;
                        } catch (Throwable th2) {
                            th = th2;
                        }
                        th = th2;
                        Throwable th3 = th;
                        ((h81) this.f9923h).zzm(null);
                        this.f9925i.b();
                        nn0Var.a();
                        throw th3;
                    }
                } catch (zziw e42) {
                    e = e42;
                    i20 = 2;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                    c();
                    return z10;
                } catch (RuntimeException e43) {
                    e = e43;
                    i20 = 2;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                        i10 = 1000;
                    }
                    zziw zziwVar32222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar32222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar32222222);
                    z10 = true;
                    c();
                    return z10;
                }
            case 8:
                try {
                    try {
                        ap2 ap2Var = (ap2) message.obj;
                        li2 li2Var11 = this.U;
                        try {
                            if (li2Var11.m(ap2Var)) {
                                ji2 ji2VarZzk2 = li2Var11.zzk();
                                ji2VarZzk2.getClass();
                                if (!ji2VarZzk2.f12881e) {
                                    float f11 = this.Q.zzj().f18031a;
                                    wi2 wi2Var3 = this.f9924h0;
                                    ji2VarZzk2.f(f11, wi2Var3.f18064a, wi2Var3.f18074k);
                                }
                                O(ji2VarZzk2.f12883g.f13271a, ji2VarZzk2.j(), ji2VarZzk2.k());
                                if (ji2VarZzk2 == li2Var11.zzm()) {
                                    q(ji2VarZzk2.f12883g.f13272b, true);
                                    try {
                                        K(new boolean[2], this.U.zzn().b());
                                        ji2VarZzk2.f12884h = true;
                                        wi2 wi2Var4 = this.f9924h0;
                                        cp2 cp2Var7 = wi2Var4.f18065b;
                                        long j20 = ji2VarZzk2.f12883g.f13272b;
                                        z11 = true;
                                        this.f9924h0 = J(cp2Var7, j20, wi2Var4.f18066c, j20, false, 5);
                                    } catch (zziw e44) {
                                        e = e44;
                                        zziwVarZzd = e;
                                        i19 = 2;
                                        if (zziwVarZzd.zzc == 1) {
                                        }
                                        if (zziwVarZzd.zzc != 1) {
                                        }
                                    } catch (RuntimeException e45) {
                                        e = e45;
                                        runtimeException = e;
                                        str = "Playback error";
                                        str2 = "ExoPlayerImplInternal";
                                        i19 = 2;
                                        i10 = 1004;
                                        if (!(runtimeException instanceof IllegalStateException)) {
                                        }
                                        zziw zziwVar322222222 = new zziw(i19, runtimeException, i10);
                                        vt0.zzf(str2, str, zziwVar322222222);
                                        r(true, false);
                                        this.f9924h0 = this.f9924h0.zzf(zziwVar322222222);
                                        z10 = true;
                                    }
                                } else {
                                    z11 = true;
                                }
                                H();
                            } else {
                                z11 = true;
                                ji2 ji2VarZzu = li2Var11.zzu(ap2Var);
                                if (ji2VarZzu != null) {
                                    ih1.b1(!ji2VarZzu.f12881e);
                                    float f12 = this.Q.zzj().f18031a;
                                    wi2 wi2Var5 = this.f9924h0;
                                    ji2VarZzu.f(f12, wi2Var5.f18064a, wi2Var5.f18074k);
                                    if (li2Var11.n(ap2Var)) {
                                        E();
                                    }
                                }
                            }
                            z10 = z11;
                        } catch (zziw e46) {
                            e = e46;
                        } catch (RuntimeException e47) {
                            e = e47;
                        }
                    } catch (zziw e48) {
                        e = e48;
                    } catch (RuntimeException e49) {
                        e = e49;
                    }
                } catch (zzat e50) {
                    e = e50;
                    zzat zzatVar = e;
                    a(zzatVar, zzatVar.zzb == 1 ? true != zzatVar.zza ? PlaybackException.ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED : PlaybackException.ERROR_CODE_PARSING_CONTAINER_MALFORMED : 1000);
                    z10 = true;
                } catch (zzhc e51) {
                    e = e51;
                    zzhc zzhcVar = e;
                    a(zzhcVar, zzhcVar.zza);
                    z10 = true;
                } catch (zztg e52) {
                    e = e52;
                    zztg zztgVar = e;
                    a(zztgVar, zztgVar.zza);
                    z10 = true;
                } catch (IOException e53) {
                    e = e53;
                    a(e, 2000);
                    z10 = true;
                }
                c();
                return z10;
            case 9:
                ap2 ap2Var2 = (ap2) message.obj;
                li2 li2Var12 = this.U;
                if (li2Var12.m(ap2Var2)) {
                    li2Var12.o(this.f9941t0);
                    H();
                } else if (li2Var12.n(ap2Var2)) {
                    E();
                }
                z10 = true;
                c();
                return z10;
            case 10:
                z();
                z10 = true;
                c();
                return z10;
            case 11:
                int i37 = message.arg1;
                this.f9937p0 = i37;
                int iJ = this.U.j(this.f9924h0.f18064a, i37);
                if ((iJ & 1) != 0) {
                    g(true);
                } else if ((iJ & 2) != 0) {
                    y();
                }
                M(false);
                z10 = true;
                c();
                return z10;
            case 12:
                boolean z22 = message.arg1 != 0;
                this.f9938q0 = z22;
                int iK = this.U.k(this.f9924h0.f18064a, z22);
                if ((iK & 1) != 0) {
                    g(true);
                } else if ((iK & 2) != 0) {
                    y();
                }
                M(false);
                z10 = true;
                c();
                return z10;
            case 13:
                boolean z23 = message.arg1 != 0;
                nn0 nn0Var2 = (nn0) message.obj;
                if (this.f9939r0 != z23) {
                    this.f9939r0 = z23;
                    if (!z23) {
                        hj2[] hj2VarArr10 = this.f9909a;
                        for (int i38 = 0; i38 < 2; i38++) {
                            hj2VarArr10[i38].g();
                        }
                    }
                }
                if (nn0Var2 != null) {
                    nn0Var2.a();
                }
                z10 = true;
                c();
                return z10;
            case 14:
                aj2 aj2Var = (aj2) message.obj;
                if (aj2Var.a() == this.f9927j) {
                    w(aj2Var);
                    int i39 = this.f9924h0.f18068e;
                    if (i39 == 3 || i39 == 2) {
                        ((h81) this.f9923h).a(2);
                    }
                } else {
                    ((u71) ((h81) this.f9923h).zzd(15, aj2Var)).a();
                }
                z10 = true;
                c();
                return z10;
            case 15:
                aj2 aj2Var2 = (aj2) message.obj;
                Looper looperA = aj2Var2.a();
                if (looperA.getThread().isAlive()) {
                    ((h81) ((h71) this.S).zzd(looperA, null)).c(new na1(aj2Var2));
                } else {
                    vt0.c("Trying to send message on a dead thread.");
                    aj2Var2.c(false);
                }
                z10 = true;
                c();
                return z10;
            case 16:
                wd wdVar2 = (wd) message.obj;
                try {
                    G(wdVar2, wdVar2.f18031a, true, false);
                    z10 = true;
                } catch (zziw e54) {
                    e = e54;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e55) {
                    e = e55;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar3222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar3222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar3222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 17:
                yh2 yh2Var = (yh2) message.obj;
                this.f9926i0.a(1);
                if (yh2Var.b() != -1) {
                    this.zzS = new bi2(new cj2(yh2Var.a(), yh2Var.d()), yh2Var.b(), yh2Var.c());
                }
                B(this.V.f(yh2Var.a(), yh2Var.d()), false);
                z10 = true;
                c();
                return z10;
            case 18:
                yh2 yh2Var2 = (yh2) message.obj;
                int iC = message.arg1;
                this.f9926i0.a(1);
                vi2 vi2Var = this.V;
                if (iC == -1) {
                    iC = vi2Var.c();
                }
                B(vi2Var.g(iC, yh2Var2.a(), yh2Var2.d()), false);
                z10 = true;
                c();
                return z10;
            case 19:
                com.google.android.gms.measurement.internal.u1.x(message.obj);
                this.f9926i0.a(1);
                throw null;
            case 20:
                int i40 = message.arg1;
                int i41 = message.arg2;
                mq2 mq2Var = (mq2) message.obj;
                this.f9926i0.a(1);
                B(this.V.h(i40, i41, mq2Var), false);
                z10 = true;
                c();
                return z10;
            case 21:
                mq2 mq2Var2 = (mq2) message.obj;
                this.f9926i0.a(1);
                B(this.V.i(mq2Var2), false);
                z10 = true;
                c();
                return z10;
            case 22:
                B(this.V.e(), true);
                z10 = true;
                c();
                return z10;
            case 23:
                this.f9930k0 = message.arg1 != 0;
                F();
                if (this.f9932l0) {
                    li2 li2Var13 = this.U;
                    if (li2Var13.zzn() != li2Var13.zzm()) {
                        g(true);
                        M(false);
                    }
                }
                z10 = true;
                c();
                return z10;
            case 24:
            default:
                return false;
            case 25:
                try {
                    z();
                    g(true);
                    z10 = true;
                } catch (zziw e56) {
                    e = e56;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e57) {
                    e = e57;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar32222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar32222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar32222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 26:
                try {
                    z();
                    g(true);
                    z10 = true;
                } catch (zziw e58) {
                    e = e58;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e59) {
                    e = e59;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar322222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar322222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar322222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 27:
                int i42 = message.arg1;
                int i43 = message.arg2;
                List list = (List) message.obj;
                this.f9926i0.a(1);
                B(this.V.a(i42, i43, list), false);
                z10 = true;
                c();
                return z10;
            case 28:
                gh2 gh2Var = (gh2) message.obj;
                this.f9946y0 = gh2Var;
                li2 li2Var14 = this.U;
                mk mkVar3 = this.f9924h0.f18064a;
                li2Var14.l(gh2Var);
                z10 = true;
                c();
                return z10;
            case 29:
                this.f9926i0.a(1);
                s(false, false, false, true);
                this.f9919f.a(this.X);
                b(true != this.f9924h0.f18064a.g() ? 2 : 4);
                try {
                    wi2 wi2Var6 = this.f9924h0;
                    boolean z24 = wi2Var6.f18074k;
                    f(this.f9912b0.a(wi2Var6.f18068e, z24), wi2Var6.f18076m, wi2Var6.f18075l, z24);
                    vi2 vi2Var2 = this.V;
                    t tVar = (t) this.f9921g;
                    tVar.getClass();
                    vi2Var2.zzd(tVar);
                    ((h81) this.f9923h).a(2);
                    z10 = true;
                } catch (zziw e60) {
                    e = e60;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e61) {
                    e = e61;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar3222222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar3222222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar3222222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 30:
                Pair pair = (Pair) message.obj;
                Object obj = pair.first;
                nn0 nn0Var3 = (nn0) pair.second;
                hj2[] hj2VarArr11 = this.f9909a;
                for (int i44 = 0; i44 < 2; i44++) {
                    hj2VarArr11[i44].zzJ(obj);
                }
                int i45 = this.f9924h0.f18068e;
                if (i45 == 3 || i45 == 2) {
                    ((h81) this.f9923h).a(2);
                }
                if (nn0Var3 != null) {
                    nn0Var3.a();
                }
                z10 = true;
                c();
                return z10;
            case 31:
                ud0 ud0Var2 = (ud0) message.obj;
                int i46 = message.arg1;
                this.f9915d.b(ud0Var2);
                d20 d20Var = this.f9912b0;
                if (i46 != 0) {
                    ud0Var = ud0Var2;
                }
                d20Var.zzb(ud0Var);
                try {
                    wi2 wi2Var7 = this.f9924h0;
                    boolean z25 = wi2Var7.f18074k;
                    f(this.f9912b0.a(wi2Var7.f18068e, z25), wi2Var7.f18076m, wi2Var7.f18075l, z25);
                    z10 = true;
                } catch (zziw e62) {
                    e = e62;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e63) {
                    e = e63;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar32222222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar32222222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar32222222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 32:
                float fFloatValue = ((Float) message.obj).floatValue();
                try {
                    this.B0 = fFloatValue;
                    float f13 = fFloatValue * this.f9912b0.f10158e;
                    for (int i47 = 0; i47 < 2; i47++) {
                        this.f9909a[i47].k(f13);
                    }
                    z10 = true;
                } catch (zziw e64) {
                    e = e64;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e65) {
                    e = e65;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar322222222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar322222222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar322222222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 33:
                int i48 = message.arg1;
                wi2 wi2Var8 = this.f9924h0;
                f(i48, wi2Var8.f18076m, wi2Var8.f18075l, wi2Var8.f18074k);
                z10 = true;
                c();
                return z10;
            case 34:
                float f14 = this.B0;
                try {
                    this.B0 = f14;
                    float f15 = f14 * this.f9912b0.f10158e;
                    for (int i49 = 0; i49 < 2; i49++) {
                        this.f9909a[i49].k(f15);
                    }
                    z10 = true;
                } catch (zziw e66) {
                    e = e66;
                    zziwVarZzd = e;
                    i19 = i20;
                    if (zziwVarZzd.zzc == 1) {
                    }
                    if (zziwVarZzd.zzc != 1) {
                    }
                } catch (RuntimeException e67) {
                    e = e67;
                    runtimeException = e;
                    i19 = i20;
                    str = "Playback error";
                    str2 = "ExoPlayerImplInternal";
                    i10 = 1004;
                    if (!(runtimeException instanceof IllegalStateException)) {
                    }
                    zziw zziwVar3222222222222222 = new zziw(i19, runtimeException, i10);
                    vt0.zzf(str2, str, zziwVar3222222222222222);
                    r(true, false);
                    this.f9924h0 = this.f9924h0.zzf(zziwVar3222222222222222);
                    z10 = true;
                }
                c();
                return z10;
            case 35:
                b1 b1Var = (b1) message.obj;
                hj2[] hj2VarArr12 = this.f9909a;
                for (int i50 = 0; i50 < 2; i50++) {
                    hj2VarArr12[i50].j(b1Var);
                }
                z10 = true;
                c();
                return z10;
            case 36:
                boolean zBooleanValue = ((Boolean) message.obj).booleanValue();
                if (zBooleanValue) {
                    this.f9918e0 = zBooleanValue;
                    for (i18 = 0; i18 < 2; i18++) {
                        try {
                            this.f9909a[i18].zzz(this.f9918e0 ? this.f9916d0 : null);
                        } catch (zziw e68) {
                            e = e68;
                            zziwVarZzd = e;
                            i19 = i20;
                            if (zziwVarZzd.zzc == 1) {
                            }
                            if (zziwVarZzd.zzc != 1) {
                            }
                            c();
                            return z10;
                        } catch (RuntimeException e69) {
                            e = e69;
                            runtimeException = e;
                            i19 = i20;
                            str = "Playback error";
                            str2 = "ExoPlayerImplInternal";
                            i10 = 1004;
                            if (!(runtimeException instanceof IllegalStateException)) {
                            }
                            zziw zziwVar32222222222222222 = new zziw(i19, runtimeException, i10);
                            vt0.zzf(str2, str, zziwVar32222222222222222);
                            r(true, false);
                            this.f9924h0 = this.f9924h0.zzf(zziwVar32222222222222222);
                            z10 = true;
                            c();
                            return z10;
                        }
                    }
                    z10 = true;
                } else {
                    if (this.zzE != null && this.f9920f0) {
                        try {
                            if (!((h81) this.f9923h).f12056a.hasMessages(37)) {
                                this.f9922g0++;
                            }
                        } catch (zziw e70) {
                            e = e70;
                            zziwVarZzd = e;
                            i19 = i20;
                            if (zziwVarZzd.zzc == 1) {
                            }
                            if (zziwVarZzd.zzc != 1) {
                            }
                            c();
                            return z10;
                        } catch (RuntimeException e71) {
                            e = e71;
                            runtimeException = e;
                            i19 = i20;
                            str = "Playback error";
                            str2 = "ExoPlayerImplInternal";
                            i10 = 1004;
                            if (!(runtimeException instanceof IllegalStateException)) {
                            }
                            zziw zziwVar322222222222222222 = new zziw(i19, runtimeException, i10);
                            vt0.zzf(str2, str, zziwVar322222222222222222);
                            r(true, false);
                            this.f9924h0 = this.f9924h0.zzf(zziwVar322222222222222222);
                            z10 = true;
                            c();
                            return z10;
                        }
                    }
                    int i51 = this.f9922g0;
                    if (i51 > 0) {
                        ((h81) this.Z).c(new lh(i51, 6, this));
                    }
                    this.f9922g0 = 0;
                    this.f9920f0 = false;
                    ((h81) this.f9923h).b(37);
                    bi2 bi2Var = this.zzE;
                    if (bi2Var != null) {
                        o(bi2Var);
                        this.zzE = null;
                        this.f9920f0 = false;
                    }
                    this.f9918e0 = zBooleanValue;
                    while (i18 < 2) {
                    }
                    z10 = true;
                }
                c();
                return z10;
            case 37:
                this.f9920f0 = false;
                bi2 bi2Var2 = this.zzE;
                if (bi2Var2 != null) {
                    o(bi2Var2);
                    this.zzE = null;
                }
                z10 = true;
                c();
                return z10;
            case 38:
                this.f9916d0 = (ij2) message.obj;
                for (int i52 = 0; i52 < 2; i52++) {
                    try {
                        this.f9909a[i52].zzz(this.f9918e0 ? this.f9916d0 : null);
                    } catch (zziw e72) {
                        e = e72;
                        zziwVarZzd = e;
                        i19 = i20;
                        if (zziwVarZzd.zzc == 1) {
                        }
                        if (zziwVarZzd.zzc != 1) {
                        }
                        c();
                        return z10;
                    } catch (RuntimeException e73) {
                        e = e73;
                        runtimeException = e;
                        i19 = i20;
                        str = "Playback error";
                        str2 = "ExoPlayerImplInternal";
                        i10 = 1004;
                        if (!(runtimeException instanceof IllegalStateException)) {
                        }
                        zziw zziwVar3222222222222222222 = new zziw(i19, runtimeException, i10);
                        vt0.zzf(str2, str, zziwVar3222222222222222222);
                        r(true, false);
                        this.f9924h0 = this.f9924h0.zzf(zziwVar3222222222222222222);
                        z10 = true;
                        c();
                        return z10;
                    }
                }
                z10 = true;
                c();
                return z10;
        }
    }

    public final void i() {
        bh2 bh2Var = this.Q;
        bh2Var.f9542d = false;
        bh2Var.f9539a.b();
        for (int i10 = 0; i10 < 2; i10++) {
            this.f9909a[i10].K();
        }
    }

    public final void j() {
        long j10;
        li2 li2Var = this.U;
        ji2 ji2VarZzm = li2Var.zzm();
        if (ji2VarZzm == null) {
            return;
        }
        long jZzh = ji2VarZzm.f12881e ? ji2VarZzm.f12877a.zzh() : -9223372036854775807L;
        if (jZzh != -9223372036854775807L) {
            if (!ji2VarZzm.c()) {
                li2Var.u(ji2VarZzm);
                M(false);
                H();
            }
            q(jZzh, true);
            if (jZzh != this.f9924h0.f18080q) {
                wi2 wi2Var = this.f9924h0;
                this.f9924h0 = J(wi2Var.f18065b, jZzh, wi2Var.f18066c, jZzh, true, 5);
            }
        } else {
            bh2 bh2Var = this.Q;
            long jD = bh2Var.d(ji2VarZzm != li2Var.zzn());
            this.f9941t0 = jD;
            long j11 = jD - ji2VarZzm.f12891o;
            long j12 = this.f9924h0.f18080q;
            ArrayList arrayList = this.R;
            if (!arrayList.isEmpty() && !this.f9924h0.f18065b.b()) {
                if (this.f9944w0) {
                    this.f9944w0 = false;
                }
                wi2 wi2Var2 = this.f9924h0;
                wi2Var2.f18064a.e(wi2Var2.f18065b.f10025a);
                int iMin = Math.min(this.f9943v0, arrayList.size());
                if (iMin > 0) {
                    com.google.android.gms.measurement.internal.u1.x(arrayList.get(iMin - 1));
                }
                if (iMin < arrayList.size()) {
                    com.google.android.gms.measurement.internal.u1.x(arrayList.get(iMin));
                }
                this.f9943v0 = iMin;
            }
            if (bh2Var.zzh()) {
                boolean z10 = !this.f9926i0.f19287d;
                wi2 wi2Var3 = this.f9924h0;
                this.f9924h0 = J(wi2Var3.f18065b, j11, wi2Var3.f18066c, j11, z10, 6);
            } else {
                wi2 wi2Var4 = this.f9924h0;
                wi2Var4.f18080q = j11;
                wi2Var4.f18081r = SystemClock.elapsedRealtime();
            }
        }
        this.f9924h0.f18078o = li2Var.zzk().e();
        wi2 wi2Var5 = this.f9924h0;
        wi2Var5.f18079p = N(wi2Var5.f18078o);
        wi2 wi2Var6 = this.f9924h0;
        if (wi2Var6.f18074k && wi2Var6.f18068e == 3 && m(wi2Var6.f18064a, wi2Var6.f18065b)) {
            wi2 wi2Var7 = this.f9924h0;
            float fMax = 1.0f;
            if (wi2Var7.f18077n.f18031a == 1.0f) {
                wg2 wg2Var = this.C0;
                long jL = l(wi2Var7.f18064a, wi2Var7.f18065b.f10025a, wi2Var7.f18080q);
                long j13 = this.f9924h0.f18079p;
                if (wg2Var.f18046c != -9223372036854775807L) {
                    long j14 = jL - j13;
                    long j15 = wg2Var.f18056m;
                    if (j15 == -9223372036854775807L) {
                        wg2Var.f18056m = j14;
                        wg2Var.f18057n = 0L;
                        j10 = jL;
                    } else {
                        j10 = jL;
                        wg2Var.f18056m = Math.max(j14, (long) ((j14 * 9.999871E-4f) + (j15 * 0.999f)));
                        wg2Var.f18057n = (long) ((Math.abs(j14 - r3) * 9.999871E-4f) + (wg2Var.f18057n * 0.999f));
                    }
                    if (wg2Var.f18055l == -9223372036854775807L || SystemClock.elapsedRealtime() - wg2Var.f18055l >= 1000) {
                        wg2Var.f18055l = SystemClock.elapsedRealtime();
                        long jMax = (wg2Var.f18057n * 3) + wg2Var.f18056m;
                        if (wg2Var.f18051h > jMax) {
                            float fP = bb1.p(1000L);
                            long[] jArr = {jMax, wg2Var.f18048e, wg2Var.f18051h - (((long) ((wg2Var.f18054k - 1.0f) * fP)) + ((long) ((wg2Var.f18052i - 1.0f) * fP)))};
                            for (int i10 = 1; i10 < 3; i10++) {
                                long j16 = jArr[i10];
                                if (j16 > jMax) {
                                    jMax = j16;
                                }
                            }
                            wg2Var.f18051h = jMax;
                        } else {
                            long jMax2 = j10 - ((long) (Math.max(0.0f, wg2Var.f18054k - 1.0f) / 1.0E-7f));
                            long j17 = wg2Var.f18051h;
                            String str = bb1.f9474a;
                            jMax = Math.max(j17, Math.min(jMax2, jMax));
                            wg2Var.f18051h = jMax;
                            long j18 = wg2Var.f18050g;
                            if (j18 != -9223372036854775807L && jMax > j18) {
                                wg2Var.f18051h = j18;
                                jMax = j18;
                            }
                        }
                        long j19 = j10 - jMax;
                        if (Math.abs(j19) < wg2Var.f18044a) {
                            wg2Var.f18054k = 1.0f;
                            fMax = 1.0f;
                        } else {
                            fMax = Math.max(wg2Var.f18053j, Math.min((j19 * 1.0E-7f) + 1.0f, wg2Var.f18052i));
                            wg2Var.f18054k = fMax;
                        }
                    } else {
                        fMax = wg2Var.f18054k;
                    }
                }
                bh2 bh2Var2 = this.Q;
                if (bh2Var2.zzj().f18031a != fMax) {
                    wd wdVar = new wd(fMax, this.f9924h0.f18077n.f18032b);
                    ((h81) this.f9923h).b(16);
                    this.Q.c(wdVar);
                    G(this.f9924h0.f18077n, bh2Var2.zzj().f18031a, false, false);
                }
            }
        }
    }

    public final void k(final int i10, final boolean z10) {
        boolean[] zArr = this.f9913c;
        if (zArr[i10] != z10) {
            zArr[i10] = z10;
            ((h81) this.Z).c(new Runnable(i10, z10) { // from class: com.google.android.gms.internal.ads.xh2

                /* JADX INFO: renamed from: b, reason: collision with root package name */
                public final /* synthetic */ int f18441b;

                @Override // java.lang.Runnable
                public final void run() {
                    ci2 ci2Var = this.f18440a;
                    ci2Var.f9909a[this.f18441b].u();
                    ek2 ek2Var = (ek2) ci2Var.Y;
                    ek2Var.r(ek2Var.u(), AnalyticsListener.EVENT_RENDERER_READY_CHANGED, new zj2((com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b) null));
                }
            });
        }
    }

    public final long l(mk mkVar, Object obj, long j10) {
        int i10 = mkVar.n(obj, this.f9931l).f11762a;
        tj tjVar = this.f9929k;
        mkVar.b(i10, tjVar, 0L);
        if (tjVar.f16913d == -9223372036854775807L || !tjVar.a() || !tjVar.f16916g) {
            return -9223372036854775807L;
        }
        long j11 = tjVar.f16914e;
        String str = bb1.f9474a;
        return bb1.p((j11 == -9223372036854775807L ? System.currentTimeMillis() : j11 + SystemClock.elapsedRealtime()) - tjVar.f16913d) - j10;
    }

    public final boolean m(mk mkVar, cp2 cp2Var) {
        if (!cp2Var.b() && !mkVar.g()) {
            int i10 = mkVar.n(cp2Var.f10025a, this.f9931l).f11762a;
            tj tjVar = this.f9929k;
            mkVar.b(i10, tjVar, 0L);
            if (tjVar.a() && tjVar.f16916g && tjVar.f16913d != -9223372036854775807L) {
                return true;
            }
        }
        return false;
    }

    public final void n(long j10) {
        boolean z10;
        if (this.f9918e0) {
            this.f9916d0.getClass();
            z10 = true;
        } else {
            z10 = false;
        }
        long j11 = D0;
        if (z10) {
            jMin = this.f9924h0.f18068e != 3 ? j11 : 1000L;
            for (int i10 = 0; i10 < 2; i10++) {
                jMin = Math.min(jMin, bb1.o(this.f9909a[i10].z(this.f9941t0, this.f9942u0)));
            }
            if (this.f9924h0.h()) {
                li2 li2Var = this.U;
                if ((li2Var.zzm() != null ? li2Var.zzm().zzp() : null) != null) {
                    if (this.f9941t0 + (bb1.p(jMin) * this.f9924h0.f18077n.f18031a) >= r0.b()) {
                        jMin = Math.min(jMin, j11);
                    }
                }
            }
        } else if (this.f9924h0.f18068e != 3 || P()) {
            jMin = j11;
        }
        ((h81) this.f9923h).f12056a.sendEmptyMessageAtTime(2, j10 + jMin);
    }

    /* JADX WARN: Removed duplicated region for block: B:36:0x00cb A[Catch: all -> 0x00ce, TryCatch #2 {all -> 0x00ce, blocks: (B:34:0x00c1, B:36:0x00cb, B:41:0x00d5, B:43:0x00db, B:44:0x00de, B:46:0x00e6, B:48:0x00f2, B:50:0x00fa, B:54:0x0102, B:58:0x0113, B:59:0x0117, B:61:0x011f), top: B:110:0x00c1 }] */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00d2  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void o(bi2 bi2Var) throws Throwable {
        long jLongValue;
        boolean z10;
        cp2 cp2Var;
        long j10;
        long jMax;
        int i10;
        boolean z11;
        long j11;
        long j12;
        long jP;
        long j13;
        long jF;
        wi2 wi2Var;
        int i11;
        if (this.f9920f0) {
            if (this.zzE != null) {
                this.f9922g0++;
                this.f9926i0.a(1);
            }
            this.zzE = bi2Var;
            return;
        }
        this.f9926i0.a(1);
        mk mkVar = this.f9924h0.f18064a;
        int i12 = this.f9937p0;
        boolean z12 = this.f9938q0;
        tj tjVar = this.f9929k;
        gj gjVar = this.f9931l;
        Pair pairZzaD = zzaD(mkVar, bi2Var, true, i12, z12, tjVar, gjVar);
        try {
            if (pairZzaD == null) {
                Pair pairT = t(this.f9924h0.f18064a);
                cp2Var = (cp2) pairT.first;
                jLongValue = ((Long) pairT.second).longValue();
                z10 = !this.f9924h0.f18064a.g();
            } else {
                Object obj = pairZzaD.first;
                jLongValue = ((Long) pairZzaD.second).longValue();
                long j14 = bi2Var.f9553c;
                j = j14 != -9223372036854775807L ? jLongValue : -9223372036854775807L;
                cp2 cp2VarZ = this.U.z(this.f9924h0.f18064a, obj, jLongValue);
                if (cp2VarZ.b()) {
                    this.f9924h0.f18064a.n(cp2VarZ.f10025a, gjVar);
                    a aVarA = gjVar.f11765d.a(-1);
                    int i13 = 0;
                    while (true) {
                        int[] iArr = aVarA.f8429d;
                        if (i13 >= iArr.length || (i10 = iArr[i13]) == 0 || i10 == 1) {
                            break;
                        } else {
                            i13++;
                        }
                    }
                    if (i13 == -1) {
                        gjVar.f11765d.getClass();
                    }
                    gjVar.f11765d.a(-1).getClass();
                    j10 = 0;
                    jMax = Math.max(j, 0L);
                    cp2Var = cp2VarZ;
                    z10 = true;
                    if (!this.f9924h0.f18064a.g()) {
                        this.zzS = bi2Var;
                    } else if (pairZzaD == null) {
                        if (this.f9924h0.f18068e != 1) {
                            b(4);
                        }
                        s(false, true, false, true);
                    } else {
                        try {
                            if (cp2Var.equals(this.f9924h0.f18065b)) {
                                ji2 ji2VarZzm = this.U.zzm();
                                if (ji2VarZzm == null || !ji2VarZzm.f12881e || j10 == 0) {
                                    jF = j10;
                                } else {
                                    ap2 ap2Var = ji2VarZzm.f12877a;
                                    long j15 = tjVar.f16918i;
                                    if (this.f9918e0 && j15 != -9223372036854775807L) {
                                        Double d10 = this.f9916d0.zzc;
                                    }
                                    jF = ap2Var.f(j10, this.f9914c0);
                                }
                                z11 = z10;
                                try {
                                    if (bb1.o(jF) == bb1.o(this.f9924h0.f18080q) && ((i11 = (wi2Var = this.f9924h0).f18068e) == 2 || i11 == 3)) {
                                        j13 = wi2Var.f18080q;
                                        this.f9924h0 = J(cp2Var, j13, jMax, j13, z11, 2);
                                        return;
                                    }
                                    j12 = jF;
                                } catch (Throwable th) {
                                    th = th;
                                    j11 = j10;
                                    this.f9924h0 = J(cp2Var, j11, jMax, j11, z11, 2);
                                    throw th;
                                }
                            } else {
                                z11 = z10;
                                j12 = j10;
                            }
                            wi2 wi2Var2 = this.f9924h0;
                            mk mkVar2 = wi2Var2.f18064a;
                            C(mkVar2, cp2Var, mkVar2, wi2Var2.f18065b, jMax, true);
                            j13 = jP;
                            this.f9924h0 = J(cp2Var, j13, jMax, j13, z11, 2);
                            return;
                        } catch (Throwable th2) {
                            th = th2;
                            j11 = jP;
                            this.f9924h0 = J(cp2Var, j11, jMax, j11, z11, 2);
                            throw th;
                        }
                        if (this.f9918e0) {
                            hj2[] hj2VarArr = this.f9909a;
                            int i14 = 0;
                            while (true) {
                                if (i14 >= 2) {
                                    break;
                                }
                                hj2 hj2Var = hj2VarArr[i14];
                                if (hj2Var.l() && hj2Var.u() == 2) {
                                    this.f9920f0 = true;
                                    break;
                                }
                                i14++;
                            }
                        }
                        boolean z13 = this.f9924h0.f18068e == 4;
                        li2 li2Var = this.U;
                        jP = p(cp2Var, j12, li2Var.zzm() != li2Var.zzn(), z13);
                        z11 |= j10 != jP;
                    }
                    z11 = z10;
                    j13 = j10;
                    this.f9924h0 = J(cp2Var, j13, jMax, j13, z11, 2);
                    return;
                }
                z10 = j14 == -9223372036854775807L;
                cp2Var = cp2VarZ;
            }
            if (!this.f9924h0.f18064a.g()) {
            }
            z11 = z10;
            j13 = j10;
            this.f9924h0 = J(cp2Var, j13, jMax, j13, z11, 2);
            return;
        } catch (Throwable th3) {
            th = th3;
            z11 = z10;
        }
        j10 = jLongValue;
        jMax = j;
    }

    /* JADX WARN: Removed duplicated region for block: B:48:0x00d0  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final long p(cp2 cp2Var, long j10, boolean z10, boolean z11) throws zziw {
        i();
        boolean z12 = true;
        v(false, true);
        if (z11 || this.f9924h0.f18068e == 3) {
            b(2);
        }
        li2 li2Var = this.U;
        ji2 ji2VarZzm = li2Var.zzm();
        ji2 ji2VarZzp = ji2VarZzm;
        while (ji2VarZzp != null && !cp2Var.equals(ji2VarZzp.f12883g.f13271a)) {
            ji2VarZzp = ji2VarZzp.zzp();
        }
        if (z10 || ji2VarZzm != ji2VarZzp || (ji2VarZzp != null && ji2VarZzp.f12891o + j10 < 0)) {
            x();
            if (ji2VarZzp != null) {
                while (li2Var.zzm() != ji2VarZzp) {
                    li2Var.zzr();
                }
                li2Var.u(ji2VarZzp);
                ji2VarZzp.f12891o = MediaPeriodQueue.INITIAL_RENDERER_POSITION_OFFSET_US;
                K(new boolean[2], this.U.zzn().b());
                ji2VarZzp.f12884h = true;
            }
        }
        y();
        if (ji2VarZzp != null) {
            li2Var.u(ji2VarZzp);
            if (!ji2VarZzp.f12881e) {
                ji2VarZzp.f12883g = ji2VarZzp.f12883g.a(j10);
            } else if (ji2VarZzp.f12882f) {
                if (this.f9918e0) {
                    this.f9916d0.getClass();
                    if (this.f9924h0.f18064a.g() || !ji2VarZzp.f12883g.f13271a.equals(this.f9924h0.f18065b)) {
                        ap2 ap2Var = ji2VarZzp.f12877a;
                        j10 = ap2Var.h(j10);
                        ap2Var.b(j10 - this.f9933m);
                    } else {
                        hj2[] hj2VarArr = this.f9909a;
                        boolean zF = true;
                        for (int i10 = 0; i10 < 2; i10++) {
                            hj2 hj2Var = hj2VarArr[i10];
                            if (hj2Var.l()) {
                                zF &= hj2Var.f(ji2VarZzp, j10);
                            }
                        }
                        if (zF) {
                            ap2 ap2Var2 = ji2VarZzp.f12877a;
                            long j11 = this.f9924h0.f18080q;
                            jj2 jj2Var = jj2.f12909c;
                            if (ap2Var2.f(j11, jj2Var) == ap2Var2.f(j10, jj2Var)) {
                                z12 = false;
                            }
                        }
                    }
                }
            }
            q(j10, z12);
            H();
        } else {
            li2Var.w();
            q(j10, true);
        }
        M(false);
        ((h81) this.f9923h).a(2);
        return j10;
    }

    public final void q(long j10, boolean z10) {
        ji2 ji2VarZzm = this.U.zzm();
        long j11 = j10 + (ji2VarZzm == null ? MediaPeriodQueue.INITIAL_RENDERER_POSITION_OFFSET_US : ji2VarZzm.f12891o);
        this.f9941t0 = j11;
        this.Q.f9539a.d(j11);
        for (int i10 = 0; i10 < 2; i10++) {
            this.f9909a[i10].e(ji2VarZzm, this.f9941t0, z10);
        }
        for (ji2 ji2VarZzm2 = r0.zzm(); ji2VarZzm2 != null; ji2VarZzm2 = ji2VarZzm2.zzp()) {
            for (d dVar : ji2VarZzm2.f12890n.f13048c) {
            }
        }
    }

    public final void r(boolean z10, boolean z11) {
        s(z10 || !this.f9939r0, false, true, false);
        this.f9926i0.a(z11 ? 1 : 0);
        this.f9919f.d(this.X);
        this.f9912b0.a(1, this.f9924h0.f18074k);
        b(1);
    }

    /* JADX WARN: Removed duplicated region for block: B:29:0x0084  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x00b3 A[PHI: r2 r7 r9
      0x00b3: PHI (r2v2 com.google.android.gms.internal.ads.cp2) = (r2v1 com.google.android.gms.internal.ads.cp2), (r2v7 com.google.android.gms.internal.ads.cp2) binds: [B:30:0x0088, B:32:0x00ad] A[DONT_GENERATE, DONT_INLINE]
      0x00b3: PHI (r7v3 long) = (r7v2 long), (r7v16 long) binds: [B:30:0x0088, B:32:0x00ad] A[DONT_GENERATE, DONT_INLINE]
      0x00b3: PHI (r9v2 long) = (r9v1 long), (r9v8 long) binds: [B:30:0x0088, B:32:0x00ad] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:48:0x010d  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void s(boolean z10, boolean z11, boolean z12, boolean z13) {
        long j10;
        boolean z14;
        cp2 cp2Var;
        mk cj2Var;
        List list;
        ((h81) this.f9923h).b(2);
        this.f9920f0 = false;
        if (this.zzE != null) {
            this.f9926i0.a(1);
            this.zzE = null;
        }
        this.zzX = null;
        v(false, true);
        bh2 bh2Var = this.Q;
        bh2Var.f9542d = false;
        bh2Var.f9539a.b();
        this.f9941t0 = MediaPeriodQueue.INITIAL_RENDERER_POSITION_OFFSET_US;
        try {
            x();
        } catch (zziw | RuntimeException e10) {
            vt0.zzf("ExoPlayerImplInternal", "Disable failed.", e10);
        }
        if (z10) {
            hj2[] hj2VarArr = this.f9909a;
            for (int i10 = 0; i10 < 2; i10++) {
                try {
                    hj2VarArr[i10].g();
                } catch (RuntimeException e11) {
                    vt0.zzf("ExoPlayerImplInternal", "Reset failed.", e11);
                }
            }
        }
        this.f9940s0 = 0;
        wi2 wi2Var = this.f9924h0;
        cp2 cp2Var2 = wi2Var.f18065b;
        long jLongValue = wi2Var.f18080q;
        if (!this.f9924h0.f18065b.b()) {
            wi2 wi2Var2 = this.f9924h0;
            gj gjVar = this.f9931l;
            cp2 cp2Var3 = wi2Var2.f18065b;
            mk mkVar = wi2Var2.f18064a;
            j10 = (mkVar.g() || mkVar.n(cp2Var3.f10025a, gjVar).f11764c) ? this.f9924h0.f18066c : this.f9924h0.f18080q;
        }
        if (z11) {
            this.zzS = null;
            Pair pairT = t(this.f9924h0.f18064a);
            cp2Var2 = (cp2) pairT.first;
            jLongValue = ((Long) pairT.second).longValue();
            j10 = -9223372036854775807L;
            z14 = cp2Var2.equals(this.f9924h0.f18065b) ? false : true;
        }
        long j11 = jLongValue;
        long j12 = j10;
        li2 li2Var = this.U;
        li2Var.w();
        this.f9936o0 = false;
        mk mkVar2 = this.f9924h0.f18064a;
        if (z12 && (mkVar2 instanceof cj2)) {
            cj2 cj2Var2 = (cj2) mkVar2;
            mq2 mq2Var = this.V.f17649k;
            mk[] mkVarArr = cj2Var2.f9971h;
            mk[] mkVarArr2 = new mk[mkVarArr.length];
            for (int i11 = 0; i11 < mkVarArr.length; i11++) {
                mkVarArr2[i11] = new bj2(cj2Var2, mkVarArr[i11]);
            }
            cj2Var = new cj2(mkVarArr2, cj2Var2.f9972i, mq2Var);
            if (cp2Var2.f10026b != -1) {
                Object obj = cp2Var2.f10025a;
                gj gjVar2 = this.f9931l;
                cj2Var.n(obj, gjVar2);
                tj tjVar = this.f9929k;
                cj2Var.b(gjVar2.f11762a, tjVar, 0L);
                cp2Var = tjVar.a() ? new cp2(obj, cp2Var2.f10028d) : cp2Var2;
            }
        } else {
            cp2Var = cp2Var2;
            cj2Var = mkVar2;
        }
        wi2 wi2Var3 = this.f9924h0;
        int i12 = wi2Var3.f18068e;
        zziw zziwVar = z13 ? null : wi2Var3.zzf;
        rq2 rq2Var = z14 ? rq2.f16203d : wi2Var3.f18070g;
        k kVar = z14 ? this.f9917e : wi2Var3.f18071h;
        if (z14) {
            bs1 bs1Var = zzguf.f19771b;
            list = zzgwa.f19786e;
        } else {
            list = wi2Var3.f18072i;
        }
        this.f9924h0 = new wi2(cj2Var, cp2Var, j12, j11, i12, zziwVar, false, rq2Var, kVar, list, cp2Var, wi2Var3.f18074k, wi2Var3.f18075l, wi2Var3.f18076m, wi2Var3.f18077n, j11, 0L, j11, 0L, false);
        if (z12) {
            li2Var.r();
            vi2 vi2Var = this.V;
            HashMap map = vi2Var.f17644f;
            for (qi2 qi2Var : map.values()) {
                try {
                    ((fo2) qi2Var.f15747a).n(qi2Var.f15748b);
                } catch (RuntimeException e12) {
                    vt0.zzf("MediaSourceList", "Failed to release child source.", e12);
                }
                fo2 fo2Var = (fo2) qi2Var.f15747a;
                pi2 pi2Var = qi2Var.f15749c;
                fo2Var.j(pi2Var);
                fo2Var.k(pi2Var);
            }
            map.clear();
            vi2Var.f17645g.clear();
            vi2Var.f17648j = false;
        }
    }

    public final Pair t(mk mkVar) {
        int i10;
        long j10 = 0;
        if (mkVar.g()) {
            return Pair.create(wi2.f18063s, 0L);
        }
        int iK = mkVar.k(this.f9938q0);
        tj tjVar = this.f9929k;
        gj gjVar = this.f9931l;
        Pair pairM = mkVar.m(tjVar, gjVar, iK, -9223372036854775807L);
        cp2 cp2VarZ = this.U.z(mkVar, pairM.first, 0L);
        long jLongValue = ((Long) pairM.second).longValue();
        if (cp2VarZ.b()) {
            mkVar.n(cp2VarZ.f10025a, gjVar);
            a aVarA = gjVar.f11765d.a(-1);
            int i11 = 0;
            while (true) {
                int[] iArr = aVarA.f8429d;
                if (i11 >= iArr.length || (i10 = iArr[i11]) == 0 || i10 == 1) {
                    break;
                }
                i11++;
            }
            if (-1 == i11) {
                gjVar.f11765d.getClass();
            }
        } else {
            j10 = jLongValue;
        }
        return Pair.create(cp2VarZ, Long.valueOf(j10));
    }

    public final void u(mk mkVar, mk mkVar2) {
        if (mkVar.g() && mkVar2.g()) {
            return;
        }
        ArrayList arrayList = this.R;
        int size = arrayList.size() - 1;
        if (size < 0) {
            Collections.sort(arrayList);
        } else {
            com.google.android.gms.measurement.internal.u1.x(arrayList.get(size));
            throw null;
        }
    }

    public final void v(boolean z10, boolean z11) {
        this.f9934m0 = z10;
        long jElapsedRealtime = -9223372036854775807L;
        if (z10 && !z11) {
            jElapsedRealtime = SystemClock.elapsedRealtime();
        }
        this.f9935n0 = jElapsedRealtime;
    }

    public final void x() {
        for (int i10 = 0; i10 < 2; i10++) {
            hj2[] hj2VarArr = this.f9909a;
            int iT = hj2VarArr[i10].t();
            hj2VarArr[i10].a(this.Q);
            k(i10, false);
            this.f9940s0 -= iT;
        }
        this.z0 = -9223372036854775807L;
    }

    public final void y() {
        if (this.f9910a0 && R()) {
            for (int i10 = 0; i10 < 2; i10++) {
                hj2 hj2Var = this.f9909a[i10];
                int iT = hj2Var.t();
                hj2Var.c(this.Q);
                this.f9940s0 -= iT - hj2Var.t();
            }
            this.z0 = -9223372036854775807L;
        }
    }

    public final void z() throws zziw {
        int i10;
        bh2 bh2Var = this.Q;
        float f10 = bh2Var.zzj().f18031a;
        li2 li2Var = this.U;
        ji2 ji2VarZzm = li2Var.zzm();
        ji2 ji2VarZzn = li2Var.zzn();
        k kVar = null;
        ji2 ji2VarZzp = ji2VarZzm;
        boolean z10 = true;
        while (ji2VarZzp != null && ji2VarZzp.f12881e) {
            k kVarG = ji2VarZzp.g(this.f9924h0.f18064a);
            k kVar2 = ji2VarZzp == li2Var.zzm() ? kVarG : kVar;
            k kVar3 = ji2VarZzp.f12890n;
            boolean z11 = false;
            if (kVar3 != null) {
                d[] dVarArr = kVarG.f13048c;
                if (kVar3.f13048c.length == dVarArr.length) {
                    for (int i11 = 0; i11 < dVarArr.length; i11++) {
                        if (kVarG.zzb(kVar3, i11)) {
                        }
                    }
                    if (ji2VarZzp != ji2VarZzn) {
                        z11 = true;
                    }
                    z10 &= z11;
                    ji2VarZzp = ji2VarZzp.zzp();
                    kVar = kVar2;
                }
            }
            if (z10) {
                ji2 ji2VarZzm2 = li2Var.zzm();
                int iU = li2Var.u(ji2VarZzm2) & 1;
                hj2[] hj2VarArr = this.f9909a;
                boolean[] zArr = new boolean[2];
                kVar2.getClass();
                long jH = ji2VarZzm2.h(kVar2, this.f9924h0.f18080q, 1 == iU, zArr);
                wi2 wi2Var = this.f9924h0;
                boolean z12 = (wi2Var.f18068e == 4 || jH == wi2Var.f18080q) ? false : true;
                wi2 wi2Var2 = this.f9924h0;
                ji2 ji2Var = ji2VarZzm2;
                this.f9924h0 = J(wi2Var2.f18065b, jH, wi2Var2.f18066c, wi2Var2.f18067d, z12, 5);
                if (z12) {
                    q(jH, true);
                }
                y();
                i10 = 2;
                boolean[] zArr2 = new boolean[2];
                int i12 = 0;
                while (i12 < 2) {
                    int iT = hj2VarArr[i12].t();
                    zArr2[i12] = hj2VarArr[i12].l();
                    ji2 ji2Var2 = ji2Var;
                    hj2VarArr[i12].d(ji2Var2.f12879c[i12], bh2Var, this.f9941t0, zArr[i12]);
                    if (iT - hj2VarArr[i12].t() > 0) {
                        k(i12, false);
                    }
                    this.f9940s0 -= iT - hj2VarArr[i12].t();
                    i12++;
                    ji2Var = ji2Var2;
                }
                K(zArr2, this.f9941t0);
                ji2Var.f12884h = true;
            } else {
                i10 = 2;
                li2Var.u(ji2VarZzp);
                if (ji2VarZzp.f12881e) {
                    long jMax = Math.max(ji2VarZzp.f12883g.f13272b, this.f9941t0 - ji2VarZzp.f12891o);
                    if (this.f9910a0 && R() && li2Var.zzo() == ji2VarZzp) {
                        y();
                    }
                    ji2VarZzp.h(kVarG, jMax, false, new boolean[2]);
                }
            }
            M(true);
            if (this.f9924h0.f18068e != 4) {
                H();
                j();
                ((h81) this.f9923h).a(i10);
                return;
            }
            return;
        }
    }

    @Override // com.google.android.gms.internal.ads.b1
    public final void zzcS(long j10, long j11, zn2 zn2Var, @Nullable MediaFormat mediaFormat) {
        if (this.f9920f0) {
            h81 h81Var = (h81) this.f9923h;
            h81Var.getClass();
            u71 u71VarE = h81.e();
            u71VarE.b(h81Var.f12056a.obtainMessage(37));
            u71VarE.a();
        }
    }

    public final boolean zzl(@Nullable Object obj, long j10) {
        if (this.f9928j0 || !this.f9927j.getThread().isAlive()) {
            return true;
        }
        nn0 nn0Var = new nn0();
        ((u71) ((h81) this.f9923h).zzd(30, new Pair(obj, nn0Var))).a();
        if (j10 != -9223372036854775807L) {
            return nn0Var.c(j10);
        }
        return true;
    }
}
