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

import android.content.Context;
import android.graphics.Point;
import android.media.MediaCodecInfo;
import android.media.MediaCrypto;
import android.media.MediaFormat;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.Trace;
import android.util.Pair;
import android.util.SparseArray;
import android.view.Surface;
import androidx.annotation.Nullable;
import androidx.media3.common.C;
import androidx.media3.common.MimeTypes;
import androidx.media3.common.PlaybackException;
import androidx.media3.exoplayer.audio.SilenceSkippingAudioProcessor;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.PriorityQueue;
import okio.Utf8;
import tv.danmaku.ijk.media.player.misc.IMediaFormat;

/* JADX INFO: loaded from: classes2.dex */
public final class r0 extends wn2 implements c1 {

    /* JADX INFO: renamed from: w1, reason: collision with root package name */
    public static final int[] f15919w1 = {1920, 1600, 1440, 1280, 960, 854, 640, 540, 480};

    /* JADX INFO: renamed from: x1, reason: collision with root package name */
    public static boolean f15920x1;

    /* JADX INFO: renamed from: y1, reason: collision with root package name */
    public static boolean f15921y1;
    public final Context P0;
    public final boolean Q0;
    public final q1 R0;
    public final boolean S0;
    public final d1 T0;
    public final androidx.emoji2.text.l0 U0;
    public final long V0;
    public final PriorityQueue W0;
    public q0 X0;
    public boolean Y0;
    public boolean Z0;
    public v1 a1;

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

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

    /* JADX INFO: renamed from: d1, reason: collision with root package name */
    public List f15924d1;

    /* JADX INFO: renamed from: e1, reason: collision with root package name */
    public h11 f15925e1;

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

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

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: q1, reason: collision with root package name */
    public rw f15937q1;

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

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

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

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

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

    @Nullable
    private ij2 zzD;

    @Nullable
    private rw zzJ;

    @Nullable
    private b1 zzM;

    @Nullable
    private Surface zzt;

    @Nullable
    private t0 zzu;

    public r0(p0 p0Var) {
        super(2, p0Var.f15220d, p0Var.f15219c, 30.0f);
        Context applicationContext = p0Var.f15217a.getApplicationContext();
        this.P0 = applicationContext;
        this.a1 = null;
        this.R0 = new q1(p0Var.b(), p0Var.c());
        this.Q0 = this.a1 == null;
        this.T0 = new d1(applicationContext, this);
        this.U0 = new androidx.emoji2.text.l0(5);
        this.S0 = "NVIDIA".equals(Build.MANUFACTURER);
        this.f15925e1 = h11.f11978c;
        this.f15927g1 = 1;
        this.f15928h1 = 0;
        this.f15937q1 = rw.f16234d;
        this.f15939s1 = 0;
        this.zzJ = null;
        this.f15938r1 = -1000;
        this.f15940t1 = -9223372036854775807L;
        this.f15941u1 = -9223372036854775807L;
        this.W0 = new PriorityQueue();
        this.V0 = -9223372036854775807L;
        this.zzD = null;
    }

