package defpackage;

import androidx.media3.common.audio.AudioProcessor$UnhandledAudioFormatException;
import java.nio.ByteBuffer;

/* renamed from: ˀʖˎˁ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0496 extends AbstractC3190 {

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public static final int f2616 = Float.floatToIntBits(Float.NaN);

    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public static void m2172(int i, ByteBuffer byteBuffer) {
        int iFloatToIntBits = Float.floatToIntBits((float) (i * 4.656612875245797E-10d));
        if (iFloatToIntBits == f2616) {
            iFloatToIntBits = Float.floatToIntBits(0.0f);
        }
        byteBuffer.putInt(iFloatToIntBits);
    }

    @Override // defpackage.InterfaceC0240
    /* renamed from: ˏˋٴ */
    public final void mo1540(ByteBuffer byteBuffer) {
        ByteBuffer byteBufferM7540;
        int iPosition = byteBuffer.position();
        int iLimit = byteBuffer.limit();
        int i = iLimit - iPosition;
        int i2 = this.f12082.f8839;
        if (i2 == 2) {
            byteBufferM7540 = m7540(i * 2);
            while (iPosition < iLimit) {
                m2172(((byteBuffer.get(iPosition) & 255) << 16) | ((byteBuffer.get(iPosition + 1) & 255) << 24), byteBufferM7540);
                iPosition += 2;
            }
        } else if (i2 == 1342177280) {
            byteBufferM7540 = m7540((i / 3) * 4);
            while (iPosition < iLimit) {
                m2172(((byteBuffer.get(iPosition + 2) & 255) << 8) | ((byteBuffer.get(iPosition + 1) & 255) << 16) | ((byteBuffer.get(iPosition) & 255) << 24), byteBufferM7540);
                iPosition += 3;
            }
        } else if (i2 == 1610612736) {
            byteBufferM7540 = m7540(i);
            while (iPosition < iLimit) {
                m2172((byteBuffer.get(iPosition + 3) & 255) | ((byteBuffer.get(iPosition + 2) & 255) << 8) | ((byteBuffer.get(iPosition + 1) & 255) << 16) | ((byteBuffer.get(iPosition) & 255) << 24), byteBufferM7540);
                iPosition += 4;
            }
        } else if (i2 == 1879048192) {
            byteBufferM7540 = m7540(i / 2);
            while (iPosition < iLimit) {
                byteBufferM7540.putFloat((float) byteBuffer.getDouble(iPosition));
                iPosition += 8;
            }
        } else if (i2 == 21) {
            byteBufferM7540 = m7540((i / 3) * 4);
            while (iPosition < iLimit) {
                m2172(((byteBuffer.get(iPosition) & 255) << 8) | ((byteBuffer.get(iPosition + 1) & 255) << 16) | ((byteBuffer.get(iPosition + 2) & 255) << 24), byteBufferM7540);
                iPosition += 3;
            }
        } else {
            if (i2 != 22) {
                ᵨᴵᵺ.ˌʾˀ();
                return;
            }
            byteBufferM7540 = m7540(i);
            while (iPosition < iLimit) {
                m2172((byteBuffer.get(iPosition) & 255) | ((byteBuffer.get(iPosition + 1) & 255) << 8) | ((byteBuffer.get(iPosition + 2) & 255) << 16) | ((byteBuffer.get(iPosition + 3) & 255) << 24), byteBufferM7540);
                iPosition += 4;
            }
        }
        byteBuffer.position(byteBuffer.limit());
        byteBufferM7540.flip();
    }

    @Override // defpackage.AbstractC3190
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C2263 mo2173(C2263 c2263) throws AudioProcessor$UnhandledAudioFormatException {
        int i = c2263.f8839;
        if (AbstractC3558.m8104(i) || i == 2) {
            return i != 4 ? new C2263(c2263.f8840, c2263.f8841, 4) : C2263.f8838;
        }
        throw new AudioProcessor$UnhandledAudioFormatException(c2263);
    }
}
