discord-jadx/app/src/main/java/b/i/a/c/t2/y.java

54 lines
2.1 KiB
Java

package b.i.a.c.t2;
import b.i.a.c.f3.e0;
import com.google.android.exoplayer2.audio.AudioProcessor;
import java.nio.ByteBuffer;
/* compiled from: FloatResamplingAudioProcessor.java */
/* loaded from: classes3.dex */
public final class y extends v {
public static final int i = Float.floatToIntBits(Float.NaN);
public static void k(int i2, ByteBuffer byteBuffer) {
int floatToIntBits = Float.floatToIntBits((float) (i2 * 4.656612875245797E-10d));
if (floatToIntBits == i) {
floatToIntBits = Float.floatToIntBits(0.0f);
}
byteBuffer.putInt(floatToIntBits);
}
@Override // com.google.android.exoplayer2.audio.AudioProcessor
public void c(ByteBuffer byteBuffer) {
ByteBuffer byteBuffer2;
int position = byteBuffer.position();
int limit = byteBuffer.limit();
int i2 = limit - position;
int i3 = this.f1132b.d;
if (i3 == 536870912) {
byteBuffer2 = j((i2 / 3) * 4);
while (position < limit) {
k(((byteBuffer.get(position) & 255) << 8) | ((byteBuffer.get(position + 1) & 255) << 16) | ((byteBuffer.get(position + 2) & 255) << 24), byteBuffer2);
position += 3;
}
} else if (i3 == 805306368) {
byteBuffer2 = j(i2);
while (position < limit) {
k((byteBuffer.get(position) & 255) | ((byteBuffer.get(position + 1) & 255) << 8) | ((byteBuffer.get(position + 2) & 255) << 16) | ((byteBuffer.get(position + 3) & 255) << 24), byteBuffer2);
position += 4;
}
} else {
throw new IllegalStateException();
}
byteBuffer.position(byteBuffer.limit());
byteBuffer2.flip();
}
@Override // b.i.a.c.t2.v
public AudioProcessor.a f(AudioProcessor.a aVar) throws AudioProcessor.UnhandledAudioFormatException {
int i2 = aVar.d;
if (e0.y(i2)) {
return i2 != 4 ? new AudioProcessor.a(aVar.f2887b, aVar.c, 4) : AudioProcessor.a.a;
}
throw new AudioProcessor.UnhandledAudioFormatException(aVar);
}
}