    /* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
    /* JADX WARN: Removed duplicated region for block: B:41:0x0080 A[FALL_THROUGH] */
    /* JADX WARN: Removed duplicated region for block: B:44:0x0086  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final boolean B0(String str) {
        byte b10;
        byte b11;
        boolean z10 = false;
        if (str.startsWith("OMX.google")) {
            return false;
        }
        synchronized (r0.class) {
            if (!f15920x1) {
                int i10 = Build.VERSION.SDK_INT;
                byte b12 = 28;
                if (i10 <= 28) {
                    String str2 = Build.DEVICE;
                    switch (str2.hashCode()) {
                        case -1339091551:
                            b11 = !str2.equals("dangal") ? (byte) -1 : (byte) 1;
                            break;
                        case -1220081023:
                            b11 = !str2.equals("dangalFHD") ? (byte) -1 : (byte) 3;
                            break;
                        case -1220066608:
                            b11 = !str2.equals("dangalUHD") ? (byte) -1 : (byte) 2;
                            break;
                        case -1012436106:
                            b11 = !str2.equals("oneday") ? (byte) -1 : (byte) 7;
                            break;
                        case -760312546:
                            b11 = !str2.equals("aquaman") ? (byte) -1 : (byte) 0;
                            break;
                        case -64886864:
                            b11 = !str2.equals("magnolia") ? (byte) -1 : (byte) 4;
                            break;
                        case 3415681:
                            b11 = !str2.equals("once") ? (byte) -1 : (byte) 6;
                            break;
                        case 825323514:
                            b11 = !str2.equals("machuca") ? (byte) -1 : (byte) 5;
                            break;
                        default:
                            b11 = -1;
                            break;
                    }
                    switch (b11) {
                        default:
                            if (i10 > 27 || !"HWEML".equals(Build.DEVICE)) {
                                String str3 = Build.MODEL;
                                switch (str3.hashCode()) {
                                    case -349662828:
                                        b10 = !str3.equals("AFTJMST12") ? (byte) -1 : (byte) 6;
                                        break;
                                    case -321033677:
                                        b10 = !str3.equals("AFTKMST12") ? (byte) -1 : (byte) 7;
                                        break;
                                    case 2006354:
                                        b10 = !str3.equals("AFTA") ? (byte) -1 : (byte) 0;
                                        break;
                                    case 2006367:
                                        b10 = !str3.equals("AFTN") ? (byte) -1 : (byte) 1;
                                        break;
                                    case 2006371:
                                        b10 = !str3.equals("AFTR") ? (byte) -1 : (byte) 2;
                                        break;
                                    case 1785421873:
                                        b10 = !str3.equals("AFTEU011") ? (byte) -1 : (byte) 3;
                                        break;
                                    case 1785421876:
                                        b10 = !str3.equals("AFTEU014") ? (byte) -1 : (byte) 4;
                                        break;
                                    case 1798172390:
                                        b10 = !str3.equals("AFTSO001") ? (byte) -1 : (byte) 8;
                                        break;
                                    case 2119412532:
                                        b10 = !str3.equals("AFTEUFF014") ? (byte) -1 : (byte) 5;
                                        break;
                                    default:
                                        b10 = -1;
                                        break;
                                }
                                switch (b10) {
                                    default:
                                        if (i10 <= 26) {
                                            String str4 = Build.DEVICE;
                                            switch (str4.hashCode()) {
                                                case -2144781245:
                                                    b12 = !str4.equals("GIONEE_SWW1609") ? (byte) -1 : (byte) 54;
                                                    break;
                                                case -2144781185:
                                                    b12 = !str4.equals("GIONEE_SWW1627") ? (byte) -1 : (byte) 55;
                                                    break;
                                                case -2144781160:
                                                    b12 = !str4.equals("GIONEE_SWW1631") ? (byte) -1 : (byte) 56;
                                                    break;
                                                case -2097309513:
                                                    b12 = !str4.equals("K50a40") ? (byte) -1 : (byte) 74;
                                                    break;
                                                case -2022874474:
                                                    b12 = !str4.equals("CP8676_I02") ? (byte) -1 : (byte) 22;
                                                    break;
                                                case -1978993182:
                                                    b12 = !str4.equals("NX541J") ? (byte) -1 : (byte) 89;
                                                    break;
                                                case -1978990237:
                                                    b12 = !str4.equals("NX573J") ? (byte) -1 : (byte) 90;
                                                    break;
                                                case -1936688988:
                                                    b12 = !str4.equals("PGN528") ? (byte) -1 : (byte) 101;
                                                    break;
                                                case -1936688066:
                                                    b12 = !str4.equals("PGN610") ? (byte) -1 : (byte) 102;
                                                    break;
                                                case -1936688065:
                                                    b12 = !str4.equals("PGN611") ? (byte) -1 : (byte) 103;
                                                    break;
                                                case -1931988508:
                                                    b12 = !str4.equals("AquaPowerM") ? (byte) -1 : (byte) 13;
                                                    break;
                                                case -1885099851:
                                                    b12 = !str4.equals("RAIJIN") ? (byte) -1 : (byte) 116;
                                                    break;
                                                case -1696512866:
                                                    b12 = !str4.equals("XT1663") ? (byte) -1 : (byte) 137;
                                                    break;
                                                case -1680025915:
                                                    b12 = !str4.equals("ComioS1") ? (byte) -1 : (byte) 21;
                                                    break;
                                                case -1615810839:
                                                    b12 = !str4.equals("Phantom6") ? (byte) -1 : (byte) 104;
                                                    break;
                                                case -1600724499:
                                                    b12 = !str4.equals("pacificrim") ? (byte) -1 : (byte) 95;
                                                    break;
                                                case -1554255044:
                                                    b12 = !str4.equals("vernee_M5") ? (byte) -1 : (byte) 130;
                                                    break;
                                                case -1481772737:
                                                    b12 = !str4.equals("panell_dl") ? (byte) -1 : (byte) 97;
                                                    break;
                                                case -1481772730:
                                                    b12 = !str4.equals("panell_ds") ? (byte) -1 : (byte) 98;
                                                    break;
                                                case -1481772729:
                                                    b12 = !str4.equals("panell_dt") ? (byte) -1 : (byte) 99;
                                                    break;
                                                case -1320080169:
                                                    b12 = !str4.equals("GiONEE_GBL7319") ? (byte) -1 : (byte) 52;
                                                    break;
                                                case -1217592143:
                                                    b12 = !str4.equals("BRAVIA_ATV2") ? (byte) -1 : (byte) 18;
                                                    break;
                                                case -1180384755:
                                                    b12 = !str4.equals("iris60") ? (byte) -1 : (byte) 70;
                                                    break;
                                                case -1139198265:
                                                    b12 = !str4.equals("Slate_Pro") ? (byte) -1 : (byte) 118;
                                                    break;
                                                case -1052835013:
                                                    b12 = !str4.equals("namath") ? (byte) -1 : (byte) 87;
                                                    break;
                                                case -993250464:
                                                    b12 = !str4.equals("A10-70F") ? (byte) -1 : (byte) 5;
                                                    break;
                                                case -993250458:
                                                    b12 = !str4.equals("A10-70L") ? (byte) -1 : (byte) 6;
                                                    break;
                                                case -965403638:
                                                    b12 = !str4.equals("s905x018") ? (byte) -1 : (byte) 120;
                                                    break;
                                                case -958336948:
                                                    b12 = !str4.equals("ELUGA_Ray_X") ? (byte) -1 : (byte) 34;
                                                    break;
                                                case -879245230:
                                                    b12 = !str4.equals("tcl_eu") ? (byte) -1 : (byte) 126;
                                                    break;
                                                case -842500323:
                                                    b12 = !str4.equals("nicklaus_f") ? (byte) -1 : (byte) 88;
                                                    break;
                                                case -821392978:
                                                    b12 = !str4.equals("A7000-a") ? (byte) -1 : (byte) 9;
                                                    break;
                                                case -797483286:
                                                    b12 = !str4.equals("SVP-DTV15") ? (byte) -1 : (byte) 119;
                                                    break;
                                                case -794946968:
                                                    b12 = !str4.equals("watson") ? (byte) -1 : (byte) 131;
                                                    break;
                                                case -788334647:
                                                    b12 = !str4.equals("whyred") ? (byte) -1 : (byte) 132;
                                                    break;
                                                case -782144577:
                                                    b12 = !str4.equals("OnePlus5T") ? (byte) -1 : (byte) 91;
                                                    break;
                                                case -575125681:
                                                    b12 = !str4.equals("GiONEE_CBL7513") ? (byte) -1 : (byte) 51;
                                                    break;
                                                case -521118391:
                                                    b12 = !str4.equals("GIONEE_GBL7360") ? (byte) -1 : (byte) 53;
                                                    break;
                                                case -430914369:
                                                    b12 = !str4.equals("Pixi4-7_3G") ? (byte) -1 : (byte) 105;
                                                    break;
                                                case -290434366:
                                                    b12 = !str4.equals("taido_row") ? (byte) -1 : (byte) 121;
                                                    break;
                                                case -282781963:
                                                    b12 = !str4.equals("BLACK-1X") ? (byte) -1 : (byte) 17;
                                                    break;
                                                case -277133239:
                                                    b12 = !str4.equals("Z12_PRO") ? (byte) -1 : (byte) 138;
                                                    break;
                                                case -173639913:
                                                    b12 = !str4.equals("ELUGA_A3_Pro") ? (byte) -1 : (byte) 31;
                                                    break;
                                                case -56598463:
                                                    b12 = !str4.equals("woods_fn") ? (byte) -1 : (byte) 134;
                                                    break;
                                                case 2126:
                                                    b12 = !str4.equals("C1") ? (byte) -1 : (byte) 20;
                                                    break;
                                                case 2564:
                                                    b12 = !str4.equals("Q5") ? (byte) -1 : (byte) 113;
                                                    break;
                                                case 2715:
                                                    b12 = !str4.equals("V1") ? (byte) -1 : (byte) 127;
                                                    break;
                                                case 2719:
                                                    b12 = !str4.equals("V5") ? (byte) -1 : (byte) 129;
                                                    break;
                                                case 3091:
                                                    b12 = !str4.equals("b5") ? (byte) -1 : (byte) 16;
                                                    break;
                                                case 3483:
                                                    b12 = !str4.equals("mh") ? (byte) -1 : (byte) 84;
                                                    break;
                                                case 73405:
                                                    b12 = !str4.equals("JGZ") ? (byte) -1 : (byte) 73;
                                                    break;
                                                case 75537:
                                                    b12 = !str4.equals("M04") ? (byte) -1 : (byte) 79;
                                                    break;
                                                case 75739:
                                                    b12 = !str4.equals("M5c") ? (byte) -1 : (byte) 80;
                                                    break;
                                                case 76779:
                                                    b12 = !str4.equals("MX6") ? (byte) -1 : (byte) 86;
                                                    break;
                                                case 78669:
                                                    b12 = !str4.equals("P85") ? (byte) -1 : (byte) 94;
                                                    break;
                                                case 79305:
                                                    b12 = !str4.equals("PLE") ? (byte) -1 : (byte) 107;
                                                    break;
                                                case 80618:
                                                    b12 = !str4.equals("QX1") ? (byte) -1 : (byte) 115;
                                                    break;
                                                case 88274:
                                                    b12 = !str4.equals("Z80") ? (byte) -1 : (byte) 139;
                                                    break;
                                                case 98846:
                                                    b12 = !str4.equals("cv1") ? (byte) -1 : (byte) 26;
                                                    break;
                                                case 98848:
                                                    b12 = !str4.equals("cv3") ? (byte) -1 : (byte) 27;
                                                    break;
                                                case 99329:
                                                    if (!str4.equals("deb")) {
                                                        b12 = -1;
                                                    }
                                                    break;
                                                case 101481:
                                                    b12 = !str4.equals("flo") ? (byte) -1 : (byte) 49;
                                                    break;
                                                case 1513190:
                                                    b12 = !str4.equals("1601") ? (byte) -1 : (byte) 0;
                                                    break;
                                                case 1514184:
                                                    b12 = !str4.equals("1713") ? (byte) -1 : (byte) 1;
                                                    break;
                                                case 1514185:
                                                    b12 = !str4.equals("1714") ? (byte) -1 : (byte) 2;
                                                    break;
                                                case 2133089:
                                                    b12 = !str4.equals("F01H") ? (byte) -1 : (byte) 36;
                                                    break;
                                                case 2133091:
                                                    b12 = !str4.equals("F01J") ? (byte) -1 : (byte) 37;
                                                    break;
                                                case 2133120:
                                                    b12 = !str4.equals("F02H") ? (byte) -1 : (byte) 38;
                                                    break;
                                                case 2133151:
                                                    b12 = !str4.equals("F03H") ? (byte) -1 : (byte) 39;
                                                    break;
                                                case 2133182:
                                                    b12 = !str4.equals("F04H") ? (byte) -1 : (byte) 40;
                                                    break;
                                                case 2133184:
                                                    b12 = !str4.equals("F04J") ? (byte) -1 : (byte) 41;
                                                    break;
                                                case 2436959:
                                                    b12 = !str4.equals("P681") ? (byte) -1 : (byte) 93;
                                                    break;
                                                case 2463773:
                                                    b12 = !str4.equals("Q350") ? (byte) -1 : (byte) 109;
                                                    break;
                                                case 2464648:
                                                    b12 = !str4.equals("Q427") ? (byte) -1 : (byte) 111;
                                                    break;
                                                case 2689555:
                                                    b12 = !str4.equals("XE2X") ? (byte) -1 : (byte) 136;
                                                    break;
                                                case 3154429:
                                                    b12 = !str4.equals("fugu") ? (byte) -1 : (byte) 50;
                                                    break;
                                                case 3284551:
                                                    b12 = !str4.equals("kate") ? (byte) -1 : (byte) 75;
                                                    break;
                                                case 3351335:
                                                    b12 = !str4.equals("mido") ? (byte) -1 : (byte) 85;
                                                    break;
                                                case 3386211:
                                                    b12 = !str4.equals("p212") ? (byte) -1 : (byte) 92;
                                                    break;
                                                case 41325051:
                                                    b12 = !str4.equals("MEIZU_M5") ? (byte) -1 : (byte) 83;
                                                    break;
                                                case 51349633:
                                                    b12 = !str4.equals("601LV") ? (byte) -1 : (byte) 3;
                                                    break;
                                                case 51350594:
                                                    b12 = !str4.equals("602LV") ? (byte) -1 : (byte) 4;
                                                    break;
                                                case 55178625:
                                                    b12 = !str4.equals("Aura_Note_2") ? (byte) -1 : (byte) 15;
                                                    break;
                                                case 61542055:
                                                    b12 = !str4.equals("A1601") ? (byte) -1 : (byte) 7;
                                                    break;
                                                case 65355429:
                                                    b12 = !str4.equals("E5643") ? (byte) -1 : (byte) 30;
                                                    break;
                                                case 66214468:
                                                    b12 = !str4.equals("F3111") ? (byte) -1 : (byte) 42;
                                                    break;
                                                case 66214470:
                                                    b12 = !str4.equals("F3113") ? (byte) -1 : (byte) 43;
                                                    break;
                                                case 66214473:
                                                    b12 = !str4.equals("F3116") ? (byte) -1 : (byte) 44;
                                                    break;
                                                case 66215429:
                                                    b12 = !str4.equals("F3211") ? (byte) -1 : (byte) 45;
                                                    break;
                                                case 66215431:
                                                    b12 = !str4.equals("F3213") ? (byte) -1 : (byte) 46;
                                                    break;
                                                case 66215433:
                                                    b12 = !str4.equals("F3215") ? (byte) -1 : (byte) 47;
                                                    break;
                                                case 66216390:
                                                    b12 = !str4.equals("F3311") ? (byte) -1 : (byte) 48;
                                                    break;
                                                case 76402249:
                                                    b12 = !str4.equals("PRO7S") ? (byte) -1 : (byte) 108;
                                                    break;
                                                case 76404105:
                                                    b12 = !str4.equals("Q4260") ? (byte) -1 : (byte) 110;
                                                    break;
                                                case 76404911:
                                                    b12 = !str4.equals("Q4310") ? (byte) -1 : (byte) 112;
                                                    break;
                                                case 80963634:
                                                    b12 = !str4.equals("V23GB") ? (byte) -1 : (byte) 128;
                                                    break;
                                                case 82882791:
                                                    b12 = !str4.equals("X3_HK") ? (byte) -1 : (byte) 135;
                                                    break;
                                                case 98715550:
                                                    b12 = !str4.equals("i9031") ? (byte) -1 : (byte) 67;
                                                    break;
                                                case 101370885:
                                                    b12 = !str4.equals("l5460") ? (byte) -1 : (byte) 76;
                                                    break;
                                                case 102844228:
                                                    b12 = !str4.equals("le_x6") ? (byte) -1 : (byte) 77;
                                                    break;
                                                case 165221241:
                                                    b12 = !str4.equals("A2016a40") ? (byte) -1 : (byte) 8;
                                                    break;
                                                case 182191441:
                                                    b12 = !str4.equals("CPY83_I00") ? (byte) -1 : (byte) 25;
                                                    break;
                                                case 245388979:
                                                    b12 = !str4.equals("marino_f") ? (byte) -1 : (byte) 82;
                                                    break;
                                                case 287431619:
                                                    b12 = !str4.equals("griffin") ? (byte) -1 : (byte) 60;
                                                    break;
                                                case 307593612:
                                                    b12 = !str4.equals("A7010a48") ? (byte) -1 : (byte) 11;
                                                    break;
                                                case 308517133:
                                                    b12 = !str4.equals("A7020a48") ? (byte) -1 : (byte) 12;
                                                    break;
                                                case 316215098:
                                                    b12 = !str4.equals("TB3-730F") ? (byte) -1 : (byte) 122;
                                                    break;
                                                case 316215116:
                                                    b12 = !str4.equals("TB3-730X") ? (byte) -1 : (byte) 123;
                                                    break;
                                                case 316246811:
                                                    b12 = !str4.equals("TB3-850F") ? (byte) -1 : (byte) 124;
                                                    break;
                                                case 316246818:
                                                    b12 = !str4.equals("TB3-850M") ? (byte) -1 : (byte) 125;
                                                    break;
                                                case 407160593:
                                                    b12 = !str4.equals("Pixi5-10_4G") ? (byte) -1 : (byte) 106;
                                                    break;
                                                case 507412548:
                                                    b12 = !str4.equals("QM16XE_U") ? (byte) -1 : (byte) 114;
                                                    break;
                                                case 793982701:
                                                    b12 = !str4.equals("GIONEE_WBL5708") ? (byte) -1 : (byte) 57;
                                                    break;
                                                case 794038622:
                                                    b12 = !str4.equals("GIONEE_WBL7365") ? (byte) -1 : (byte) 58;
                                                    break;
                                                case 794040393:
                                                    b12 = !str4.equals("GIONEE_WBL7519") ? (byte) -1 : (byte) 59;
                                                    break;
                                                case 835649806:
                                                    b12 = !str4.equals("manning") ? (byte) -1 : (byte) 81;
                                                    break;
                                                case 917340916:
                                                    b12 = !str4.equals("A7000plus") ? (byte) -1 : (byte) 10;
                                                    break;
                                                case 958008161:
                                                    b12 = !str4.equals("j2xlteins") ? (byte) -1 : (byte) 72;
                                                    break;
                                                case 1060579533:
                                                    b12 = !str4.equals("panell_d") ? (byte) -1 : (byte) 96;
                                                    break;
                                                case 1150207623:
                                                    b12 = !str4.equals("LS-5017") ? (byte) -1 : (byte) 78;
                                                    break;
                                                case 1176899427:
                                                    b12 = !str4.equals("itel_S41") ? (byte) -1 : (byte) 71;
                                                    break;
                                                case 1280332038:
                                                    b12 = !str4.equals("hwALE-H") ? (byte) -1 : (byte) 62;
                                                    break;
                                                case 1306947716:
                                                    b12 = !str4.equals("EverStar_S") ? (byte) -1 : (byte) 35;
                                                    break;
                                                case 1349174697:
                                                    b12 = !str4.equals("htc_e56ml_dtul") ? (byte) -1 : (byte) 61;
                                                    break;
                                                case 1522194893:
                                                    b12 = !str4.equals("woods_f") ? (byte) -1 : (byte) 133;
                                                    break;
                                                case 1691543273:
                                                    b12 = !str4.equals("CPH1609") ? (byte) -1 : (byte) 23;
                                                    break;
                                                case 1691544261:
                                                    b12 = !str4.equals("CPH1715") ? (byte) -1 : (byte) 24;
                                                    break;
                                                case 1709443163:
                                                    b12 = !str4.equals("iball8735_9806") ? (byte) -1 : (byte) 68;
                                                    break;
                                                case 1865889110:
                                                    b12 = !str4.equals("santoni") ? (byte) -1 : (byte) 117;
                                                    break;
                                                case 1906253259:
                                                    b12 = !str4.equals("PB2-670M") ? (byte) -1 : (byte) 100;
                                                    break;
                                                case 1977196784:
                                                    b12 = !str4.equals("Infinix-X572") ? (byte) -1 : (byte) 69;
                                                    break;
                                                case 2006372676:
                                                    b12 = !str4.equals("BRAVIA_ATV3_4K") ? (byte) -1 : (byte) 19;
                                                    break;
                                                case 2019281702:
                                                    b12 = !str4.equals("DM-01K") ? (byte) -1 : (byte) 29;
                                                    break;
                                                case 2029784656:
                                                    b12 = !str4.equals("HWBLN-H") ? (byte) -1 : Utf8.REPLACEMENT_BYTE;
                                                    break;
                                                case 2030379515:
                                                    b12 = !str4.equals("HWCAM-H") ? (byte) -1 : (byte) 64;
                                                    break;
                                                case 2033393791:
                                                    b12 = !str4.equals("ASUS_X00AD_2") ? (byte) -1 : (byte) 14;
                                                    break;
                                                case 2047190025:
                                                    b12 = !str4.equals("ELUGA_Note") ? (byte) -1 : (byte) 32;
                                                    break;
                                                case 2047252157:
                                                    b12 = !str4.equals("ELUGA_Prim") ? (byte) -1 : (byte) 33;
                                                    break;
                                                case 2048319463:
                                                    b12 = !str4.equals("HWVNS-H") ? (byte) -1 : (byte) 65;
                                                    break;
                                                case 2048855701:
                                                    b12 = !str4.equals("HWWAS-H") ? (byte) -1 : (byte) 66;
                                                    break;
                                                default:
                                                    b12 = -1;
                                                    break;
                                            }
                                            switch (b12) {
                                                default:
                                                    if (str3.hashCode() == -594534941 && str3.equals("JSN-L21")) {
                                                    }
                                                case 0:
                                                case 1:
                                                case 2:
                                                case 3:
                                                case 4:
                                                case 5:
                                                case 6:
                                                case 7:
                                                case 8:
                                                case 9:
                                                case 10:
                                                case 11:
                                                case 12:
                                                case 13:
                                                case 14:
                                                case 15:
                                                case 16:
                                                case 17:
                                                case 18:
                                                case 19:
                                                case 20:
                                                case 21:
                                                case 22:
                                                case 23:
                                                case 24:
                                                case 25:
                                                case 26:
                                                case 27:
                                                case 28:
                                                case 29:
                                                case 30:
                                                case 31:
                                                case 32:
                                                case 33:
                                                case 34:
                                                case 35:
                                                case 36:
                                                case 37:
                                                case 38:
                                                case 39:
                                                case 40:
                                                case 41:
                                                case 42:
                                                case 43:
                                                case 44:
                                                case 45:
                                                case 46:
                                                case 47:
                                                case 48:
                                                case 49:
                                                case 50:
                                                case 51:
                                                case 52:
                                                case 53:
                                                case 54:
                                                case 55:
                                                case 56:
                                                case 57:
                                                case 58:
                                                case 59:
                                                case 60:
                                                case 61:
                                                case 62:
                                                case 63:
                                                case 64:
                                                case 65:
                                                case 66:
                                                case 67:
                                                case 68:
                                                case 69:
                                                case 70:
                                                case 71:
                                                case 72:
                                                case 73:
                                                case 74:
                                                case 75:
                                                case 76:
                                                case 77:
                                                case 78:
                                                case 79:
                                                case 80:
                                                case 81:
                                                case 82:
                                                case 83:
                                                case 84:
                                                case 85:
                                                case 86:
                                                case 87:
                                                case 88:
                                                case 89:
                                                case 90:
                                                case 91:
                                                case 92:
                                                case 93:
                                                case 94:
                                                case 95:
                                                case 96:
                                                case 97:
                                                case 98:
                                                case 99:
                                                case 100:
                                                case 101:
                                                case 102:
                                                case 103:
                                                case 104:
                                                case 105:
                                                case 106:
                                                case 107:
                                                case 108:
                                                case 109:
                                                case 110:
                                                case 111:
                                                case 112:
                                                case 113:
                                                case 114:
                                                case 115:
                                                case 116:
                                                case 117:
                                                case 118:
                                                case 119:
                                                case 120:
                                                case 121:
                                                case 122:
                                                case 123:
                                                case 124:
                                                case 125:
                                                case 126:
                                                case 127:
                                                case 128:
                                                case 129:
                                                case 130:
                                                case 131:
                                                case 132:
                                                case 133:
                                                case 134:
                                                case 135:
                                                case 136:
                                                case 137:
                                                case 138:
                                                case 139:
                                                    z10 = true;
                                                    break;
                                            }
                                        }
                                    case 0:
                                    case 1:
                                    case 2:
                                    case 3:
                                    case 4:
                                    case 5:
                                    case 6:
                                    case 7:
                                    case 8:
                                        break;
                                }
                            }
                        case 0:
                        case 1:
                        case 2:
                        case 3:
                        case 4:
                        case 5:
                        case 6:
                        case 7:
                            break;
                    }
                    f15921y1 = z10;
                    f15920x1 = true;
                }
            }
        }
        return f15921y1;
    }

    public static List C0(Context context, xn2 xn2Var, zn2 zn2Var, boolean z10, boolean z11) {
        List listA;
        String str = zn2Var.zzo;
        if (str == null) {
            return zzgwa.f19786e;
        }
        if (Build.VERSION.SDK_INT >= 26 && MimeTypes.VIDEO_DOLBY_VISION.equals(str) && !za2.k(context)) {
            String strZzg = do2.zzg(zn2Var);
            if (strZzg == null) {
                bs1 bs1Var = zzguf.f19771b;
                listA = zzgwa.f19786e;
            } else {
                ((xv1) xn2Var).getClass();
                listA = do2.a(strZzg, z10, z11);
            }
            if (!listA.isEmpty()) {
                return listA;
            }
        }
        return do2.b(xn2Var, zn2Var, z10, z11);
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Removed duplicated region for block: B:20:0x003f  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static int u0(tn2 tn2Var, zn2 zn2Var) {
        int i10;
        int i11;
        int i12 = zn2Var.f19339l;
        if (i12 != -1 && (i10 = zn2Var.f19340m) != -1) {
            String str = zn2Var.zzo;
            str.getClass();
            if (MimeTypes.VIDEO_DOLBY_VISION.equals(str)) {
                Pair pairZzd = km0.zzd(zn2Var);
                if (pairZzd == null) {
                    str = MimeTypes.VIDEO_H265;
                } else {
                    int iIntValue = ((Integer) pairZzd.first).intValue();
                    if (iIntValue == 512 || iIntValue == 1 || iIntValue == 2) {
                        str = MimeTypes.VIDEO_H264;
                    } else if (iIntValue == 1024) {
                        str = MimeTypes.VIDEO_AV1;
                    }
                }
            }
            i11 = 4;
            switch (str) {
                case "video/3gpp":
                case "video/mp4v-es":
                case "video/av01":
                case "video/x-vnd.on2.vp8":
                    return ((i12 * i10) * 3) / i11;
                case "video/hevc":
                    return Math.max(2097152, ((i12 * i10) * 3) / 4);
                case "video/avc":
                    String str2 = Build.MODEL;
                    if (!"BRAVIA 4K 2015".equals(str2) && (!"Amazon".equals(Build.MANUFACTURER) || (!"KFSOWI".equals(str2) && (!"AFTS".equals(str2) || !tn2Var.f16958e)))) {
                        String str3 = bb1.f9474a;
                        return ((((i10 + 15) / 16) * ((i12 + 15) / 16)) * 768) / 4;
                    }
                    break;
                case "video/x-vnd.on2.vp9":
                    i11 = 8;
                    return ((i12 * i10) * 3) / i11;
            }
        }
        return -1;
    }

    public static int z0(tn2 tn2Var, zn2 zn2Var) {
        int i10 = zn2Var.f19334g;
        if (i10 == -1) {
            return u0(tn2Var, zn2Var);
        }
        List list = zn2Var.f19336i;
        int size = list.size();
        int length = 0;
        for (int i11 = 0; i11 < size; i11++) {
            length += ((byte[]) list.get(i11)).length;
        }
        return i10 + length;
    }

    private final void zzbo(@Nullable Object obj) throws zziw {
        Surface surface = obj instanceof Surface ? (Surface) obj : null;
        Surface surface2 = this.zzt;
        q1 q1Var = this.R0;
        if (surface2 == surface) {
            if (surface != null) {
                rw rwVar = this.zzJ;
                if (rwVar != null) {
                    q1Var.e(rwVar);
                }
                Surface surface3 = this.zzt;
                if (surface3 == null || !this.f15926f1) {
                    return;
                }
                q1Var.f(surface3);
                return;
            }
            return;
        }
        this.zzt = surface;
        v1 v1Var = this.a1;
        d1 d1Var = this.T0;
        if (v1Var == null) {
            d1Var.zzd(surface);
        }
        this.f15926f1 = false;
        int i10 = this.f15399g;
        rn2 rn2VarZzaE = zzaE();
        if (rn2VarZzaE != null && this.a1 == null) {
            tn2 tn2VarZzaH = zzaH();
            tn2VarZzaH.getClass();
            if (!E0(tn2VarZzaH) || this.Y0) {
                L();
                I();
            } else {
                Surface surfaceZzbt = zzbt(tn2VarZzaH);
                if (surfaceZzbt != null) {
                    rn2VarZzaE.d(surfaceZzbt);
                } else {
                    if (Build.VERSION.SDK_INT < 35) {
                        throw new IllegalStateException();
                    }
                    rn2VarZzaE.zzo();
                }
            }
        }
        if (surface != null) {
            rw rwVar2 = this.zzJ;
            if (rwVar2 != null) {
                q1Var.e(rwVar2);
            }
        } else {
            this.zzJ = null;
            v1 v1Var2 = this.a1;
            if (v1Var2 != null) {
                v1Var2.zzq();
            }
        }
        if (i10 == 2) {
            v1 v1Var3 = this.a1;
            if (v1Var3 != null) {
                v1Var3.Q(true);
            } else {
                d1Var.f10134i = true;
                d1Var.f10133h = -9223372036854775807L;
            }
        }
    }

    @Nullable
    private final Surface zzbt(tn2 tn2Var) {
        v1 v1Var = this.a1;
        if (v1Var != null) {
            return v1Var.zzk();
        }
        Surface surface = this.zzt;
        if (surface != null) {
            return surface;
        }
        if (Build.VERSION.SDK_INT >= 35 && tn2Var.f16960g) {
            return null;
        }
        boolean zB0 = B0(tn2Var.f16954a);
        Context context = this.P0;
        boolean z10 = true;
        boolean z11 = tn2Var.f16958e;
        ih1.b1(!zB0 && (!z11 || t0.a(context)));
        t0 t0Var = this.zzu;
        if (t0Var != null && t0Var.f16660a != z11 && t0Var != null) {
            t0Var.release();
            this.zzu = null;
        }
        if (this.zzu == null) {
            if (!z11) {
                int i10 = t0.f16658d;
            } else if (!t0.a(context)) {
                z10 = false;
            }
            ih1.b1(z10);
            this.zzu = new s0("ExoPlayer:PlaceholderSurface").a(z11 ? t0.f16658d : 0);
        }
        return this.zzu;
    }

    public final /* synthetic */ Surface A0() {
        return this.zzt;
    }

