discord-jadx/app/src/main/java/c/i/a/c/v1/x.java

53 lines
2.0 KiB
Java

package c.i.a.c.v1;
import c.i.a.c.i2.f0;
import com.google.android.exoplayer2.audio.AudioProcessor;
import java.nio.ByteBuffer;
/* compiled from: FloatResamplingAudioProcessor */
public final class x extends u {
public static final int i = Float.floatToIntBits(Float.NaN);
public static void k(int i2, ByteBuffer byteBuffer) {
int floatToIntBits = Float.floatToIntBits((float) (((double) 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.b.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 // c.i.a.c.v1.u
public AudioProcessor.a f(AudioProcessor.a aVar) throws AudioProcessor.UnhandledAudioFormatException {
int i2 = aVar.d;
if (f0.y(i2)) {
return i2 != 4 ? new AudioProcessor.a(aVar.b, aVar.f2202c, 4) : AudioProcessor.a.a;
}
throw new AudioProcessor.UnhandledAudioFormatException(aVar);
}
}