Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,154 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import android.os.Handler;
import com.fyber.inneractive.sdk.player.exoplayer2.decoder.DecoderCounters;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
/* loaded from: classes2.dex */
public interface AudioRendererEventListener {
public static final class EventDispatcher {
private final Handler handler;
private final AudioRendererEventListener listener;
public class a implements Runnable {
public final /* synthetic */ DecoderCounters a;
public a(DecoderCounters decoderCounters) {
this.a = decoderCounters;
}
@Override // java.lang.Runnable
public final void run() {
EventDispatcher.this.listener.onAudioEnabled(this.a);
}
}
public class b implements Runnable {
public final /* synthetic */ String a;
public final /* synthetic */ long b;
public final /* synthetic */ long c;
public b(String str, long j, long j2) {
this.a = str;
this.b = j;
this.c = j2;
}
@Override // java.lang.Runnable
public final void run() {
EventDispatcher.this.listener.onAudioDecoderInitialized(this.a, this.b, this.c);
}
}
public class c implements Runnable {
public final /* synthetic */ j a;
public c(j jVar) {
this.a = jVar;
}
@Override // java.lang.Runnable
public final void run() {
EventDispatcher.this.listener.onAudioInputFormatChanged(this.a);
}
}
public class d implements Runnable {
public final /* synthetic */ int a;
public final /* synthetic */ long b;
public final /* synthetic */ long c;
public d(int i, long j, long j2) {
this.a = i;
this.b = j;
this.c = j2;
}
@Override // java.lang.Runnable
public final void run() {
EventDispatcher.this.listener.onAudioTrackUnderrun(this.a, this.b, this.c);
}
}
public class e implements Runnable {
public final /* synthetic */ DecoderCounters a;
public e(DecoderCounters decoderCounters) {
this.a = decoderCounters;
}
@Override // java.lang.Runnable
public final void run() {
this.a.ensureUpdated();
EventDispatcher.this.listener.onAudioDisabled(this.a);
}
}
public class f implements Runnable {
public final /* synthetic */ int a;
public f(int i) {
this.a = i;
}
@Override // java.lang.Runnable
public final void run() {
EventDispatcher.this.listener.onAudioSessionId(this.a);
}
}
public EventDispatcher(Handler handler, AudioRendererEventListener audioRendererEventListener) {
this.handler = audioRendererEventListener != null ? (Handler) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(handler) : null;
this.listener = audioRendererEventListener;
}
public void audioSessionId(int i) {
if (this.listener != null) {
this.handler.post(new f(i));
}
}
public void audioTrackUnderrun(int i, long j, long j2) {
if (this.listener != null) {
this.handler.post(new d(i, j, j2));
}
}
public void decoderInitialized(String str, long j, long j2) {
if (this.listener != null) {
this.handler.post(new b(str, j, j2));
}
}
public void disabled(DecoderCounters decoderCounters) {
if (this.listener != null) {
this.handler.post(new e(decoderCounters));
}
}
public void enabled(DecoderCounters decoderCounters) {
if (this.listener != null) {
this.handler.post(new a(decoderCounters));
}
}
public void inputFormatChanged(j jVar) {
if (this.listener != null) {
this.handler.post(new c(jVar));
}
}
}
void onAudioDecoderInitialized(String str, long j, long j2);
void onAudioDisabled(DecoderCounters decoderCounters);
void onAudioEnabled(DecoderCounters decoderCounters);
void onAudioInputFormatChanged(j jVar);
void onAudioSessionId(int i);
void onAudioTrackUnderrun(int i, long j, long j2);
}

View File