    @Override // com.google.android.gms.internal.ads.ej2
    public final boolean B() {
        boolean zW = W();
        v1 v1Var = this.a1;
        if (v1Var != null) {
            return v1Var.E(zW);
        }
        if (zW && zzaE() == null) {
            return true;
        }
        return this.T0.c(zW);
    }

    public final boolean D0(fe2 fe2Var) {
        if (x() || fe2Var.g(C.BUFFER_FLAG_LAST_SAMPLE)) {
            return true;
        }
        long j10 = this.f15941u1;
        return j10 == -9223372036854775807L || j10 - (fe2Var.f11190e - this.I0.f17722c) <= SilenceSkippingAudioProcessor.DEFAULT_MINIMUM_SILENCE_DURATION_US;
    }

    public final boolean E0(tn2 tn2Var) {
        if (this.a1 != null) {
            return true;
        }
        Surface surface = this.zzt;
        if (surface != null && surface.isValid()) {
            return true;
        }
        if (Build.VERSION.SDK_INT >= 35 && tn2Var.f16960g) {
            return true;
        }
        if (B0(tn2Var.f16954a)) {
            return false;
        }
        return !tn2Var.f16958e || t0.a(this.P0);
    }

    public final void F0() {
        this.R0.f(this.zzt);
        this.f15926f1 = true;
    }

