package A1;

import n4.u0;

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

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final x0.t f32b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final x0.o f33c;

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

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

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

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public long f38h;
    public long i;

    public B(int i) {
        this.f31a = i;
        switch (i) {
            case 1:
                this.f32b = new x0.t(0L);
                this.f37g = -9223372036854775807L;
                this.f38h = -9223372036854775807L;
                this.i = -9223372036854775807L;
                this.f33c = new x0.o();
                break;
            default:
                this.f32b = new x0.t(0L);
                this.f37g = -9223372036854775807L;
                this.f38h = -9223372036854775807L;
                this.i = -9223372036854775807L;
                this.f33c = new x0.o();
                break;
        }
    }

    public static int b(int i, byte[] bArr) {
        return (bArr[i + 3] & 255) | ((bArr[i] & 255) << 24) | ((bArr[i + 1] & 255) << 16) | ((bArr[i + 2] & 255) << 8);
    }

    public static long c(x0.o oVar) {
        int i = oVar.f18540b;
        if (oVar.a() < 9) {
            return -9223372036854775807L;
        }
        byte[] bArr = new byte[9];
        oVar.e(bArr, 0, 9);
        oVar.F(i);
        byte b8 = bArr[0];
        if ((b8 & 196) == 68) {
            byte b9 = bArr[2];
            if ((b9 & 4) == 4) {
                byte b10 = bArr[4];
                if ((b10 & 4) == 4 && (bArr[5] & 1) == 1 && (bArr[8] & 3) == 3) {
                    long j8 = b8;
                    long j9 = b9;
                    return ((j9 & 3) << 13) | ((j8 & 3) << 28) | (((56 & j8) >> 3) << 30) | ((((long) bArr[1]) & 255) << 20) | (((j9 & 248) >> 3) << 15) | ((((long) bArr[3]) & 255) << 5) | ((((long) b10) & 248) >> 3);
                }
            }
        }
        return -9223372036854775807L;
    }

    public final void a(T0.j jVar) {
        switch (this.f31a) {
            case u0.f15495q /* 0 */:
                byte[] bArr = x0.v.f18555c;
                x0.o oVar = this.f33c;
                oVar.getClass();
                oVar.D(bArr.length, bArr);
                this.f34d = true;
                jVar.f6430v = 0;
                break;
            default:
                byte[] bArr2 = x0.v.f18555c;
                x0.o oVar2 = this.f33c;
                oVar2.getClass();
                oVar2.D(bArr2.length, bArr2);
                this.f34d = true;
                jVar.f6430v = 0;
                break;
        }
    }
}
