package B0;

import android.os.SystemClock;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class j0 {

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public static final L0.C f814u = new L0.C(new Object());

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final u0.S f815a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final L0.C f816b;

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

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

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

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

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final L0.n0 f822h;
    public final O0.v i;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final L0.C f824k;

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

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final int f827n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final u0.H f828o;

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

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public volatile long f830q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public volatile long f831r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public volatile long f832s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public volatile long f833t;

    public j0(u0.S s8, L0.C c3, long j8, long j9, int i, C0030q c0030q, boolean z8, L0.n0 n0Var, O0.v vVar, List list, L0.C c8, boolean z9, int i5, int i8, u0.H h8, long j10, long j11, long j12, long j13, boolean z10) {
        this.f815a = s8;
        this.f816b = c3;
        this.f817c = j8;
        this.f818d = j9;
        this.f819e = i;
        this.f820f = c0030q;
        this.f821g = z8;
        this.f822h = n0Var;
        this.i = vVar;
        this.f823j = list;
        this.f824k = c8;
        this.f825l = z9;
        this.f826m = i5;
        this.f827n = i8;
        this.f828o = h8;
        this.f830q = j10;
        this.f831r = j11;
        this.f832s = j12;
        this.f833t = j13;
        this.f829p = z10;
    }

    public static j0 j(O0.v vVar) {
        u0.O o8 = u0.S.f17199a;
        L0.C c3 = f814u;
        return new j0(o8, c3, -9223372036854775807L, 0L, 1, null, false, L0.n0.f3882d, vVar, C3.W.f1225u, c3, false, 1, 0, u0.H.f17158d, 0L, 0L, 0L, 0L, false);
    }

    public final j0 a() {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, this.f821g, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, k(), SystemClock.elapsedRealtime(), this.f829p);
    }

    public final j0 b(boolean z8) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, z8, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 c(L0.C c3) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, this.f821g, this.f822h, this.i, this.f823j, c3, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 d(L0.C c3, long j8, long j9, long j10, long j11, L0.n0 n0Var, O0.v vVar, List list) {
        return new j0(this.f815a, c3, j9, j10, this.f819e, this.f820f, this.f821g, n0Var, vVar, list, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, j11, j8, SystemClock.elapsedRealtime(), this.f829p);
    }

    public final j0 e(int i, int i5, boolean z8) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, this.f821g, this.f822h, this.i, this.f823j, this.f824k, z8, i, i5, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 f(C0030q c0030q) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, c0030q, this.f821g, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 g(u0.H h8) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, this.f821g, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, h8, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 h(int i) {
        return new j0(this.f815a, this.f816b, this.f817c, this.f818d, i, this.f820f, this.f821g, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final j0 i(u0.S s8) {
        return new j0(s8, this.f816b, this.f817c, this.f818d, this.f819e, this.f820f, this.f821g, this.f822h, this.i, this.f823j, this.f824k, this.f825l, this.f826m, this.f827n, this.f828o, this.f830q, this.f831r, this.f832s, this.f833t, this.f829p);
    }

    public final long k() {
        long j8;
        long j9;
        if (!l()) {
            return this.f832s;
        }
        do {
            j8 = this.f833t;
            j9 = this.f832s;
        } while (j8 != this.f833t);
        return x0.v.L(x0.v.W(j9) + ((long) ((SystemClock.elapsedRealtime() - j8) * this.f828o.f17159a)));
    }

    public final boolean l() {
        return this.f819e == 3 && this.f825l && this.f827n == 0;
    }
}