@@ -0,0 +1,324 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import android.annotation.TargetApi;
import android.media.MediaCodec;
import android.media.MediaCrypto;
import android.media.MediaFormat;
import android.os.SystemClock;
import android.view.Surface;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.AudioRendererEventListener;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.c;
import com.fyber.inneractive.sdk.player.exoplayer2.decoder.DecoderCounters;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d;
import com.fyber.inneractive.sdk.player.exoplayer2.n;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import java.nio.ByteBuffer;
@TargetApi(16)
/* loaded from: classes2.dex */
public class MediaCodecAudioRenderer extends com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b implements com.fyber.inneractive.sdk.player.exoplayer2.util.g {
public final AudioRendererEventListener.EventDispatcher P;
public final c Q;
public boolean R;
public int S;
public int T;
public long U;
public boolean V;
public final class a implements c.f {
public a() {
}
public /* synthetic */ a(MediaCodecAudioRenderer mediaCodecAudioRenderer, int i) {
this();
}
}
public MediaCodecAudioRenderer() {
this(0);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a(com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.c cVar, j jVar) throws d.b {
String str = jVar.f;
this.Q.getClass();
return cVar.a(false, jVar.f);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final int b(com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.c cVar, j jVar) throws d.b {
int i;
int i2;
String str = jVar.f;
if (!com.fyber.inneractive.sdk.player.exoplayer2.util.h.c(str)) {
return 0;
}
int i3 = s.a;
int i4 = i3 >= 21 ? 16 : 0;
this.Q.getClass();
com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a2 = cVar.a(false, str);
if (a2 == null) {
return 1;
}
return ((i3 < 21 || (((i = jVar.s) == -1 || a2.b(i)) && ((i2 = jVar.r) == -1 || a2.a(i2)))) ? 3 : 2) | i4 | 4;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final boolean isReady() {
if (!this.Q.b()) {
if (this.n != null) {
if ((this.f ? this.g : this.d.isReady()) || this.D >= 0 || (this.B != C.TIME_UNSET && SystemClock.elapsedRealtime() < this.B)) {
}
}
return false;
}
return true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a, com.fyber.inneractive.sdk.player.exoplayer2.o
public final com.fyber.inneractive.sdk.player.exoplayer2.util.g j() {
return this;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.util.g
public final long m() {
long a2 = this.Q.a(a());
if (a2 != Long.MIN_VALUE) {
if (!this.V) {
a2 = Math.max(this.U, a2);
}
this.U = a2;
this.V = false;
}
return this.U;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a
public final void o() {
this.Q.d();
}
public MediaCodecAudioRenderer(int i) {
this(new b[0]);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.util.g
public final n i() {
return this.Q.s;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a
public final void n() {
try {
c cVar = this.Q;
cVar.e();
for (b bVar : cVar.c) {
bVar.reset();
}
cVar.Z = 0;
cVar.Y = false;
try {
this.n = null;
u();
} finally {
}
} catch (Throwable th) {
try {
this.n = null;
u();
throw th;
} finally {
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a
public final void p() {
c cVar = this.Q;
cVar.Y = false;
if (cVar.c()) {
cVar.z = 0L;
cVar.y = 0;
cVar.x = 0;
cVar.A = 0L;
cVar.B = false;
cVar.C = 0L;
cVar.g.d();
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final void v() throws com.fyber.inneractive.sdk.player.exoplayer2.d {
try {
c cVar = this.Q;
if (!cVar.X && cVar.c() && cVar.a()) {
cVar.g.a(cVar.o ? cVar.J : cVar.I / cVar.H);
cVar.w = 0;
cVar.X = true;
}
} catch (c.h e) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.d(e);
}
}
public MediaCodecAudioRenderer(b... bVarArr) {
super(1, true);
this.Q = new c(bVarArr, new a(this, 0));
this.P = new AudioRendererEventListener.EventDispatcher(null, null);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a aVar, MediaCodec mediaCodec, j jVar) {
boolean z;
String str = aVar.a;
if (s.a < 24 && "OMX.SEC.aac.dec".equals(str) && "samsung".equals(s.c)) {
String str2 = s.b;
if (str2.startsWith("zeroflte") || str2.startsWith("herolte") || str2.startsWith("heroqlte")) {
z = true;
this.R = z;
mediaCodec.configure(jVar.a(), (Surface) null, (MediaCrypto) null, 0);
}
}
z = false;
this.R = z;
mediaCodec.configure(jVar.a(), (Surface) null, (MediaCrypto) null, 0);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final void a(String str, long j, long j2) {
this.P.decoderInitialized(str, j, j2);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final void a(j jVar) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
super.a(jVar);
this.P.inputFormatChanged(jVar);
this.S = MimeTypes.AUDIO_RAW.equals(jVar.f) ? jVar.t : 2;
this.T = jVar.r;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final void a(MediaCodec mediaCodec, MediaFormat mediaFormat) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
int[] iArr;
int i;
int integer = mediaFormat.getInteger("channel-count");
int integer2 = mediaFormat.getInteger("sample-rate");
if (this.R && integer == 6 && (i = this.T) < 6) {
iArr = new int[i];
for (int i2 = 0; i2 < this.T; i2++) {
iArr[i2] = i2;
}
} else {
iArr = null;
}
try {
this.Q.a(integer, integer2, this.S, iArr);
} catch (c.d e) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.d(e);
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b, com.fyber.inneractive.sdk.player.exoplayer2.a
public final void a(boolean z, long j) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
super.a(z, j);
this.Q.e();
this.U = j;
this.V = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.util.g
public final n a(n nVar) {
return this.Q.a(nVar);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b
public final boolean a(long j, long j2, MediaCodec mediaCodec, ByteBuffer byteBuffer, int i, long j3, boolean z) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
if (z) {
mediaCodec.releaseOutputBuffer(i, false);
this.N.skippedOutputBufferCount++;
c cVar = this.Q;
if (cVar.L == 1) {
cVar.L = 2;
}
return true;
}
try {
if (!this.Q.a(byteBuffer, j3)) {
return false;
}
mediaCodec.releaseOutputBuffer(i, false);
this.N.renderedOutputBufferCount++;
return true;
} catch (c.e | c.h e) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.d(e);
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a
public final void a(boolean z) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
DecoderCounters decoderCounters = new DecoderCounters();
this.N = decoderCounters;
this.P.enabled(decoderCounters);
int i = this.b.a;
if (i != 0) {
c cVar = this.Q;
cVar.getClass();
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(s.a >= 21);
if (cVar.a0 && cVar.Z == i) {
return;
}
cVar.a0 = true;
cVar.Z = i;
cVar.e();
return;
}
c cVar2 = this.Q;
if (cVar2.a0) {
cVar2.a0 = false;
cVar2.Z = 0;
cVar2.e();
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.b
public final void a(int i, Object obj) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
if (i == 2) {
c cVar = this.Q;
float floatValue = ((Float) obj).floatValue();
if (cVar.P != floatValue) {
cVar.P = floatValue;
cVar.g();
return;
}
return;
}
if (i != 3) {
return;
}
int intValue = ((Integer) obj).intValue();
c cVar2 = this.Q;
if (cVar2.n == intValue) {
return;
}
cVar2.n = intValue;
if (cVar2.a0) {
return;
}
cVar2.e();
cVar2.Z = 0;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b, com.fyber.inneractive.sdk.player.exoplayer2.o
public final boolean a() {
if (this.L) {
c cVar = this.Q;
if (!cVar.c() || (cVar.X && !cVar.b())) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,36 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import com.vungle.ads.internal.protos.Sdk;
import org.apache.http.HttpStatus;
/* loaded from: classes2.dex */
public final class a {
public static final int[] a = {1, 2, 3, 6};
public static final int[] b = {48000, 44100, 32000};
public static final int[] c = {24000, 22050, 16000};
public static final int[] d = {2, 1, 2, 3, 3, 4, 4, 5};
public static final int[] e = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, PsExtractor.AUDIO_STREAM, 224, 256, Sdk.SDKError.Reason.WEBVIEW_ERROR_VALUE, 384, 448, 512, 576, 640};
public static final int[] f = {69, 87, 104, 121, 139, 174, 208, 243, 278, 348, HttpStatus.SC_EXPECTATION_FAILED, 487, 557, 696, 835, 975, 1114, 1253, 1393};
public static int a(int i, int i2) {
int i3 = i2 / 2;
if (i < 0) {
return -1;
}
int[] iArr = b;
if (i >= 3 || i2 < 0) {
return -1;
}
int[] iArr2 = f;
if (i3 >= 19) {
return -1;
}
int i4 = iArr[i];
if (i4 == 44100) {
return ((i2 % 2) + iArr2[i3]) * 2;
}
int i5 = e[i3];
return i4 == 32000 ? i5 * 6 : i5 * 4;
}
}

View File

@@ -0,0 +1,35 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/* loaded from: classes2.dex */
public interface b {
public static final ByteBuffer a = ByteBuffer.allocateDirect(0).order(ByteOrder.nativeOrder());
public static final class a extends Exception {
public a(int i, int i2, int i3) {
super("Unhandled format: " + i + " Hz, " + i2 + " channels in encoding " + i3);
}
}
void a(ByteBuffer byteBuffer);
boolean a();
boolean a(int i, int i2, int i3) throws a;
ByteBuffer b();
void c();
boolean d();
int e();
void f();
void flush();
void reset();
}

View File

@@ -0,0 +1,811 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import android.annotation.TargetApi;
import android.media.AudioAttributes;
import android.media.AudioFormat;
import android.media.AudioTimestamp;
import android.media.AudioTrack;
import android.os.ConditionVariable;
import android.os.SystemClock;
import android.support.v4.media.session.PlaybackStateCompat;
import android.util.Log;
import androidx.work.WorkRequest;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.MediaCodecAudioRenderer;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.b;
import com.fyber.inneractive.sdk.player.exoplayer2.i;
import com.fyber.inneractive.sdk.player.exoplayer2.n;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.ironsource.v8;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.LinkedList;
/* loaded from: classes2.dex */
public final class c {
public long A;
public boolean B;
public long C;
public Method D;
public int E;
public long F;
public long G;
public int H;
public long I;
public long J;
public int K;
public int L;
public long M;
public long N;
public long O;
public float P;
public com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] Q;
public ByteBuffer[] R;
public ByteBuffer S;
public ByteBuffer T;
public byte[] U;
public int V;
public int W;
public boolean X;
public boolean Y;
public int Z;
public final com.fyber.inneractive.sdk.player.exoplayer2.audio.d a;
public boolean a0;
public final com.fyber.inneractive.sdk.player.exoplayer2.audio.h b;
public boolean b0;
public final com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] c;
public long c0;
public final f d;
public final ConditionVariable e = new ConditionVariable(true);
public final long[] f;
public final b g;
public final LinkedList<g> h;
public AudioTrack i;
public int j;
public int k;
public int l;
public int m;
public int n;
public boolean o;
public int p;
public long q;
public n r;
public n s;
public long t;
public long u;
public ByteBuffer v;
public int w;
public int x;
public int y;
public long z;
public class a extends Thread {
public final /* synthetic */ AudioTrack a;
public a(AudioTrack audioTrack) {
this.a = audioTrack;
}
@Override // java.lang.Thread, java.lang.Runnable
public final void run() {
try {
this.a.flush();
this.a.release();
} finally {
c.this.e.open();
}
}
}
@TargetApi(19)
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.audio.c$c, reason: collision with other inner class name */
public static class C0083c extends b {
public final AudioTimestamp j;
public long k;
public long l;
public long m;
public C0083c() {
super(0);
this.j = new AudioTimestamp();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.c.b
public final void a(AudioTrack audioTrack, boolean z) {
super.a(audioTrack, z);
this.k = 0L;
this.l = 0L;
this.m = 0L;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.c.b
public final long b() {
return this.m;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.c.b
public final long c() {
return this.j.nanoTime;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.c.b
public final boolean e() {
boolean timestamp = this.a.getTimestamp(this.j);
if (timestamp) {
long j = this.j.framePosition;
if (this.l > j) {
this.k++;
}
this.l = j;
this.m = j + (this.k << 32);
}
return timestamp;
}
}
public static final class d extends Exception {
public d(b.a aVar) {
super(aVar);
}
public d(String str) {
super(str);
}
}
public static final class e extends Exception {
public e(int i, int i2, int i3, int i4) {
super("AudioTrack init failed: " + i + ", Config(" + i2 + ", " + i3 + ", " + i4 + ")");
}
}
public interface f {
}
public static final class g {
public final n a;
public final long b;
public final long c;
public g(n nVar, long j, long j2) {
this.a = nVar;
this.b = j;
this.c = j2;
}
}
public static final class h extends Exception {
public h(int i) {
super(i.a("AudioTrack write failed: ", i));
}
}
public c(com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] bVarArr, MediaCodecAudioRenderer.a aVar) {
this.d = aVar;
if (s.a >= 18) {
try {
this.D = AudioTrack.class.getMethod("getLatency", null);
} catch (NoSuchMethodException unused) {
}
}
int i = 0;
if (s.a >= 19) {
this.g = new C0083c();
} else {
this.g = new b(i);
}
com.fyber.inneractive.sdk.player.exoplayer2.audio.d dVar = new com.fyber.inneractive.sdk.player.exoplayer2.audio.d();
this.a = dVar;
com.fyber.inneractive.sdk.player.exoplayer2.audio.h hVar = new com.fyber.inneractive.sdk.player.exoplayer2.audio.h();
this.b = hVar;
com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] bVarArr2 = new com.fyber.inneractive.sdk.player.exoplayer2.audio.b[bVarArr.length + 3];
this.c = bVarArr2;
bVarArr2[0] = new com.fyber.inneractive.sdk.player.exoplayer2.audio.f();
bVarArr2[1] = dVar;
System.arraycopy(bVarArr, 0, bVarArr2, 2, bVarArr.length);
bVarArr2[bVarArr.length + 2] = hVar;
this.f = new long[10];
this.P = 1.0f;
this.L = 0;
this.n = 3;
this.Z = 0;
this.s = n.d;
this.W = -1;
this.Q = new com.fyber.inneractive.sdk.player.exoplayer2.audio.b[0];
this.R = new ByteBuffer[0];
this.h = new LinkedList<>();
}
/* JADX WARN: Removed duplicated region for block: B:46:0x00a3 */
/* JADX WARN: Removed duplicated region for block: B:59:0x00d1 */
/* JADX WARN: Removed duplicated region for block: B:62:0x00f5 */
/* JADX WARN: Removed duplicated region for block: B:65:0x00f7 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(int r9, int r10, int r11, int[] r12) throws com.fyber.inneractive.sdk.player.exoplayer2.audio.c.d {
/*
Method dump skipped, instructions count: 290
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.audio.c.a(int, int, int, int[]):void");
}
/* JADX WARN: Code restructure failed: missing block: B:46:0x00d2, code lost:
if (r10 < r9) goto L51;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void b(java.nio.ByteBuffer r8, long r9) throws com.fyber.inneractive.sdk.player.exoplayer2.audio.c.h {
/*
Method dump skipped, instructions count: 275
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.audio.c.b(java.nio.ByteBuffer, long):void");
}
public final boolean c() {
return this.i != null;
}
public final void e() {
if (c()) {
this.F = 0L;
this.G = 0L;
this.I = 0L;
this.J = 0L;
this.K = 0;
n nVar = this.r;
if (nVar != null) {
this.s = nVar;
this.r = null;
} else if (!this.h.isEmpty()) {
this.s = this.h.getLast().a;
}
this.h.clear();
this.t = 0L;
this.u = 0L;
this.S = null;
this.T = null;
int i = 0;
while (true) {
com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] bVarArr = this.Q;
if (i >= bVarArr.length) {
break;
}
com.fyber.inneractive.sdk.player.exoplayer2.audio.b bVar = bVarArr[i];
bVar.flush();
this.R[i] = bVar.b();
i++;
}
this.X = false;
this.W = -1;
this.v = null;
this.w = 0;
this.L = 0;
this.O = 0L;
this.z = 0L;
this.y = 0;
this.x = 0;
this.A = 0L;
this.B = false;
this.C = 0L;
if (this.i.getPlayState() == 3) {
this.i.pause();
}
AudioTrack audioTrack = this.i;
this.i = null;
this.g.a(null, false);
this.e.close();
new a(audioTrack).start();
}
}
public final void f() {
ArrayList arrayList = new ArrayList();
for (com.fyber.inneractive.sdk.player.exoplayer2.audio.b bVar : this.c) {
if (bVar.d()) {
arrayList.add(bVar);
} else {
bVar.flush();
}
}
int size = arrayList.size();
this.Q = (com.fyber.inneractive.sdk.player.exoplayer2.audio.b[]) arrayList.toArray(new com.fyber.inneractive.sdk.player.exoplayer2.audio.b[size]);
this.R = new ByteBuffer[size];
for (int i = 0; i < size; i++) {
com.fyber.inneractive.sdk.player.exoplayer2.audio.b bVar2 = this.Q[i];
bVar2.flush();
this.R[i] = bVar2.b();
}
}
public final void g() {
if (c()) {
if (s.a >= 21) {
this.i.setVolume(this.P);
return;
}
AudioTrack audioTrack = this.i;
float f2 = this.P;
audioTrack.setStereoVolume(f2, f2);
}
}
public final void d() {
this.Y = true;
if (c()) {
this.N = System.nanoTime() / 1000;
this.i.play();
}
}
public static class b {
public AudioTrack a;
public boolean b;
public int c;
public long d;
public long e;
public long f;
public long g;
public long h;
public long i;
public b() {
}
public /* synthetic */ b(int i) {
this();
}
public long b() {
throw new UnsupportedOperationException();
}
public long c() {
throw new UnsupportedOperationException();
}
public boolean e() {
return false;
}
public final void d() {
if (this.g != C.TIME_UNSET) {
return;
}
this.a.pause();
}
public void a(AudioTrack audioTrack, boolean z) {
this.a = audioTrack;
this.b = z;
this.g = C.TIME_UNSET;
this.d = 0L;
this.e = 0L;
this.f = 0L;
if (audioTrack != null) {
this.c = audioTrack.getSampleRate();
}
}
public final void a(long j) {
this.h = a();
this.g = SystemClock.elapsedRealtime() * 1000;
this.i = j;
this.a.stop();
}
public final long a() {
if (this.g != C.TIME_UNSET) {
return Math.min(this.i, this.h + ((((SystemClock.elapsedRealtime() * 1000) - this.g) * this.c) / 1000000));
}
int playState = this.a.getPlayState();
if (playState == 1) {
return 0L;
}
long playbackHeadPosition = this.a.getPlaybackHeadPosition() & 4294967295L;
if (this.b) {
if (playState == 2 && playbackHeadPosition == 0) {
this.f = this.d;
}
playbackHeadPosition += this.f;
}
if (this.d > playbackHeadPosition) {
this.e++;
}
this.d = playbackHeadPosition;
return playbackHeadPosition + (this.e << 32);
}
}
public final boolean b() {
int i;
if (c()) {
if ((this.o ? this.J : this.I / this.H) > this.g.a() || (s.a < 23 && (((i = this.m) == 5 || i == 6) && this.i.getPlayState() == 2 && this.i.getPlaybackHeadPosition() == 0))) {
return true;
}
}
return false;
}
/* JADX WARN: Finally extract failed */
public final boolean a(ByteBuffer byteBuffer, long j) throws e, h {
int i;
int i2;
int i3;
ByteBuffer byteBuffer2 = this.S;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(byteBuffer2 == null || byteBuffer == byteBuffer2);
if (!c()) {
this.e.block();
if (this.a0) {
this.i = new AudioTrack(new AudioAttributes.Builder().setUsage(1).setContentType(3).setFlags(16).build(), new AudioFormat.Builder().setChannelMask(this.k).setEncoding(this.m).setSampleRate(this.j).build(), this.p, 1, this.Z);
} else if (this.Z == 0) {
this.i = new AudioTrack(this.n, this.j, this.k, this.m, this.p, 1);
} else {
this.i = new AudioTrack(this.n, this.j, this.k, this.m, this.p, 1, this.Z);
}
int state = this.i.getState();
if (state == 1) {
int audioSessionId = this.i.getAudioSessionId();
if (this.Z != audioSessionId) {
this.Z = audioSessionId;
MediaCodecAudioRenderer.a aVar = (MediaCodecAudioRenderer.a) this.d;
MediaCodecAudioRenderer.this.P.audioSessionId(audioSessionId);
MediaCodecAudioRenderer.this.getClass();
}
this.g.a(this.i, s.a < 23 && ((i3 = this.m) == 5 || i3 == 6));
g();
this.b0 = false;
if (this.Y) {
d();
}
} else {
try {
this.i.release();
this.i = null;
} catch (Exception unused) {
this.i = null;
} catch (Throwable th) {
this.i = null;
throw th;
}
throw new e(state, this.j, this.k, this.p);
}
}
if (s.a < 23 && ((i2 = this.m) == 5 || i2 == 6)) {
if (this.i.getPlayState() == 2) {
this.b0 = false;
return false;
}
if (this.i.getPlayState() == 1 && this.g.a() != 0) {
return false;
}
}
boolean z = this.b0;
boolean b2 = b();
this.b0 = b2;
if (z && !b2 && this.i.getPlayState() != 1) {
long elapsedRealtime = SystemClock.elapsedRealtime() - this.c0;
MediaCodecAudioRenderer.a aVar2 = (MediaCodecAudioRenderer.a) this.d;
MediaCodecAudioRenderer.this.P.audioTrackUnderrun(this.p, com.fyber.inneractive.sdk.player.exoplayer2.b.a(this.q), elapsedRealtime);
MediaCodecAudioRenderer.this.getClass();
}
if (this.S == null) {
if (!byteBuffer.hasRemaining()) {
return true;
}
if (this.o && this.K == 0) {
int i4 = this.m;
if (i4 == 7 || i4 == 8) {
int position = byteBuffer.position();
i = ((((byteBuffer.get(position + 5) & 252) >> 2) | ((byteBuffer.get(position + 4) & 1) << 6)) + 1) * 32;
} else if (i4 == 5) {
i = 1536;
} else if (i4 == 6) {
i = (((byteBuffer.get(byteBuffer.position() + 4) & 192) >> 6) != 3 ? com.fyber.inneractive.sdk.player.exoplayer2.audio.a.a[(byteBuffer.get(byteBuffer.position() + 4) & 48) >> 4] : 6) * 256;
} else {
throw new IllegalStateException(i.a("Unexpected audio encoding: ", i4));
}
this.K = i;
}
if (this.r != null) {
if (!a()) {
return false;
}
this.h.add(new g(this.r, Math.max(0L, j), ((this.o ? this.J : this.I / this.H) * 1000000) / this.j));
this.r = null;
f();
}
int i5 = this.L;
if (i5 == 0) {
this.M = Math.max(0L, j);
this.L = 1;
} else {
long j2 = (((this.o ? this.G : this.F / this.E) * 1000000) / this.j) + this.M;
if (i5 == 1 && Math.abs(j2 - j) > 200000) {
Log.e("AudioTrack", "Discontinuity detected [expected " + j2 + ", got " + j + v8.i.e);
this.L = 2;
}
if (this.L == 2) {
this.M = (j - j2) + this.M;
this.L = 1;
MediaCodecAudioRenderer.a aVar3 = (MediaCodecAudioRenderer.a) this.d;
MediaCodecAudioRenderer.this.getClass();
MediaCodecAudioRenderer.this.V = true;
}
}
if (this.o) {
this.G += this.K;
} else {
this.F += byteBuffer.remaining();
}
this.S = byteBuffer;
}
if (this.o) {
b(this.S, j);
} else {
a(j);
}
if (this.S.hasRemaining()) {
return false;
}
this.S = null;
return true;
}
public final void a(long j) throws h {
ByteBuffer byteBuffer;
int length = this.Q.length;
int i = length;
while (i >= 0) {
if (i > 0) {
byteBuffer = this.R[i - 1];
} else {
byteBuffer = this.S;
if (byteBuffer == null) {
byteBuffer = com.fyber.inneractive.sdk.player.exoplayer2.audio.b.a;
}
}
if (i == length) {
b(byteBuffer, j);
} else {
com.fyber.inneractive.sdk.player.exoplayer2.audio.b bVar = this.Q[i];
bVar.a(byteBuffer);
ByteBuffer b2 = bVar.b();
this.R[i] = b2;
if (b2.hasRemaining()) {
i++;
}
}
if (byteBuffer.hasRemaining()) {
return;
} else {
i--;
}
}
}
/* JADX WARN: Removed duplicated region for block: B:10:0x0021 */
/* JADX WARN: Removed duplicated region for block: B:18:0x0038 */
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:17:0x0032 -> B:7:0x0012). Please report as a decompilation issue!!! */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final boolean a() throws com.fyber.inneractive.sdk.player.exoplayer2.audio.c.h {
/*
r9 = this;
int r0 = r9.W
r1 = 1
r2 = 0
r3 = -1
if (r0 != r3) goto L14
boolean r0 = r9.o
if (r0 == 0) goto Lf
com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] r0 = r9.Q
int r0 = r0.length
goto L10
Lf:
r0 = r2
L10:
r9.W = r0
L12:
r0 = r1
goto L15
L14:
r0 = r2
L15:
int r4 = r9.W
com.fyber.inneractive.sdk.player.exoplayer2.audio.b[] r5 = r9.Q
int r6 = r5.length
r7 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
if (r4 >= r6) goto L38
r4 = r5[r4]
if (r0 == 0) goto L28
r4.c()
L28:
r9.a(r7)
boolean r0 = r4.a()
if (r0 != 0) goto L32
return r2
L32:
int r0 = r9.W
int r0 = r0 + r1
r9.W = r0
goto L12
L38:
java.nio.ByteBuffer r0 = r9.T
if (r0 == 0) goto L44
r9.b(r0, r7)
java.nio.ByteBuffer r0 = r9.T
if (r0 == 0) goto L44
return r2
L44:
r9.W = r3
return r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.audio.c.a():boolean");
}
public final n a(n nVar) {
if (this.o) {
n nVar2 = n.d;
this.s = nVar2;
return nVar2;
}
com.fyber.inneractive.sdk.player.exoplayer2.audio.h hVar = this.b;
float f2 = nVar.a;
hVar.getClass();
int i = s.a;
float max = Math.max(0.1f, Math.min(f2, 8.0f));
hVar.e = max;
com.fyber.inneractive.sdk.player.exoplayer2.audio.h hVar2 = this.b;
float f3 = nVar.b;
hVar2.getClass();
hVar2.f = Math.max(0.1f, Math.min(f3, 8.0f));
n nVar3 = new n(max, f3);
n nVar4 = this.r;
if (nVar4 == null) {
nVar4 = !this.h.isEmpty() ? this.h.getLast().a : this.s;
}
if (!nVar3.equals(nVar4)) {
if (c()) {
this.r = nVar3;
} else {
this.s = nVar3;
}
}
return this.s;
}
public final long a(boolean z) {
long j;
long j2;
int i;
if (!c() || this.L == 0) {
return Long.MIN_VALUE;
}
if (this.i.getPlayState() == 3) {
long a2 = (this.g.a() * 1000000) / r1.c;
if (a2 != 0) {
long nanoTime = System.nanoTime() / 1000;
if (nanoTime - this.A >= WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS) {
long[] jArr = this.f;
int i2 = this.x;
jArr[i2] = a2 - nanoTime;
this.x = (i2 + 1) % 10;
int i3 = this.y;
if (i3 < 10) {
this.y = i3 + 1;
}
this.A = nanoTime;
this.z = 0L;
int i4 = 0;
while (true) {
int i5 = this.y;
if (i4 >= i5) {
break;
}
this.z = (this.f[i4] / i5) + this.z;
i4++;
}
}
if ((s.a >= 23 || ((i = this.m) != 5 && i != 6)) && nanoTime - this.C >= 500000) {
boolean e2 = this.g.e();
this.B = e2;
if (e2) {
long c = this.g.c() / 1000;
long b2 = this.g.b();
if (c < this.N) {
this.B = false;
} else if (Math.abs(c - nanoTime) > 5000000) {
StringBuilder sb = new StringBuilder("Spurious audio timestamp (system clock mismatch): ");
sb.append(b2);
sb.append(", ");
sb.append(c);
sb.append(", ");
sb.append(nanoTime);
sb.append(", ");
sb.append(a2);
sb.append(", ");
sb.append(this.o ? this.G : this.F / this.E);
sb.append(", ");
sb.append(this.o ? this.J : this.I / this.H);
Log.w("AudioTrack", sb.toString());
this.B = false;
} else if (Math.abs(((b2 * 1000000) / this.j) - a2) > 5000000) {
StringBuilder sb2 = new StringBuilder("Spurious audio timestamp (frame position mismatch): ");
sb2.append(b2);
sb2.append(", ");
sb2.append(c);
sb2.append(", ");
sb2.append(nanoTime);
sb2.append(", ");
sb2.append(a2);
sb2.append(", ");
sb2.append(this.o ? this.G : this.F / this.E);
sb2.append(", ");
sb2.append(this.o ? this.J : this.I / this.H);
Log.w("AudioTrack", sb2.toString());
this.B = false;
}
}
if (this.D != null && !this.o) {
try {
long intValue = (((Integer) r1.invoke(this.i, null)).intValue() * 1000) - this.q;
this.O = intValue;
long max = Math.max(intValue, 0L);
this.O = max;
if (max > 5000000) {
Log.w("AudioTrack", "Ignoring impossibly large audio latency: " + this.O);
this.O = 0L;
}
} catch (Exception unused) {
this.D = null;
}
}
this.C = nanoTime;
}
}
}
long nanoTime2 = System.nanoTime() / 1000;
if (this.B) {
j = ((this.g.b() + (((nanoTime2 - (this.g.c() / 1000)) * this.j) / 1000000)) * 1000000) / this.j;
} else {
if (this.y == 0) {
j = (this.g.a() * 1000000) / r1.c;
} else {
j = nanoTime2 + this.z;
}
if (!z) {
j -= this.O;
}
}
long j3 = this.M;
while (!this.h.isEmpty() && j >= this.h.getFirst().c) {
g remove = this.h.remove();
this.s = remove.a;
this.u = remove.c;
this.t = remove.b - this.M;
}
if (this.s.a == 1.0f) {
j2 = (j + this.t) - this.u;
} else {
if (this.h.isEmpty()) {
com.fyber.inneractive.sdk.player.exoplayer2.audio.h hVar = this.b;
long j4 = hVar.k;
if (j4 >= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) {
j2 = this.t + s.a(j - this.u, hVar.j, j4);
}
}
j2 = ((long) (this.s.a * (j - this.u))) + this.t;
}
return j3 + j2;
}
}

View File

@@ -0,0 +1,128 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.b;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
/* loaded from: classes2.dex */
public final class d implements b {
public int b;
public int c;
public int[] d;
public boolean e;
public int[] f;
public ByteBuffer g;
public ByteBuffer h;
public boolean i;
public d() {
ByteBuffer byteBuffer = b.a;
this.g = byteBuffer;
this.h = byteBuffer;
this.b = -1;
this.c = -1;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a() {
return this.i && this.h == b.a;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a(int i, int i2, int i3) throws b.a {
boolean z = !Arrays.equals(this.d, this.f);
int[] iArr = this.d;
this.f = iArr;
if (iArr == null) {
this.e = false;
return z;
}
if (i3 != 2) {
throw new b.a(i, i2, i3);
}
if (!z && this.c == i && this.b == i2) {
return false;
}
this.c = i;
this.b = i2;
this.e = i2 != iArr.length;
int i4 = 0;
while (true) {
int[] iArr2 = this.f;
if (i4 >= iArr2.length) {
return true;
}
int i5 = iArr2[i4];
if (i5 >= i2) {
throw new b.a(i, i2, i3);
}
this.e = (i5 != i4) | this.e;
i4++;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final ByteBuffer b() {
ByteBuffer byteBuffer = this.h;
this.h = b.a;
return byteBuffer;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void c() {
this.i = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean d() {
return this.e;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final int e() {
int[] iArr = this.f;
return iArr == null ? this.b : iArr.length;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void f() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void flush() {
this.h = b.a;
this.i = false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void reset() {
flush();
this.g = b.a;
this.b = -1;
this.c = -1;
this.f = null;
this.e = false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void a(ByteBuffer byteBuffer) {
int position = byteBuffer.position();
int limit = byteBuffer.limit();
int length = ((limit - position) / (this.b * 2)) * this.f.length * 2;
if (this.g.capacity() < length) {
this.g = ByteBuffer.allocateDirect(length).order(ByteOrder.nativeOrder());
} else {
this.g.clear();
}
while (position < limit) {
for (int i : this.f) {
this.g.putShort(byteBuffer.getShort((i * 2) + position));
}
position += this.b * 2;
}
byteBuffer.position(limit);
this.g.flip();
this.h = this.g;
}
}

View File

@@ -0,0 +1,12 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import csdk.gluads.Consts;
/* loaded from: classes2.dex */
public final class e {
public static final int[] a = {1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8};
public static final int[] b = {-1, 8000, 16000, 32000, -1, -1, 11025, 22050, 44100, -1, -1, 12000, 24000, 48000, -1, -1};
public static final int[] c = {64, 112, 128, PsExtractor.AUDIO_STREAM, 224, 256, 384, 448, 512, 640, 768, 896, 1024, 1152, 1280, 1536, 1920, 2048, IronSourceConstants.IS_AD_UNIT_CAPPED, 2560, 2688, 2816, 2823, 2944, 3072, 3840, 4096, Consts.GEMS_CUSTOM_DATA_LIMIT, 7680};
}

View File

@@ -0,0 +1,190 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.b;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
public final class f implements b {
public int b = -1;
public int c = -1;
public int d = 0;
public ByteBuffer e;
public ByteBuffer f;
public boolean g;
public f() {
ByteBuffer byteBuffer = b.a;
this.e = byteBuffer;
this.f = byteBuffer;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a() {
return this.g && this.f == b.a;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a(int i, int i2, int i3) throws b.a {
if (i3 != 3 && i3 != 2 && i3 != Integer.MIN_VALUE && i3 != 1073741824) {
throw new b.a(i, i2, i3);
}
if (this.b == i && this.c == i2 && this.d == i3) {
return false;
}
this.b = i;
this.c = i2;
this.d = i3;
if (i3 != 2) {
return true;
}
this.e = b.a;
return true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final ByteBuffer b() {
ByteBuffer byteBuffer = this.f;
this.f = b.a;
return byteBuffer;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void c() {
this.g = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean d() {
int i = this.d;
return (i == 0 || i == 2) ? false : true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final int e() {
return this.c;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void f() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void flush() {
this.f = b.a;
this.g = false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void reset() {
flush();
this.e = b.a;
this.b = -1;
this.c = -1;
this.d = 0;
}
/* JADX WARN: Removed duplicated region for block: B:11:0x0045 */
/* JADX WARN: Removed duplicated region for block: B:24:0x0083 A[ADDED_TO_REGION, LOOP:2: B:24:0x0083->B:25:0x0085, LOOP_START, PHI: r0
0x0083: PHI (r0v1 int) = (r0v0 int), (r0v2 int) binds: [B:10:0x0043, B:25:0x0085] A[DONT_GENERATE, DONT_INLINE]] */
/* JADX WARN: Removed duplicated region for block: B:27:0x003c */
/* JADX WARN: Removed duplicated region for block: B:8:0x002d */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(java.nio.ByteBuffer r8) {
/*
r7 = this;
int r0 = r8.position()
int r1 = r8.limit()
int r2 = r1 - r0
int r3 = r7.d
r4 = 1073741824(0x40000000, float:2.0)
r5 = 3
r6 = -2147483648(0xffffffff80000000, float:-0.0)
if (r3 == r6) goto L23
if (r3 == r5) goto L20
if (r3 != r4) goto L1a
int r2 = r2 / 2
goto L25
L1a:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
r8.<init>()
throw r8
L20:
int r2 = r2 * 2
goto L25
L23:
int r2 = r2 / r5
goto L20
L25:
java.nio.ByteBuffer r3 = r7.e
int r3 = r3.capacity()
if (r3 >= r2) goto L3c
java.nio.ByteBuffer r2 = java.nio.ByteBuffer.allocateDirect(r2)
java.nio.ByteOrder r3 = java.nio.ByteOrder.nativeOrder()
java.nio.ByteBuffer r2 = r2.order(r3)
r7.e = r2
goto L41
L3c:
java.nio.ByteBuffer r2 = r7.e
r2.clear()
L41:
int r2 = r7.d
if (r2 == r6) goto L83
if (r2 == r5) goto L6a
if (r2 != r4) goto L64
L49:
if (r0 >= r1) goto L9e
java.nio.ByteBuffer r2 = r7.e
int r3 = r0 + 2
byte r3 = r8.get(r3)
r2.put(r3)
java.nio.ByteBuffer r2 = r7.e
int r3 = r0 + 3
byte r3 = r8.get(r3)
r2.put(r3)
int r0 = r0 + 4
goto L49
L64:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
r8.<init>()
throw r8
L6a:
if (r0 >= r1) goto L9e
java.nio.ByteBuffer r2 = r7.e
r3 = 0
r2.put(r3)
java.nio.ByteBuffer r2 = r7.e
byte r3 = r8.get(r0)
r3 = r3 & 255(0xff, float:3.57E-43)
int r3 = r3 + (-128)
byte r3 = (byte) r3
r2.put(r3)
int r0 = r0 + 1
goto L6a
L83:
if (r0 >= r1) goto L9e
java.nio.ByteBuffer r2 = r7.e
int r3 = r0 + 1
byte r3 = r8.get(r3)
r2.put(r3)
java.nio.ByteBuffer r2 = r7.e
int r3 = r0 + 2
byte r3 = r8.get(r3)
r2.put(r3)
int r0 = r0 + 3
goto L83
L9e:
int r0 = r8.limit()
r8.position(r0)
java.nio.ByteBuffer r8 = r7.e
r8.flip()
java.nio.ByteBuffer r8 = r7.e
r7.f = r8
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.audio.f.a(java.nio.ByteBuffer):void");
}
}

View File

@@ -0,0 +1,373 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import java.util.Arrays;
/* loaded from: classes2.dex */
public final class g {
public final int a;
public final int b;
public final int c;
public final int d;
public final int e;
public final short[] f;
public int g;
public short[] h;
public int i;
public short[] j;
public int k;
public short[] l;
public int q;
public int r;
public int s;
public int t;
public int v;
public int w;
public int x;
public int m = 0;
public int n = 0;
public int u = 0;
public float o = 1.0f;
public float p = 1.0f;
public g(int i, int i2) {
this.a = i;
this.b = i2;
this.c = i / 400;
int i3 = i / 65;
this.d = i3;
int i4 = i3 * 2;
this.e = i4;
this.f = new short[i4];
this.g = i4;
int i5 = i2 * i4;
this.h = new short[i5];
this.i = i4;
this.j = new short[i5];
this.k = i4;
this.l = new short[i5];
}
public final void a(int i) {
int i2 = this.q + i;
int i3 = this.g;
if (i2 > i3) {
int i4 = (i3 / 2) + i + i3;
this.g = i4;
this.h = Arrays.copyOf(this.h, i4 * this.b);
}
}
public final void b(int i) {
int i2 = this.r + i;
int i3 = this.i;
if (i2 > i3) {
int i4 = (i3 / 2) + i + i3;
this.i = i4;
this.j = Arrays.copyOf(this.j, i4 * this.b);
}
}
public final int a(short[] sArr, int i, int i2, int i3) {
int i4 = i * this.b;
int i5 = 255;
int i6 = 1;
int i7 = 0;
int i8 = 0;
while (i2 <= i3) {
int i9 = 0;
for (int i10 = 0; i10 < i2; i10++) {
short s = sArr[i4 + i10];
short s2 = sArr[i4 + i2 + i10];
i9 += s >= s2 ? s - s2 : s2 - s;
}
if (i9 * i7 < i6 * i2) {
i7 = i2;
i6 = i9;
}
if (i9 * i5 > i8 * i2) {
i5 = i2;
i8 = i9;
}
i2++;
}
this.w = i6 / i7;
this.x = i8 / i5;
return i7;
}
public final void a() {
int i;
int i2;
double d;
int i3;
float f;
int i4;
int i5;
int i6;
int i7;
int i8;
int i9 = this.r;
float f2 = this.o / this.p;
double d2 = f2;
int i10 = 1;
int i11 = 0;
if (d2 > 1.00001d || d2 < 0.99999d) {
int i12 = this.q;
if (i12 >= this.e) {
int i13 = 0;
while (true) {
int i14 = this.t;
if (i14 > 0) {
int min = Math.min(this.e, i14);
short[] sArr = this.h;
b(min);
int i15 = this.b;
System.arraycopy(sArr, i13 * i15, this.j, this.r * i15, i15 * min);
this.r += min;
this.t -= min;
i13 += min;
f = f2;
d = d2;
} else {
short[] sArr2 = this.h;
int i16 = this.a;
int i17 = i16 > 4000 ? i16 / 4000 : i10;
int i18 = this.b;
if (i18 == i10 && i17 == i10) {
i = a(sArr2, i13, this.c, this.d);
} else {
int i19 = this.e / i17;
int i20 = i18 * i17;
int i21 = i18 * i13;
for (int i22 = i11; i22 < i19; i22++) {
int i23 = i11;
int i24 = i23;
while (i23 < i20) {
i24 += sArr2[(i22 * i20) + i21 + i23];
i23++;
}
this.f[i22] = (short) (i24 / i20);
}
int a = a(this.f, i11, this.c / i17, this.d / i17);
if (i17 != 1) {
int i25 = a * i17;
int i26 = i17 * 4;
int i27 = i25 - i26;
int i28 = i25 + i26;
int i29 = this.c;
if (i27 < i29) {
i27 = i29;
}
int i30 = this.d;
if (i28 > i30) {
i28 = i30;
}
int i31 = this.b;
if (i31 == 1) {
i = a(sArr2, i13, i27, i28);
} else {
int i32 = this.e;
int i33 = i13 * i31;
int i34 = i11;
while (i34 < i32) {
int i35 = i11;
int i36 = i35;
while (i35 < i31) {
i36 += sArr2[(i34 * i31) + i33 + i35];
i35++;
}
this.f[i34] = (short) (i36 / i31);
i34++;
i11 = 0;
}
a = a(this.f, 0, i27, i28);
}
}
i = a;
}
int i37 = this.w;
int i38 = this.x;
if (i37 == 0 || (i2 = this.u) == 0 || i38 > i37 * 3 || i37 * 2 <= this.v * 3) {
i2 = i;
}
this.v = i37;
this.u = i;
if (d2 > 1.0d) {
short[] sArr3 = this.h;
if (f2 >= 2.0f) {
i4 = (int) (i2 / (f2 - 1.0f));
} else {
this.t = (int) (((2.0f - f2) * i2) / (f2 - 1.0f));
i4 = i2;
}
b(i4);
int i39 = this.b;
short[] sArr4 = this.j;
int i40 = this.r;
int i41 = i13 + i2;
int i42 = 0;
while (i42 < i39) {
int i43 = (i40 * i39) + i42;
int i44 = (i13 * i39) + i42;
double d3 = d2;
int i45 = (i41 * i39) + i42;
int i46 = 0;
while (i46 < i4) {
sArr4[i43] = (short) (((sArr3[i45] * i46) + ((i4 - i46) * sArr3[i44])) / i4);
i43 += i39;
i44 += i39;
i45 += i39;
i46++;
sArr3 = sArr3;
}
i42++;
d2 = d3;
}
d = d2;
this.r += i4;
f = f2;
i13 = i2 + i4 + i13;
} else {
d = d2;
short[] sArr5 = this.h;
if (f2 < 0.5f) {
i3 = (int) ((i2 * f2) / (1.0f - f2));
} else {
this.t = (int) ((((2.0f * f2) - 1.0f) * i2) / (1.0f - f2));
i3 = i2;
}
int i47 = i2 + i3;
b(i47);
int i48 = this.b;
System.arraycopy(sArr5, i13 * i48, this.j, this.r * i48, i48 * i2);
int i49 = this.b;
short[] sArr6 = this.j;
int i50 = this.r + i2;
int i51 = i2 + i13;
int i52 = 0;
while (i52 < i49) {
int i53 = (i50 * i49) + i52;
int i54 = (i13 * i49) + i52;
int i55 = (i51 * i49) + i52;
float f3 = f2;
int i56 = 0;
while (i56 < i3) {
sArr6[i53] = (short) (((sArr5[i54] * i56) + ((i3 - i56) * sArr5[i55])) / i3);
i53 += i49;
i55 += i49;
i54 += i49;
i56++;
sArr5 = sArr5;
}
i52++;
f2 = f3;
}
f = f2;
this.r += i47;
i13 += i3;
}
}
if (this.e + i13 > i12) {
break;
}
d2 = d;
f2 = f;
i10 = 1;
i11 = 0;
}
int i57 = this.q - i13;
short[] sArr7 = this.h;
int i58 = this.b;
System.arraycopy(sArr7, i13 * i58, sArr7, 0, i58 * i57);
this.q = i57;
}
} else {
short[] sArr8 = this.h;
int i59 = this.q;
b(i59);
int i60 = this.b;
System.arraycopy(sArr8, 0, this.j, this.r * i60, i60 * i59);
this.r += i59;
this.q = 0;
}
float f4 = this.p;
if (f4 == 1.0f || this.r == i9) {
return;
}
int i61 = this.a;
int i62 = (int) (i61 / f4);
while (true) {
if (i62 <= 16384 && i61 <= 16384) {
break;
}
i62 /= 2;
i61 /= 2;
}
int i63 = this.r - i9;
int i64 = this.s + i63;
int i65 = this.k;
if (i64 > i65) {
int i66 = (i65 / 2) + i63 + i65;
this.k = i66;
this.l = Arrays.copyOf(this.l, i66 * this.b);
}
short[] sArr9 = this.j;
int i67 = this.b;
System.arraycopy(sArr9, i9 * i67, this.l, this.s * i67, i67 * i63);
this.r = i9;
this.s += i63;
int i68 = 0;
while (true) {
i5 = this.s;
i6 = i5 - 1;
if (i68 >= i6) {
break;
}
while (true) {
i7 = this.m + 1;
int i69 = i7 * i62;
i8 = this.n;
if (i69 <= i8 * i61) {
break;
}
b(1);
int i70 = 0;
while (true) {
int i71 = this.b;
if (i70 < i71) {
short[] sArr10 = this.j;
int i72 = (this.r * i71) + i70;
short[] sArr11 = this.l;
int i73 = (i68 * i71) + i70;
short s = sArr11[i73];
short s2 = sArr11[i73 + i71];
int i74 = this.n * i61;
int i75 = this.m;
int i76 = i75 * i62;
int i77 = (i75 + 1) * i62;
int i78 = i77 - i74;
int i79 = i77 - i76;
sArr10[i72] = (short) ((((i79 - i78) * s2) + (s * i78)) / i79);
i70++;
}
}
this.n++;
this.r++;
}
this.m = i7;
if (i7 == i61) {
this.m = 0;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(i8 == i62);
this.n = 0;
}
i68++;
}
if (i6 == 0) {
return;
}
short[] sArr12 = this.l;
int i80 = this.b;
System.arraycopy(sArr12, i6 * i80, sArr12, 0, (i5 - i6) * i80);
this.s -= i6;
}
}

View File

@@ -0,0 +1,167 @@
package com.fyber.inneractive.sdk.player.exoplayer2.audio;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.b;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.ShortBuffer;
/* loaded from: classes2.dex */
public final class h implements b {
public g d;
public ByteBuffer g;
public ShortBuffer h;
public ByteBuffer i;
public long j;
public long k;
public boolean l;
public float e = 1.0f;
public float f = 1.0f;
public int b = -1;
public int c = -1;
public h() {
ByteBuffer byteBuffer = b.a;
this.g = byteBuffer;
this.h = byteBuffer.asShortBuffer();
this.i = byteBuffer;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final ByteBuffer b() {
ByteBuffer byteBuffer = this.i;
this.i = b.a;
return byteBuffer;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean d() {
return Math.abs(this.e - 1.0f) >= 0.01f || Math.abs(this.f - 1.0f) >= 0.01f;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final int e() {
return this.b;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void f() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void flush() {
g gVar = new g(this.c, this.b);
this.d = gVar;
gVar.o = this.e;
gVar.p = this.f;
this.i = b.a;
this.j = 0L;
this.k = 0L;
this.l = false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void c() {
int i;
g gVar = this.d;
int i2 = gVar.q;
float f = gVar.o;
float f2 = gVar.p;
int i3 = gVar.r + ((int) ((((i2 / (f / f2)) + gVar.s) / f2) + 0.5f));
gVar.a((gVar.e * 2) + i2);
int i4 = 0;
while (true) {
i = gVar.e * 2;
int i5 = gVar.b;
if (i4 >= i * i5) {
break;
}
gVar.h[(i5 * i2) + i4] = 0;
i4++;
}
gVar.q = i + gVar.q;
gVar.a();
if (gVar.r > i3) {
gVar.r = i3;
}
gVar.q = 0;
gVar.t = 0;
gVar.s = 0;
this.l = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void reset() {
this.d = null;
ByteBuffer byteBuffer = b.a;
this.g = byteBuffer;
this.h = byteBuffer.asShortBuffer();
this.i = byteBuffer;
this.b = -1;
this.c = -1;
this.j = 0L;
this.k = 0L;
this.l = false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a(int i, int i2, int i3) throws b.a {
if (i3 != 2) {
throw new b.a(i, i2, i3);
}
if (this.c == i && this.b == i2) {
return false;
}
this.c = i;
this.b = i2;
return true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final void a(ByteBuffer byteBuffer) {
if (byteBuffer.hasRemaining()) {
ShortBuffer asShortBuffer = byteBuffer.asShortBuffer();
int remaining = byteBuffer.remaining();
this.j += remaining;
g gVar = this.d;
gVar.getClass();
int remaining2 = asShortBuffer.remaining();
int i = gVar.b;
int i2 = remaining2 / i;
gVar.a(i2);
asShortBuffer.get(gVar.h, gVar.q * gVar.b, ((i * i2) * 2) / 2);
gVar.q += i2;
gVar.a();
byteBuffer.position(byteBuffer.position() + remaining);
}
int i3 = this.d.r * this.b * 2;
if (i3 > 0) {
if (this.g.capacity() < i3) {
ByteBuffer order = ByteBuffer.allocateDirect(i3).order(ByteOrder.nativeOrder());
this.g = order;
this.h = order.asShortBuffer();
} else {
this.g.clear();
this.h.clear();
}
g gVar2 = this.d;
ShortBuffer shortBuffer = this.h;
gVar2.getClass();
int min = Math.min(shortBuffer.remaining() / gVar2.b, gVar2.r);
shortBuffer.put(gVar2.j, 0, gVar2.b * min);
int i4 = gVar2.r - min;
gVar2.r = i4;
short[] sArr = gVar2.j;
int i5 = gVar2.b;
System.arraycopy(sArr, min * i5, sArr, 0, i4 * i5);
this.k += i3;
this.g.limit(i3);
this.i = this.g;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.audio.b
public final boolean a() {
g gVar;
return this.l && ((gVar = this.d) == null || gVar.r == 0);
}
}