package B1;

import T0.F;
import T0.o;
import java.math.RoundingMode;
import u0.C1578n;
import u0.C1579o;
import u0.E;
import x0.v;

/* JADX INFO: loaded from: classes.dex */
public final class a implements b {

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public static final int[] f928m = {-1, -1, -1, -1, 2, 4, 6, 8, -1, -1, -1, -1, 2, 4, 6, 8};

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public static final int[] f929n = {7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767};

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final o f930a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final F f931b;

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final byte[] f934e;

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

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

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final C1579o f937h;
    public int i;

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

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

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

    public a(o oVar, F f3, e eVar) throws u0.F {
        this.f930a = oVar;
        this.f931b = f3;
        this.f932c = eVar;
        int i = eVar.f957r;
        int iMax = Math.max(1, i / 10);
        this.f936g = iMax;
        x0.o oVar2 = new x0.o((byte[]) eVar.f960u);
        oVar2.m();
        int iM = oVar2.m();
        this.f933d = iM;
        int i5 = eVar.f956q;
        int i8 = eVar.f958s;
        int i9 = (((i8 - (i5 * 4)) * 8) / (eVar.f959t * i5)) + 1;
        if (iM != i9) {
            throw u0.F.a(null, "Expected frames per block: " + i9 + "; got: " + iM);
        }
        int iF = v.f(iMax, iM);
        this.f934e = new byte[iF * i8];
        this.f935f = new x0.o(iM * 2 * i5 * iF);
        int i10 = ((i8 * i) * 8) / iM;
        C1578n c1578n = new C1578n();
        c1578n.f17320m = E.m("audio/raw");
        c1578n.f17316h = i10;
        c1578n.i = i10;
        c1578n.f17321n = iMax * 2 * i5;
        c1578n.f17301C = i5;
        c1578n.D = i;
        c1578n.f17302E = 2;
        this.f937h = new C1579o(c1578n);
    }

    @Override // B1.b
    public final void a(long j8) {
        this.i = 0;
        this.f938j = j8;
        this.f939k = 0;
        this.f940l = 0L;
    }

    @Override // B1.b
    public final void b(long j8, int i) {
        this.f930a.v(new g(this.f932c, this.f933d, i, j8));
        this.f931b.e(this.f937h);
    }

    /* JADX WARN: Removed duplicated region for block: B:43:0x0045 A[ADDED_TO_REGION, EDGE_INSN: B:43:0x0045->B:14:0x0045 BREAK  A[LOOP:0: B:6:0x0023->B:13:0x003f], REMOVE, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0027  */
    /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:11:0x003c -> B:4:0x0020). Please report as a decompilation issue!!! */
    /*  JADX ERROR: JadxOverflowException in pass: RegionMakerVisitor
        jadx.core.utils.exceptions.JadxOverflowException: Regions count limit reached
        	at jadx.core.utils.ErrorsCounter.addError(ErrorsCounter.java:59)
        	at jadx.core.utils.ErrorsCounter.error(ErrorsCounter.java:31)
        	at jadx.core.dex.attributes.nodes.NotificationAttrNode.addError(NotificationAttrNode.java:19)
        */
    @Override // B1.b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean c(T0.j r25, long r26) {
        /*
            Method dump skipped, instruction units count: 327
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: B1.a.c(T0.j, long):boolean");
    }

    public final void d(int i) {
        long j8 = this.f938j;
        long j9 = this.f940l;
        e eVar = this.f932c;
        long j10 = eVar.f957r;
        int i5 = v.f18553a;
        long jS = j8 + v.S(j9, 1000000L, j10, RoundingMode.DOWN);
        int i8 = i * 2 * eVar.f956q;
        this.f931b.a(jS, 1, i8, this.f939k - i8, null);
        this.f940l += (long) i;
        this.f939k -= i8;
    }
}