    @Override // com.google.android.gms.internal.ads.pf2
    public final void G(boolean z10, boolean z11) {
        v1 v1Var;
        this.H0 = new ug2();
        n();
        this.R0.a(this.H0);
        boolean z12 = this.f15922b1;
        d1 d1Var = this.T0;
        if (!z12) {
            if (this.f15924d1 != null && this.a1 == null) {
                u0 u0Var = new u0(this.P0, d1Var);
                u0Var.f17047d = true;
                long j10 = this.V0;
                u0Var.f17050g = j10 != -9223372036854775807L ? -j10 : -9223372036854775807L;
                sl0 sl0Var = this.f15398f;
                sl0Var.getClass();
                u0Var.f17048e = sl0Var;
                ih1.b1(!u0Var.f17049f);
                if (u0Var.f17046c == null) {
                    u0Var.f17046c = new y0();
                }
                a1 a1Var = new a1(u0Var);
                u0Var.f17049f = true;
                a1Var.f8451o = 1;
                SparseArray sparseArray = a1Var.f8439c;
                if (sparseArray.indexOfKey(0) >= 0) {
                    v1Var = (v1) sparseArray.get(0);
                } else {
                    w0 w0Var = new w0(a1Var, a1Var.f8437a);
                    a1Var.f8443g.add(w0Var);
                    sparseArray.put(0, w0Var);
                    v1Var = w0Var;
                }
                this.a1 = v1Var;
            }
            this.f15922b1 = true;
        }
        int i10 = !z11 ? 1 : 0;
        v1 v1Var2 = this.a1;
        if (v1Var2 == null) {
            sl0 sl0Var2 = this.f15398f;
            sl0Var2.getClass();
            d1Var.f10136k = sl0Var2;
            d1Var.a(i10);
            return;
        }
        v1Var2.T(new m0(this));
        b1 b1Var = this.zzM;
        if (b1Var != null) {
            this.a1.L(b1Var);
        }
        if (this.zzt != null && !this.f15925e1.equals(h11.f11978c)) {
            this.a1.N(this.zzt, this.f15925e1);
        }
        this.a1.O(this.f15928h1);
        this.a1.J(this.f18128e0);
        List list = this.f15924d1;
        if (list != null) {
            this.a1.P(list);
        }
        this.f15923c1 = i10;
        this.L0 = true;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.pf2
    public final void H(zn2[] zn2VarArr, long j10, long j11, cp2 cp2Var) {
        super.H(zn2VarArr, j10, j11, cp2Var);
        mk mkVar = this.f15405m;
        if (mkVar.g()) {
            this.f15941u1 = -9223372036854775807L;
        } else {
            this.f15941u1 = mkVar.n(cp2Var.f10025a, new gj()).f11763b;
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final boolean K(tn2 tn2Var) {
        return E0(tn2Var);
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final boolean N() {
        tn2 tn2VarZzaH = zzaH();
        if (this.a1 != null && tn2VarZzaH != null) {
            String str = tn2VarZzaH.f16954a;
            if (str.equals("c2.mtk.avc.decoder") || str.equals("c2.mtk.hevc.decoder")) {
                return true;
            }
        }
        return super.N();
    }

    /* JADX WARN: Removed duplicated region for block: B:6:0x0026  */
    @Override // com.google.android.gms.internal.ads.wn2
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean O() {
        boolean z10;
        zn2 zn2VarZzaF = zzaF();
        long j10 = this.f15941u1;
        if (j10 != -9223372036854775807L) {
            z10 = this.N0 + (1 + j10) > Long.MAX_VALUE - (this.I0.f17722c + j10);
        }
        return this.zzD == null || this.f15933m1 || (zn2VarZzaF != null && zn2VarZzaF.f19335h > 0) || z10 || this.I0.f17724e != -9223372036854775807L;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void P() {
        super.P();
        this.W0.clear();
        this.f15932l1 = 0;
        this.f15933m1 = false;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void R(zn2 zn2Var) throws zziw {
        v1 v1Var = this.a1;
        if (v1Var == null || v1Var.zze()) {
            return;
        }
        try {
            v1Var.U(zn2Var);
        } catch (zzadq e10) {
            throw zzN(e10, zn2Var, false, PlaybackException.ERROR_CODE_VIDEO_FRAME_PROCESSOR_INIT_FAILED);
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void S(fe2 fe2Var) {
        int iT = T(fe2Var);
        if (Build.VERSION.SDK_INT < 34 || (iT & 32) == 0) {
            this.f15932l1++;
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final int T(fe2 fe2Var) {
        return (Build.VERSION.SDK_INT < 34 || this.zzD == null || fe2Var.f11190e >= this.f15401i || D0(fe2Var)) ? 0 : 32;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final boolean U(fe2 fe2Var) {
        boolean z10 = false;
        if (D0(fe2Var)) {
            return false;
        }
        if (fe2Var.f11190e < this.f15401i) {
            if (fe2Var.g(268435456)) {
                return false;
            }
            if (fe2Var.g(C.BUFFER_FLAG_NOT_DEPENDED_ON)) {
                fe2Var.h();
                z10 = true;
            }
            if (z10) {
                this.H0.f17243d++;
            }
        }
        return z10;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void V(long j10) {
        super.V(j10);
        this.f15932l1--;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final int Y(xn2 xn2Var, zn2 zn2Var) {
        boolean z10;
        String str = zn2Var.zzo;
        if (!hc.zzb(str)) {
            return 128;
        }
        int i10 = 0;
        boolean z11 = zn2Var.zzs != null;
        Context context = this.P0;
        List listC0 = C0(context, xn2Var, zn2Var, z11, false);
        if (z11 && listC0.isEmpty()) {
            listC0 = C0(context, xn2Var, zn2Var, false, false);
        }
        if (listC0.isEmpty()) {
            return 129;
        }
        if (zn2Var.B != 0) {
            return 130;
        }
        tn2 tn2Var = (tn2) listC0.get(0);
        boolean zA = tn2Var.a(zn2Var);
        if (zA) {
            z10 = true;
        } else {
            for (int i11 = 1; i11 < listC0.size(); i11++) {
                tn2 tn2Var2 = (tn2) listC0.get(i11);
                if (tn2Var2.a(zn2Var)) {
                    zA = true;
                    z10 = false;
                    tn2Var = tn2Var2;
                    break;
                }
            }
            z10 = true;
        }
        int i12 = true != zA ? 3 : 4;
        int i13 = true != tn2Var.b(zn2Var) ? 8 : 16;
        int i14 = true != tn2Var.f16959f ? 0 : 64;
        int i15 = true != z10 ? 0 : 128;
        if (Build.VERSION.SDK_INT >= 26 && MimeTypes.VIDEO_DOLBY_VISION.equals(str) && !za2.k(context)) {
            i15 = 256;
        }
        if (zA) {
            List listC02 = C0(context, xn2Var, zn2Var, z11, true);
            if (!listC02.isEmpty()) {
                HashMap map = do2.f10469a;
                ArrayList arrayList = new ArrayList(listC02);
                Collections.sort(arrayList, new bo2(new jc1(zn2Var, 23)));
                tn2 tn2Var3 = (tn2) arrayList.get(0);
                if (tn2Var3.a(zn2Var) && tn2Var3.b(zn2Var)) {
                    i10 = 32;
                }
            }
        }
        return i15 | i12 | i13 | i10 | i14;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final ArrayList Z(xn2 xn2Var, zn2 zn2Var) {
        List listC0 = C0(this.P0, xn2Var, zn2Var, false, false);
        HashMap map = do2.f10469a;
        ArrayList arrayList = new ArrayList(listC0);
        Collections.sort(arrayList, new bo2(new jc1(zn2Var, 23)));
        return arrayList;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.ej2
    public final void a(long j10, long j11) throws zziw {
        v1 v1Var = this.a1;
        if (v1Var != null) {
            try {
                v1Var.M(j10, j11);
            } catch (zzadq e10) {
                throw zzN(e10, e10.zza, false, PlaybackException.ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED);
            }
        }
        super.a(j10, j11);
    }

    @Override // com.google.android.gms.internal.ads.ej2
    public final boolean b(long j10) {
        long j11 = this.J0;
        return j11 == -9223372036854775807L || j10 > j11 - this.I0.f17722c;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final vg2 b0(tn2 tn2Var, zn2 zn2Var, zn2 zn2Var2) {
        int i10;
        int i11;
        vg2 vg2VarC = tn2Var.c(zn2Var, zn2Var2);
        q0 q0Var = this.X0;
        q0Var.getClass();
        int i12 = zn2Var2.f19339l;
        int i13 = q0Var.f15558a;
        int i14 = vg2VarC.f17632e;
        if (i12 > i13 || zn2Var2.f19340m > q0Var.f15559b) {
            i14 |= 256;
        }
        if (z0(tn2Var, zn2Var2) > q0Var.f15560c) {
            i14 |= 64;
        }
        String str = tn2Var.f16954a;
        if (i14 != 0) {
            i10 = 0;
            i11 = i14;
        } else {
            i10 = vg2VarC.f17631d;
            i11 = 0;
        }
        return new vg2(str, zn2Var, zn2Var2, i10, i11);
    }

    @Override // com.google.android.gms.internal.ads.ej2
    public final boolean d() {
        if (!this.F0) {
            return false;
        }
        v1 v1Var = this.a1;
        return v1Var == null || v1Var.zzj();
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final float d0(float f10, zn2 zn2Var, zn2[] zn2VarArr) {
        tn2 tn2VarZzaH;
        float fMax = -1.0f;
        for (zn2 zn2Var2 : zn2VarArr) {
            float f11 = zn2Var2.f19343p;
            if (f11 != -1.0f) {
                fMax = Math.max(fMax, f11);
            }
        }
        float f12 = fMax == -1.0f ? -1.0f : fMax * f10;
        if (this.zzD == null || (tn2VarZzaH = zzaH()) == null) {
            return f12;
        }
        int i10 = zn2Var.f19339l;
        float f13 = -3.4028235E38f;
        if (tn2VarZzaH.f16961h) {
            float f14 = tn2VarZzaH.f16964k;
            int i11 = zn2Var.f19340m;
            if (f14 != -3.4028235E38f && tn2VarZzaH.f16962i == i10 && tn2VarZzaH.f16963j == i11) {
                f13 = f14;
            } else {
                f13 = 1024.0f;
                if (!tn2VarZzaH.d(i10, i11, 1024.0d)) {
                    float f15 = 0.0f;
                    while (true) {
                        float f16 = f13 - f15;
                        if (Math.abs(f16) <= 5.0f) {
                            break;
                        }
                        float f17 = (f16 / 2.0f) + f15;
                        boolean zD = tn2VarZzaH.d(i10, i11, f17);
                        if (true == zD) {
                            f15 = f17;
                        }
                        if (true != zD) {
                            f13 = f17;
                        }
                    }
                    f13 = f15;
                }
                tn2VarZzaH.f16964k = f13;
                tn2VarZzaH.f16962i = i10;
                tn2VarZzaH.f16963j = i11;
            }
        }
        return f12 != -1.0f ? Math.max(f12, f13) : f13;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.ej2
    public final void e(float f10, float f11) throws zziw {
        super.e(f10, f11);
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.J(f10);
        } else {
            this.T0.e(f10);
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void e0(String str, long j10, long j11) {
        MediaCodecInfo.CodecProfileLevel[] codecProfileLevelArr;
        this.R0.b(j10, j11, str);
        this.Y0 = B0(str);
        tn2 tn2VarZzaH = zzaH();
        tn2VarZzaH.getClass();
        boolean z10 = false;
        if (Build.VERSION.SDK_INT >= 29 && MimeTypes.VIDEO_VP9.equals(tn2VarZzaH.f16955b)) {
            MediaCodecInfo.CodecCapabilities codecCapabilities = tn2VarZzaH.zzd;
            if (codecCapabilities == null || (codecProfileLevelArr = codecCapabilities.profileLevels) == null) {
                codecProfileLevelArr = new MediaCodecInfo.CodecProfileLevel[0];
            }
            int length = codecProfileLevelArr.length;
            int i10 = 0;
            while (true) {
                if (i10 >= length) {
                    break;
                }
                if (codecProfileLevelArr[i10].profile == 16384) {
                    z10 = true;
                    break;
                }
                i10++;
            }
        }
        this.Z0 = z10;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.pf2
    public final void f(long j10, boolean z10, boolean z11) {
        v1 v1Var = this.a1;
        if (v1Var != null && !z10) {
            v1Var.I(true);
        }
        super.f(j10, z10, z11);
        v1 v1Var2 = this.a1;
        d1 d1Var = this.T0;
        if (v1Var2 == null) {
            d1Var.f10127b.d();
            d1Var.f10132g = -9223372036854775807L;
            d1Var.f10130e = -9223372036854775807L;
            d1Var.f10129d = Math.min(d1Var.f10129d, 1);
            d1Var.f10133h = -9223372036854775807L;
        }
        if (z10) {
            v1 v1Var3 = this.a1;
            if (v1Var3 != null) {
                v1Var3.Q(false);
            } else {
                d1Var.f10134i = false;
                d1Var.f10133h = -9223372036854775807L;
            }
        }
        this.f15931k1 = 0;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void f0(String str) {
        this.R0.g(str);
    }

    @Override // com.google.android.gms.internal.ads.pf2
    public final void g() {
        this.f15930j1 = 0;
        this.f15398f.getClass();
        this.f15929i1 = SystemClock.elapsedRealtime();
        this.f15934n1 = 0L;
        this.f15935o1 = 0;
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.zza();
            return;
        }
        d1 d1Var = this.T0;
        d1Var.f10128c = true;
        ((h71) d1Var.f10136k).getClass();
        d1Var.f10131f = bb1.p(SystemClock.elapsedRealtime());
        d1Var.f10127b.a();
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void g0(Exception exc) {
        vt0.zzf("MediaCodecVideoRenderer", "Video codec error", exc);
        this.R0.i(exc);
    }

    @Override // com.google.android.gms.internal.ads.pf2
    public final void h() {
        int i10 = this.f15930j1;
        q1 q1Var = this.R0;
        if (i10 > 0) {
            this.f15398f.getClass();
            long jElapsedRealtime = SystemClock.elapsedRealtime();
            q1Var.c(this.f15930j1, jElapsedRealtime - this.f15929i1);
            this.f15930j1 = 0;
            this.f15929i1 = jElapsedRealtime;
        }
        int i11 = this.f15935o1;
        if (i11 != 0) {
            q1Var.d(i11, this.f15934n1);
            this.f15934n1 = 0L;
            this.f15935o1 = 0;
        }
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.zzb();
            return;
        }
        d1 d1Var = this.T0;
        d1Var.f10128c = false;
        d1Var.f10133h = -9223372036854775807L;
        d1Var.f10127b.b();
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void h0() {
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.zzi();
            long j10 = this.f15940t1;
            if (j10 == -9223372036854775807L) {
                j10 = this.I0.f17721b;
                this.f15940t1 = j10;
            }
            this.a1.R(-j10);
        } else {
            this.T0.a(2);
        }
        this.f15942v1 = true;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.pf2
    public final void i() {
        q1 q1Var = this.R0;
        this.zzJ = null;
        this.f15941u1 = -9223372036854775807L;
        this.f15926f1 = false;
        this.f15933m1 = true;
        try {
            super.i();
        } finally {
            q1Var.h(this.H0);
            q1Var.e(rw.f16234d);
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void i0() {
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.zzi();
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.pf2
    public final void j() {
        try {
            super.j();
        } finally {
            this.f15922b1 = false;
            this.f15940t1 = -9223372036854775807L;
            t0 t0Var = this.zzu;
            if (t0Var != null) {
                t0Var.release();
                this.zzu = null;
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void j0(fe2 fe2Var) {
        if (this.Z0) {
            ByteBuffer byteBuffer = fe2Var.zzf;
            byteBuffer.getClass();
            if (byteBuffer.remaining() >= 7) {
                byte b10 = byteBuffer.get();
                short s10 = byteBuffer.getShort();
                short s11 = byteBuffer.getShort();
                byte b11 = byteBuffer.get();
                byte b12 = byteBuffer.get();
                byteBuffer.position(0);
                if (b10 == -75 && s10 == 60 && s11 == 1 && b11 == 4) {
                    if (b12 == 0 || b12 == 1) {
                        byte[] bArr = new byte[byteBuffer.remaining()];
                        byteBuffer.get(bArr);
                        byteBuffer.position(0);
                        rn2 rn2VarZzaE = zzaE();
                        rn2VarZzaE.getClass();
                        Bundle bundle = new Bundle();
                        bundle.putByteArray("hdr10-plus-info", bArr);
                        rn2VarZzaE.c(bundle);
                    }
                }
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.pf2
    public final void k() {
        v1 v1Var = this.a1;
        if (v1Var == null || !this.Q0) {
            return;
        }
        v1Var.h();
    }

    public final boolean t0(long j10, long j11, boolean z10, boolean z11) throws zziw {
        int iQ;
        if (this.a1 != null && this.Q0) {
            j11 -= -this.f15940t1;
        }
        if (j10 >= -500000 || z10 || (iQ = q(j11)) == 0) {
            return false;
        }
        PriorityQueue priorityQueue = this.W0;
        if (z11) {
            ug2 ug2Var = this.H0;
            int i10 = ug2Var.f17243d + iQ;
            ug2Var.f17243d = i10;
            ug2Var.f17245f += this.f15932l1;
            ug2Var.f17243d = priorityQueue.size() + i10;
        } else {
            this.H0.f17249j++;
            w0(priorityQueue.size() + iQ, this.f15932l1);
        }
        M();
        v1 v1Var = this.a1;
        if (v1Var != null) {
            v1Var.I(false);
        }
        return true;
    }

    public final void v0(rn2 rn2Var, int i10) {
        Trace.beginSection("skipVideoBuffer");
        rn2Var.f(i10);
        Trace.endSection();
        this.H0.f17245f++;
    }

    public final void w0(int i10, int i11) {
        ug2 ug2Var = this.H0;
        ug2Var.f17247h += i10;
        int i12 = i10 + i11;
        ug2Var.f17246g += i12;
        this.f15930j1 += i12;
        int i13 = this.f15931k1 + i12;
        this.f15931k1 = i13;
        ug2Var.f17248i = Math.max(i13, ug2Var.f17248i);
    }

    public final void x0(long j10) {
        ug2 ug2Var = this.H0;
        ug2Var.f17250k += j10;
        ug2Var.f17251l++;
        this.f15934n1 += j10;
        this.f15935o1++;
    }

    @Override // com.google.android.gms.internal.ads.ej2
    public final void y() {
        v1 v1Var = this.a1;
        if (v1Var == null) {
            d1 d1Var = this.T0;
            if (d1Var.f10129d == 0) {
                d1Var.f10129d = 1;
                return;
            }
            return;
        }
        int i10 = this.f15923c1;
        if (i10 == 0 || i10 == 1) {
            this.f15923c1 = 0;
        } else {
            v1Var.zzt();
        }
    }

    public final void y0(rn2 rn2Var, int i10, long j10) {
        Trace.beginSection("releaseOutputBuffer");
        rn2Var.k(i10, j10);
        Trace.endSection();
        this.H0.f17244e++;
        this.f15931k1 = 0;
        if (this.a1 == null) {
            rw rwVar = this.f15937q1;
            if (!rwVar.equals(rw.f16234d) && !rwVar.equals(this.zzJ)) {
                this.zzJ = rwVar;
                this.R0.e(rwVar);
            }
            d1 d1Var = this.T0;
            int i11 = d1Var.f10129d;
            d1Var.f10129d = 3;
            ((h71) d1Var.f10136k).getClass();
            d1Var.f10131f = bb1.p(SystemClock.elapsedRealtime());
            if (i11 == 3 || this.zzt == null) {
                return;
            }
            F0();
        }
    }

    @Override // com.google.android.gms.internal.ads.ej2
    public final String z() {
        return "MediaCodecVideoRenderer";
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final zzum zzaP(Throwable th, @Nullable tn2 tn2Var) {
        return new zzabw(th, tn2Var, this.zzt);
    }

    /* JADX WARN: Code restructure failed: missing block: B:45:0x00e5, code lost:
    
        r3 = null;
     */
    @Override // com.google.android.gms.internal.ads.wn2
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final on2 zzaf(tn2 tn2Var, zn2 zn2Var, @Nullable MediaCrypto mediaCrypto, float f10) {
        int i10;
        int i11;
        q0 q0Var;
        Point pointZzi;
        int i12;
        boolean z10;
        zn2[] zn2VarArr;
        byte b10;
        int i13;
        Pair pairZzd;
        int iU0;
        zn2[] zn2VarArrM = m();
        int length = zn2VarArrM.length;
        int iZ0 = z0(tn2Var, zn2Var);
        float f11 = zn2Var.f19343p;
        int i14 = zn2Var.f19340m;
        int i15 = zn2Var.f19339l;
        if (length == 1) {
            if (iZ0 != -1 && (iU0 = u0(tn2Var, zn2Var)) != -1) {
                iZ0 = Math.min((int) (iZ0 * 1.5f), iU0);
            }
            q0Var = new q0(i15, i14, iZ0);
            i10 = i14;
            i11 = i15;
        } else {
            int iMax = i14;
            int iMax2 = i15;
            int i16 = 0;
            boolean z11 = false;
            while (i16 < length) {
                zn2 zn2Var2 = zn2VarArrM[i16];
                ea2 ea2Var = zn2Var.zzE;
                if (ea2Var != null && zn2Var2.zzE == null) {
                    sm2 sm2Var = new sm2(zn2Var2);
                    sm2Var.zzC(ea2Var);
                    zn2Var2 = new zn2(sm2Var);
                }
                if (tn2Var.c(zn2Var, zn2Var2).f17631d != 0) {
                    int i17 = zn2Var2.f19340m;
                    int i18 = zn2Var2.f19339l;
                    zn2VarArr = zn2VarArrM;
                    b10 = -1;
                    z11 |= i18 == -1 || i17 == -1;
                    iMax2 = Math.max(iMax2, i18);
                    iMax = Math.max(iMax, i17);
                    iZ0 = Math.max(iZ0, z0(tn2Var, zn2Var2));
                } else {
                    zn2VarArr = zn2VarArrM;
                    b10 = -1;
                }
                i16++;
                zn2VarArrM = zn2VarArr;
            }
            if (z11) {
                StringBuilder sb = new StringBuilder(String.valueOf(iMax2).length() + 44 + String.valueOf(iMax).length());
                sb.append("Resolutions unknown. Codec max resolution: ");
                sb.append(iMax2);
                sb.append("x");
                sb.append(iMax);
                vt0.c(sb.toString());
                boolean z12 = i14 > i15;
                int i19 = z12 ? i14 : i15;
                int i20 = true != z12 ? i14 : i15;
                int[] iArr = f15919w1;
                int i21 = 0;
                while (true) {
                    if (i21 >= 9) {
                        i10 = i14;
                        i11 = i15;
                        break;
                    }
                    float f12 = i20;
                    i10 = i14;
                    float f13 = i19;
                    i11 = i15;
                    int i22 = iArr[i21];
                    int[] iArr2 = iArr;
                    float f14 = i22;
                    if (i22 <= i19 || (i12 = (int) ((f12 / f13) * f14)) <= i20) {
                        break;
                    }
                    int i23 = true != z12 ? i22 : i12;
                    if (true != z12) {
                        i22 = i12;
                    }
                    pointZzi = tn2Var.zzi(i23, i22);
                    if (pointZzi != null) {
                        z10 = z12;
                        if (tn2Var.d(pointZzi.x, pointZzi.y, f11)) {
                            break;
                        }
                    } else {
                        z10 = z12;
                    }
                    i21++;
                    i14 = i10;
                    i15 = i11;
                    iArr = iArr2;
                    z12 = z10;
                }
                if (pointZzi != null) {
                    iMax2 = Math.max(iMax2, pointZzi.x);
                    iMax = Math.max(iMax, pointZzi.y);
                    sm2 sm2Var2 = new sm2(zn2Var);
                    sm2Var2.f16487j = iMax2;
                    sm2Var2.f16488k = iMax;
                    iZ0 = Math.max(iZ0, u0(tn2Var, new zn2(sm2Var2)));
                    StringBuilder sb2 = new StringBuilder(com.google.android.gms.measurement.internal.u1.b(iMax2, 35) + String.valueOf(iMax).length());
                    sb2.append("Codec max resolution adjusted to: ");
                    sb2.append(iMax2);
                    sb2.append("x");
                    sb2.append(iMax);
                    vt0.c(sb2.toString());
                }
            } else {
                i10 = i14;
                i11 = i15;
            }
            q0Var = new q0(iMax2, iMax, iZ0);
        }
        String str = tn2Var.f16956c;
        this.X0 = q0Var;
        MediaFormat mediaFormat = new MediaFormat();
        mediaFormat.setString(IMediaFormat.KEY_MIME, str);
        mediaFormat.setInteger("width", i11);
        mediaFormat.setInteger("height", i10);
        ni.i(mediaFormat, zn2Var.f19336i);
        if (f11 != -1.0f) {
            mediaFormat.setFloat("frame-rate", f11);
        }
        ni.t(mediaFormat, "rotation-degrees", zn2Var.f19344q);
        ea2 ea2Var2 = zn2Var.zzE;
        if (ea2Var2 != null) {
            ni.t(mediaFormat, "color-transfer", ea2Var2.f10736c);
            ni.t(mediaFormat, "color-standard", ea2Var2.f10734a);
            ni.t(mediaFormat, "color-range", ea2Var2.f10735b);
            byte[] bArr = ea2Var2.zze;
            if (bArr != null) {
                mediaFormat.setByteBuffer("hdr-static-info", ByteBuffer.wrap(bArr));
            }
        }
        if (MimeTypes.VIDEO_DOLBY_VISION.equals(zn2Var.zzo) && (pairZzd = km0.zzd(zn2Var)) != null) {
            ni.t(mediaFormat, "profile", ((Integer) pairZzd.first).intValue());
        }
        mediaFormat.setInteger("max-width", q0Var.f15558a);
        mediaFormat.setInteger("max-height", q0Var.f15559b);
        ni.t(mediaFormat, "max-input-size", q0Var.f15560c);
        mediaFormat.setInteger("priority", 0);
        if (f10 != -1.0f) {
            mediaFormat.setFloat("operating-rate", f10);
        }
        if (this.S0) {
            mediaFormat.setInteger("no-post-process", 1);
            i13 = 0;
            mediaFormat.setInteger("auto-frc", 0);
        } else {
            i13 = 0;
        }
        if (Build.VERSION.SDK_INT >= 35) {
            mediaFormat.setInteger("importance", Math.max(i13, -this.f15938r1));
        }
        Surface surfaceZzbt = zzbt(tn2Var);
        if (this.a1 != null && !bb1.i(this.P0)) {
            mediaFormat.setInteger("allow-frame-drop", 0);
        }
        return on2.zzb(tn2Var, mediaFormat, zn2Var, surfaceZzbt, null);
    }

    @Override // com.google.android.gms.internal.ads.wn2
    @Nullable
    public final vg2 zzam(di2 di2Var) throws zziw {
        vg2 vg2VarZzam = super.zzam(di2Var);
        zn2 zn2Var = di2Var.zzb;
        zn2Var.getClass();
        this.R0.zzc(zn2Var, vg2VarZzam);
        return vg2VarZzam;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final void zzan(zn2 zn2Var, @Nullable MediaFormat mediaFormat) {
        rn2 rn2VarZzaE = zzaE();
        if (rn2VarZzaE != null) {
            rn2VarZzaE.b(this.f15927g1);
        }
        mediaFormat.getClass();
        boolean z10 = mediaFormat.containsKey("crop-right") && mediaFormat.containsKey("crop-left") && mediaFormat.containsKey("crop-bottom") && mediaFormat.containsKey("crop-top");
        int integer = z10 ? (mediaFormat.getInteger("crop-right") - mediaFormat.getInteger("crop-left")) + 1 : mediaFormat.getInteger("width");
        int integer2 = z10 ? (mediaFormat.getInteger("crop-bottom") - mediaFormat.getInteger("crop-top")) + 1 : mediaFormat.getInteger("height");
        float f10 = zn2Var.f19345r;
        int i10 = zn2Var.f19344q;
        if (i10 == 90 || i10 == 270) {
            f10 = 1.0f / f10;
            int i11 = integer2;
            integer2 = integer;
            integer = i11;
        }
        this.f15937q1 = new rw(integer, integer2, f10);
        v1 v1Var = this.a1;
        if (v1Var == null || !this.f15942v1) {
            this.T0.b(zn2Var.f19343p);
        } else {
            sm2 sm2Var = new sm2(zn2Var);
            sm2Var.f16487j = integer;
            sm2Var.f16488k = integer2;
            sm2Var.f16493p = f10;
            zn2 zn2Var2 = new zn2(sm2Var);
            int i12 = this.f15923c1;
            List list = this.f15924d1;
            if (list == null) {
                list = zzgwa.f19786e;
            }
            v1Var.S(zn2Var2, this.I0.f17721b, i12, list);
            this.f15923c1 = 2;
        }
        this.f15942v1 = false;
    }

    @Override // com.google.android.gms.internal.ads.wn2
    public final boolean zzaq(long j10, long j11, @Nullable rn2 rn2Var, @Nullable ByteBuffer byteBuffer, int i10, int i11, int i12, long j12, boolean z10, boolean z11, zn2 zn2Var) throws zziw {
        long j13;
        long j14;
        rn2Var.getClass();
        long j15 = j12 - this.I0.f17722c;
        int i13 = 0;
        while (true) {
            PriorityQueue priorityQueue = this.W0;
            Long l10 = (Long) priorityQueue.peek();
            if (l10 == null || l10.longValue() >= j12) {
                break;
            }
            priorityQueue.poll();
            i13++;
        }
        w0(i13, 0);
        v1 v1Var = this.a1;
        if (v1Var != null) {
            if (!z10 || z11) {
                return v1Var.K(j12, new n0(this, rn2Var, i10, j15));
            }
            v0(rn2Var, i10);
            return true;
        }
        d1 d1Var = this.T0;
        long j16 = this.I0.f17721b;
        androidx.emoji2.text.l0 l0Var = this.U0;
        int iD = d1Var.d(j12, j10, j11, j16, z10, z11, l0Var);
        if (iD == 0) {
            this.f15398f.getClass();
            long jNanoTime = System.nanoTime();
            b1 b1Var = this.zzM;
            if (b1Var != null) {
                b1Var.zzcS(j15, jNanoTime, zn2Var, zzaG());
            }
            y0(rn2Var, i10, jNanoTime);
            x0(l0Var.b());
            return true;
        }
        if (iD != 1) {
            if (iD != 2) {
                if (iD != 3) {
                    return false;
                }
                v0(rn2Var, i10);
                x0(l0Var.b());
                return true;
            }
            Trace.beginSection("dropVideoBuffer");
            rn2Var.f(i10);
            Trace.endSection();
            w0(0, 1);
            x0(l0Var.b());
            return true;
        }
        switch (l0Var.f2246a) {
            case 5:
                j13 = l0Var.f2248c;
                break;
            default:
                j13 = l0Var.f2248c;
                break;
        }
        long j17 = j13;
        long jB = l0Var.b();
        if (j17 == this.f15936p1) {
            v0(rn2Var, i10);
            j14 = jB;
        } else {
            b1 b1Var2 = this.zzM;
            if (b1Var2 != null) {
                j14 = jB;
                b1Var2.zzcS(j15, j17, zn2Var, zzaG());
            } else {
                j14 = jB;
            }
            y0(rn2Var, i10, j17);
        }
        x0(j14);
        this.f15936p1 = j17;
        return true;
    }

    @Override // com.google.android.gms.internal.ads.wn2, com.google.android.gms.internal.ads.pf2, com.google.android.gms.internal.ads.ej2, com.google.android.gms.internal.ads.zi2
    public final void zzx(int i10, @Nullable Object obj) throws zziw {
        if (i10 == 1) {
            zzbo(obj);
            return;
        }
        if (i10 == 7) {
            obj.getClass();
            b1 b1Var = (b1) obj;
            this.zzM = b1Var;
            v1 v1Var = this.a1;
            if (v1Var != null) {
                v1Var.L(b1Var);
                return;
            }
            return;
        }
        if (i10 == 10) {
            obj.getClass();
            int iIntValue = ((Integer) obj).intValue();
            if (this.f15939s1 != iIntValue) {
                this.f15939s1 = iIntValue;
                return;
            }
            return;
        }
        if (i10 == 4) {
            obj.getClass();
            int iIntValue2 = ((Integer) obj).intValue();
            this.f15927g1 = iIntValue2;
            rn2 rn2VarZzaE = zzaE();
            if (rn2VarZzaE != null) {
                rn2VarZzaE.b(iIntValue2);
                return;
            }
            return;
        }
        if (i10 == 5) {
            obj.getClass();
            int iIntValue3 = ((Integer) obj).intValue();
            this.f15928h1 = iIntValue3;
            v1 v1Var2 = this.a1;
            if (v1Var2 != null) {
                v1Var2.O(iIntValue3);
                return;
            }
            i1 i1Var = this.T0.f10127b;
            if (i1Var.f12308h == iIntValue3) {
                return;
            }
            i1Var.f12308h = iIntValue3;
            i1Var.f(true);
            return;
        }
        if (i10 == 13) {
            obj.getClass();
            List list = (List) obj;
            if (list.equals(lu.f13867a)) {
                v1 v1Var3 = this.a1;
                if (v1Var3 == null || !v1Var3.zze()) {
                    return;
                }
                v1Var3.zzf();
                return;
            }
            this.f15924d1 = list;
            v1 v1Var4 = this.a1;
            if (v1Var4 != null) {
                v1Var4.P(list);
                return;
            }
            return;
        }
        if (i10 == 14) {
            obj.getClass();
            h11 h11Var = (h11) obj;
            if (h11Var.f11979a == 0 || h11Var.f11980b == 0) {
                return;
            }
            this.f15925e1 = h11Var;
            v1 v1Var5 = this.a1;
            if (v1Var5 != null) {
                Surface surface = this.zzt;
                surface.getClass();
                v1Var5.N(surface, h11Var);
                return;
            }
            return;
        }
        switch (i10) {
            case 16:
                obj.getClass();
                this.f15938r1 = ((Integer) obj).intValue();
                rn2 rn2VarZzaE2 = zzaE();
                if (rn2VarZzaE2 != null && Build.VERSION.SDK_INT >= 35) {
                    Bundle bundle = new Bundle();
                    bundle.putInt("importance", Math.max(0, -this.f15938r1));
                    rn2VarZzaE2.c(bundle);
                    break;
                }
                break;
            case 17:
                Surface surface2 = this.zzt;
                zzbo(null);
                obj.getClass();
                ((r0) obj).zzx(1, surface2);
                break;
            case 18:
                boolean z10 = this.zzD != null;
                ij2 ij2Var = (ij2) obj;
                this.zzD = ij2Var;
                if (z10 != (ij2Var != null)) {
                    X();
                }
                break;
            default:
                super.zzx(i10, obj);
                break;
        }
    }
}
