package defpackage;

import androidx.media3.common.ParserException;
import java.math.RoundingMode;

/* renamed from: ʼˑ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0054 implements InterfaceC2043 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final byte[] f1236;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public long f1237;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final int f1238;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public final C3493 f1239;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C2942 f1240;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f1241;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final InterfaceC1982 f1242;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final InterfaceC2154 f1243;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public long f1244;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public int f1245;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final C3446 f1246;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final int f1247;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public static final int[] f1235 = {-1, -1, -1, -1, 2, 4, 6, 8, -1, -1, -1, -1, 2, 4, 6, 8};

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public static final int[] f1234 = {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};

    public C0054(InterfaceC1982 interfaceC1982, InterfaceC2154 interfaceC2154, C2942 c2942) throws ParserException {
        this.f1242 = interfaceC1982;
        this.f1243 = interfaceC2154;
        this.f1240 = c2942;
        int i = c2942.f11404;
        int iMax = Math.max(1, i / 10);
        this.f1238 = iMax;
        C3493 c3493 = new C3493(c2942.f11401);
        c3493.m7962();
        int iM7962 = c3493.m7962();
        this.f1247 = iM7962;
        int i2 = c2942.f11403;
        int i3 = c2942.f11402;
        int i4 = (((i3 - (i2 * 4)) * 8) / (c2942.f11405 * i2)) + 1;
        if (iM7962 != i4) {
            throw ParserException.m356("Expected frames per block: " + i4 + "; got: " + iM7962, null);
        }
        int iM8116 = AbstractC3558.m8116(iMax, iM7962);
        this.f1236 = new byte[iM8116 * i3];
        this.f1239 = new C3493(iM7962 * 2 * i2 * iM8116);
        int i5 = ((i3 * i) * 8) / iM7962;
        C2153 c2153 = new C2153();
        c2153.f8516 = AbstractC2924.m7101("audio/raw");
        c2153.f8525 = i5;
        c2153.f8504 = i5;
        c2153.f8519 = iMax * 2 * i2;
        c2153.f8517 = i2;
        c2153.f8513 = i;
        c2153.f8526 = 2;
        this.f1246 = new C3446(c2153);
    }

    @Override // defpackage.InterfaceC2043
    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final void mo1105(long j, int i) {
        C4037 c4037 = new C4037(this.f1240, this.f1247, i, j);
        this.f1242.mo4987(c4037);
        C3446 c3446 = this.f1246;
        InterfaceC2154 interfaceC2154 = this.f1243;
        interfaceC2154.mo4407(c3446);
        interfaceC2154.mo4412(c4037.f15168);
    }

    @Override // defpackage.InterfaceC2043
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void mo1106(long j) {
        this.f1241 = 0;
        this.f1244 = j;
        this.f1245 = 0;
        this.f1237 = 0L;
    }

    /*  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)
        */
    /* 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!!! */
    @Override // defpackage.InterfaceC2043
    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean mo1107(defpackage.InterfaceC1383 r25, long r26) {
        /*
            Method dump skipped, instructions count: 327
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C0054.mo1107(ˊᵬᐧ, long):boolean");
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final void m1108(int i) {
        long j = this.f1244;
        long j2 = this.f1237;
        C2942 c2942 = this.f1240;
        long j3 = c2942.f11404;
        String str = AbstractC3558.f13329;
        long jM8115 = j + AbstractC3558.m8115(j2, 1000000L, j3, RoundingMode.DOWN);
        int i2 = i * 2 * c2942.f11403;
        this.f1243.mo4410(jM8115, 1, i2, this.f1245 - i2, null);
        this.f1237 += i;
        this.f1245 -= i2;
    }
}
