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

import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import androidx.annotation.CheckResult;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes2.dex */
public final class zziw extends zzau {
    public final int zzc;

    @Nullable
    public final String zzd;
    public final int zze;

    @Nullable
    public final zn2 zzf;
    public final int zzg;

    @Nullable
    public final cp2 zzh;
    final boolean zzi;

    public zziw(int i10, Throwable th, int i11) {
        this(i10, th, null, i11, null, -1, null, 4, null, false);
    }

    public static zziw zzb(Throwable th, String str, int i10, @Nullable zn2 zn2Var, int i11, @Nullable cp2 cp2Var, boolean z10, int i12) {
        return new zziw(1, th, null, i12, str, i10, zn2Var, zn2Var == null ? 4 : i11, cp2Var, z10);
    }

    @CheckResult
    public final zziw zzd(@Nullable cp2 cp2Var) {
        String message = getMessage();
        String str = bb1.f9474a;
        return new zziw(message, getCause(), this.zza, this.zzc, this.zzd, this.zze, this.zzf, this.zzg, cp2Var, this.zzb, this.zzi);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    private zziw(int i10, @Nullable Throwable th, @Nullable String str, int i11, @Nullable String str2, int i12, @Nullable zn2 zn2Var, int i13, @Nullable cp2 cp2Var, boolean z10) {
        String strP;
        String str3;
        if (i10 == 0) {
            strP = "Source error";
        } else if (i10 != 1) {
            strP = "Unexpected runtime error";
        } else {
            String strValueOf = String.valueOf(zn2Var);
            String str4 = bb1.f9474a;
            if (i13 == 0) {
                str3 = "NO";
            } else if (i13 == 1) {
                str3 = "NO_UNSUPPORTED_TYPE";
            } else if (i13 == 2) {
                str3 = "NO_UNSUPPORTED_DRM";
            } else if (i13 == 3) {
                str3 = "NO_EXCEEDS_CAPABILITIES";
            } else {
                if (i13 != 4) {
                    throw new IllegalStateException();
                }
                str3 = "YES";
            }
            StringBuilder sb = new StringBuilder(str3.length() + strValueOf.length() + com.google.android.gms.measurement.internal.u1.c(String.valueOf(i12), String.valueOf(str2).length() + 14, 9) + 19);
            sb.append(str2);
            sb.append(" error, index=");
            sb.append(i12);
            sb.append(", format=");
            strP = defpackage.e.p(sb, strValueOf, ", format_supported=", str3);
        }
        this(TextUtils.isEmpty(null) ? strP : strP.concat(": null"), th, i11, i10, str2, i12, zn2Var, i13, cp2Var, SystemClock.elapsedRealtime(), z10);
    }

    private zziw(String str, @Nullable Throwable th, int i10, int i11, @Nullable String str2, int i12, @Nullable zn2 zn2Var, int i13, @Nullable cp2 cp2Var, long j10, boolean z10) {
        int i14;
        boolean z11;
        super(str, th, i10, Bundle.EMPTY, j10);
        if (z10) {
            i14 = i11;
            if (i14 == 1) {
                i14 = 1;
                z11 = true;
            } else {
                z11 = false;
            }
        } else {
            i14 = i11;
            z11 = true;
        }
        ih1.x(z11);
        ih1.x(th != null);
        this.zzc = i14;
        this.zzd = str2;
        this.zze = i12;
        this.zzf = zn2Var;
        this.zzg = i13;
        this.zzh = cp2Var;
        this.zzi = z10;
    }
}
