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,37 @@
package com.fyber.inneractive.sdk.player;
import android.app.Application;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
import com.fyber.inneractive.sdk.config.f0;
import com.fyber.inneractive.sdk.config.global.features.l;
import com.fyber.inneractive.sdk.flow.g0;
import com.fyber.inneractive.sdk.util.o;
/* loaded from: classes2.dex */
public final class a {
public final g0 a;
public e b;
/* renamed from: com.fyber.inneractive.sdk.player.a$a, reason: collision with other inner class name */
public interface InterfaceC0079a {
}
public a(g0 g0Var) {
this.a = g0Var;
}
public final InterfaceC0079a a() throws Throwable {
com.fyber.inneractive.sdk.config.g0 g0Var;
UnitDisplayType unitDisplayType;
if (this.b == null) {
Application application = o.a;
g0 g0Var2 = this.a;
com.fyber.inneractive.sdk.response.g gVar = (com.fyber.inneractive.sdk.response.g) g0Var2.b;
f0 f0Var = g0Var2.d;
this.b = new e(application, gVar, f0Var, g0Var2.a, g0Var2, (f0Var == null || !((l) g0Var2.c.a(l.class)).d() || (g0Var = ((e0) this.a.d).f) == null || !((unitDisplayType = g0Var.j) == UnitDisplayType.INTERSTITIAL || unitDisplayType == UnitDisplayType.REWARDED)) ? null : IAConfigManager.L.I);
}
return this.b;
}
}

View File

@@ -0,0 +1,12 @@
package com.fyber.inneractive.sdk.player;
import com.fyber.inneractive.sdk.util.r;
/* loaded from: classes2.dex */
public final class b implements r.a {
public final /* synthetic */ c a;
public b(e eVar) {
this.a = eVar;
}
}

View File

@@ -0,0 +1,196 @@
package com.fyber.inneractive.sdk.player;
import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.view.View;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.Skip;
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
import com.fyber.inneractive.sdk.config.f0;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.external.InneractiveAdManager;
import com.fyber.inneractive.sdk.external.InneractiveAdRequest;
import com.fyber.inneractive.sdk.external.InneractiveVideoError;
import com.fyber.inneractive.sdk.flow.g0;
import com.fyber.inneractive.sdk.model.vast.q;
import com.fyber.inneractive.sdk.model.vast.v;
import com.fyber.inneractive.sdk.network.s;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.r;
import com.ironsource.gi;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public abstract class c implements i.e, i.d {
public final Context a;
public i b;
public String c;
public final s d;
public g0 e;
public InneractiveAdRequest f;
public com.fyber.inneractive.sdk.measurement.a g;
public com.fyber.inneractive.sdk.measurement.d h;
public Bitmap k;
public r l;
public r.a m;
public g r;
public int s;
public q t;
public f i = null;
public boolean j = true;
public boolean n = false;
public volatile boolean o = false;
public boolean p = false;
public int q = 0;
public final a u = new a((e) this);
public class a implements i.c {
public final /* synthetic */ c a;
public a(e eVar) {
this.a = eVar;
}
}
public static /* synthetic */ class b {
public static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.fyber.inneractive.sdk.player.enums.b.values().length];
a = iArr;
try {
iArr[com.fyber.inneractive.sdk.player.enums.b.Prepared.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Buffering.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Playing.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Paused.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Completed.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
/* renamed from: com.fyber.inneractive.sdk.player.c$c, reason: collision with other inner class name */
public interface InterfaceC0080c {
void a();
}
public class d extends Exception {
}
public c(Application application, s sVar) {
this.a = application;
this.d = sVar;
a();
}
public abstract void a(InneractiveVideoError inneractiveVideoError, JSONObject jSONObject);
public abstract void a(com.fyber.inneractive.sdk.response.i iVar, VideoClickOrigin videoClickOrigin, v... vVarArr);
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void a(Exception exc) {
JSONObject jSONObject;
Object[] objArr = new Object[1];
objArr[0] = exc != null ? exc.getMessage() : "no exception";
IAlog.a("IMediaPlayerFlowManager: onPlayerError called with: %s", objArr);
InneractiveVideoError inneractiveVideoError = new InneractiveVideoError(InneractiveVideoError.Error.ERROR_FAILED_PLAYING_MEDIA_FILE, exc);
if (exc instanceof d) {
((d) exc).getClass();
jSONObject = null;
} else {
jSONObject = new JSONObject();
}
a(inneractiveVideoError, jSONObject);
if (this.n) {
IAlog.a("IMediaPlayerFlowManager: onPlayerError video was prepared. This is a critical error. Aborting!", new Object[0]);
a(new InneractiveVideoError(InneractiveVideoError.Error.ERROR_FAILED_PLAYING_ALL_MEDIA_FILES, exc), new JSONObject());
}
}
public final void a(boolean z) {
this.j = z;
}
public final g0 b() {
return this.e;
}
public abstract View c();
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void c(boolean z) {
try {
g0 g0Var = this.e;
com.fyber.inneractive.sdk.response.g gVar = g0Var != null ? (com.fyber.inneractive.sdk.response.g) g0Var.b : null;
com.fyber.inneractive.sdk.network.r rVar = com.fyber.inneractive.sdk.network.r.VAST_MEDIA_LOAD_RETRY_ATTEMPTED;
InneractiveAdRequest inneractiveAdRequest = this.f;
g0 g0Var2 = this.e;
s.a aVar = new s.a(rVar, inneractiveAdRequest, gVar, g0Var2 == null ? null : g0Var2.c.c());
if (this.t != null && gVar != null) {
aVar.f.put(new s.b().a(String.valueOf(z), "waudio").a(this.t.g, "url").a(this.t.e, "bitrate").a(TextUtils.isEmpty(this.t.d) ? "na" : this.t.d, "mime").a(this.t.a, gi.h).a(Integer.valueOf(this.q), "media_file_index").a(this.b.f(), "player").a);
}
aVar.a((String) null);
} catch (Exception unused) {
}
}
public final void a() {
boolean a2;
i iVar;
Context context = this.a;
com.fyber.inneractive.sdk.config.global.s sVar = this.d;
if (sVar != null) {
try {
a2 = ((com.fyber.inneractive.sdk.config.global.features.r) sVar.a(com.fyber.inneractive.sdk.config.global.features.r.class)).a(false, "use_fmp_cache_mechanism");
} catch (Throwable th) {
if (IAlog.a <= 3) {
IAlog.a("Failed creating exo player", new Object[0]);
th.printStackTrace();
}
iVar = null;
}
} else {
a2 = false;
}
iVar = new com.fyber.inneractive.sdk.player.controller.d(context, a2, sVar);
if (iVar == null) {
iVar = new com.fyber.inneractive.sdk.player.controller.a(context);
}
this.b = iVar;
if (!iVar.b.contains(this)) {
iVar.b.add(this);
}
i iVar2 = this.b;
if (!iVar2.c.contains(this)) {
iVar2.c.add(this);
}
this.b.f = this.u;
}
public static boolean a(int i, int i2, f0 f0Var) {
if (i2 == 1 || InneractiveAdManager.isCurrentUserAChild()) {
return true;
}
if (i <= 15999) {
return false;
}
com.fyber.inneractive.sdk.config.g0 g0Var = f0Var != null ? ((e0) f0Var).f : null;
return (g0Var == null || g0Var.h == Skip.DEFAULT || g0Var.j == UnitDisplayType.REWARDED) ? false : true;
}
}

View File

@@ -0,0 +1,28 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.File;
import java.util.HashMap;
/* loaded from: classes2.dex */
public final class a {
public File a;
public final String b;
public boolean c;
public final Object d = new Object();
public final HashMap e = new HashMap();
public volatile boolean f = false;
public a(String str, File file, boolean z) {
this.a = file;
this.b = str;
this.c = z;
}
public final File a() {
File file;
synchronized (this.d) {
file = this.a;
}
return file;
}
}

View File

@@ -0,0 +1,16 @@
package com.fyber.inneractive.sdk.player.cache;
import java.util.HashMap;
/* loaded from: classes2.dex */
public abstract class b {
public final HashMap a = new HashMap();
public enum a {
OK,
PARTIAL_CANNOT_VALIDATE,
INVALID
}
public abstract a a(com.fyber.inneractive.sdk.player.cache.a aVar);
}

View File

@@ -0,0 +1,644 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.util.IAlog;
import com.ironsource.v8;
import csdk.gluads.Consts;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public final class c implements Closeable {
public static final Pattern p = Pattern.compile("[a-z0-9_-]{1,120}");
public static final b q = new b();
public final File a;
public final File b;
public final File c;
public final File d;
public BufferedWriter i;
public int k;
public e l;
public long h = 0;
public final LinkedHashMap<String, d> j = new LinkedHashMap<>(0, 0.75f, true);
public long m = 0;
public final ThreadPoolExecutor n = new ThreadPoolExecutor(0, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue());
public final a o = new a();
public final int e = 0;
public final int g = 1;
public final long f = 52428800;
public class a implements Callable<Void> {
public a() {
}
@Override // java.util.concurrent.Callable
public final Void call() throws Exception {
synchronized (c.this) {
try {
c cVar = c.this;
if (cVar.i == null) {
return null;
}
cVar.e();
c cVar2 = c.this;
int i = cVar2.k;
if (i >= 2000 && i >= cVar2.j.size()) {
c.this.d();
c.this.k = 0;
}
return null;
} finally {
}
}
}
}
public class b extends OutputStream {
@Override // java.io.OutputStream
public final void write(int i) throws IOException {
}
}
/* renamed from: com.fyber.inneractive.sdk.player.cache.c$c, reason: collision with other inner class name */
public final class C0081c {
public final d a;
public final boolean[] b;
public boolean c;
/* renamed from: com.fyber.inneractive.sdk.player.cache.c$c$a */
public class a extends FilterOutputStream {
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
public final void close() {
try {
((FilterOutputStream) this).out.close();
} catch (IOException unused) {
C0081c.this.c = true;
}
}
@Override // java.io.FilterOutputStream, java.io.OutputStream, java.io.Flushable
public final void flush() {
try {
((FilterOutputStream) this).out.flush();
} catch (IOException unused) {
C0081c.this.c = true;
}
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public final void write(int i) {
try {
((FilterOutputStream) this).out.write(i);
} catch (IOException unused) {
C0081c.this.c = true;
}
}
public a(FileOutputStream fileOutputStream) {
super(fileOutputStream);
}
@Override // java.io.FilterOutputStream, java.io.OutputStream
public final void write(byte[] bArr, int i, int i2) {
try {
((FilterOutputStream) this).out.write(bArr, i, i2);
} catch (IOException unused) {
C0081c.this.c = true;
}
}
}
public C0081c(d dVar) {
this.a = dVar;
this.b = dVar.c ? null : new boolean[c.this.g];
}
public final void a() throws IOException {
c.a(c.this, this, false);
}
public final OutputStream b() throws IOException {
FileOutputStream fileOutputStream;
a aVar;
c cVar = c.this;
if (cVar.g <= 0) {
throw new IllegalArgumentException("Expected index 0 to be greater than 0 and less than the maximum value count of " + c.this.g);
}
synchronized (cVar) {
try {
d dVar = this.a;
if (dVar.d != this) {
throw new IllegalStateException();
}
if (!dVar.c) {
this.b[0] = true;
}
File b = dVar.b(0);
try {
fileOutputStream = new FileOutputStream(b);
} catch (FileNotFoundException unused) {
c.this.a.mkdirs();
try {
fileOutputStream = new FileOutputStream(b);
} catch (FileNotFoundException unused2) {
return c.q;
}
}
aVar = new a(fileOutputStream);
} catch (Throwable th) {
throw th;
}
}
return aVar;
}
}
public final class d {
public final String a;
public final long[] b;
public boolean c;
public C0081c d;
public /* synthetic */ d() {
throw null;
}
public d(String str) {
this.a = str;
this.b = new long[c.this.g];
}
public final File b(int i) {
return new File(c.this.a, this.a + Consts.STRING_PERIOD + i + ".tmp");
}
public final File a(int i) {
return new File(c.this.a, this.a + Consts.STRING_PERIOD + i);
}
}
public interface e {
}
public final class f implements Closeable {
public final InputStream[] a;
public f(InputStream[] inputStreamArr) {
this.a = inputStreamArr;
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() {
for (InputStream inputStream : this.a) {
o.a(inputStream);
}
}
}
public c(File file) {
this.a = file;
this.b = new File(file, "journal");
this.c = new File(file, "journal.tmp");
this.d = new File(file, "journal.bkp");
}
public static c b(File file) throws IOException {
File file2 = new File(file, "journal.bkp");
if (file2.exists()) {
File file3 = new File(file, "journal");
if (file3.exists()) {
file2.delete();
} else if (!file2.renameTo(file3)) {
throw new IOException();
}
}
c cVar = new c(file);
if (cVar.b.exists()) {
try {
cVar.c();
cVar.b();
return cVar;
} catch (IOException e2) {
System.out.println("DiskLruCache " + file + " is corrupt: " + e2.getMessage() + ", removing");
IAlog.e("DiskLruCache delete cache", new Object[0]);
cVar.close();
o.a(cVar.a);
}
}
file.mkdirs();
c cVar2 = new c(file);
cVar2.d();
return cVar2;
}
public final void c() throws IOException {
n nVar = new n(new FileInputStream(this.b), o.a);
try {
String a2 = nVar.a();
String a3 = nVar.a();
String a4 = nVar.a();
String a5 = nVar.a();
String a6 = nVar.a();
if (!"libcore.io.DiskLruCache".equals(a2) || !"1".equals(a3) || !Integer.toString(this.e).equals(a4) || !Integer.toString(this.g).equals(a5) || !"".equals(a6)) {
throw new IOException("unexpected journal header: [" + a2 + ", " + a3 + ", " + a5 + ", " + a6 + v8.i.e);
}
int i = 0;
while (true) {
try {
c(nVar.a());
i++;
} catch (EOFException unused) {
this.k = i - this.j.size();
if (nVar.e == -1) {
d();
} else {
this.i = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.b, true), o.a));
}
o.a(nVar);
return;
}
}
} catch (Throwable th) {
o.a(nVar);
throw th;
}
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final synchronized void close() throws IOException {
try {
if (this.i == null) {
return;
}
Iterator it = new ArrayList(this.j.values()).iterator();
while (it.hasNext()) {
C0081c c0081c = ((d) it.next()).d;
if (c0081c != null) {
c0081c.a();
}
}
e();
this.i.close();
this.i = null;
} catch (Throwable th) {
throw th;
}
}
public final synchronized void flush() throws IOException {
a();
e();
this.i.flush();
}
public static void a(c cVar, C0081c c0081c, boolean z) throws IOException {
int i;
synchronized (cVar) {
d dVar = c0081c.a;
if (dVar.d != c0081c) {
throw new IllegalStateException();
}
if (z && !dVar.c) {
for (int i2 = 0; i2 < cVar.g; i2++) {
if (!c0081c.b[i2]) {
c0081c.a();
throw new IllegalStateException("Newly created entry didn't create value for index " + i2);
}
if (!dVar.b(i2).exists()) {
c0081c.a();
return;
}
}
}
for (int i3 = 0; i3 < cVar.g; i3++) {
File b2 = dVar.b(i3);
if (!z) {
a(b2);
} else if (b2.exists()) {
File a2 = dVar.a(i3);
b2.renameTo(a2);
long j = dVar.b[i3];
long length = a2.length();
dVar.b[i3] = length;
cVar.h = (cVar.h - j) + length;
}
}
cVar.k++;
dVar.d = null;
if (dVar.c || z) {
dVar.c = true;
BufferedWriter bufferedWriter = cVar.i;
StringBuilder sb = new StringBuilder("CLEAN ");
sb.append(dVar.a);
StringBuilder sb2 = new StringBuilder();
for (long j2 : dVar.b) {
sb2.append(' ');
sb2.append(j2);
}
sb.append(sb2.toString());
sb.append('\n');
bufferedWriter.write(sb.toString());
if (z) {
cVar.m++;
}
} else {
cVar.j.remove(dVar.a);
cVar.i.write("REMOVE " + dVar.a + '\n');
}
cVar.i.flush();
if (cVar.h > cVar.f || ((i = cVar.k) >= 2000 && i >= cVar.j.size())) {
cVar.n.submit(cVar.o);
}
}
}
public final synchronized void d() throws IOException {
try {
BufferedWriter bufferedWriter = this.i;
if (bufferedWriter != null) {
bufferedWriter.close();
}
BufferedWriter bufferedWriter2 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.c), o.a));
try {
bufferedWriter2.write("libcore.io.DiskLruCache");
bufferedWriter2.write("\n");
bufferedWriter2.write("1");
bufferedWriter2.write("\n");
bufferedWriter2.write(Integer.toString(this.e));
bufferedWriter2.write("\n");
bufferedWriter2.write(Integer.toString(this.g));
bufferedWriter2.write("\n");
bufferedWriter2.write("\n");
for (d dVar : this.j.values()) {
if (dVar.d != null) {
bufferedWriter2.write("DIRTY " + dVar.a + '\n');
} else {
StringBuilder sb = new StringBuilder();
sb.append("CLEAN ");
sb.append(dVar.a);
StringBuilder sb2 = new StringBuilder();
for (long j : dVar.b) {
sb2.append(' ');
sb2.append(j);
}
sb.append(sb2.toString());
sb.append('\n');
bufferedWriter2.write(sb.toString());
}
}
bufferedWriter2.close();
if (this.b.exists()) {
File file = this.b;
File file2 = this.d;
a(file2);
if (!file.renameTo(file2)) {
throw new IOException();
}
}
if (!this.c.renameTo(this.b)) {
throw new IOException();
}
this.d.delete();
this.i = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.b, true), o.a));
} catch (Throwable th) {
bufferedWriter2.close();
throw th;
}
} catch (Throwable th2) {
throw th2;
}
}
public final void e() throws IOException {
while (this.h > this.f) {
String key = this.j.entrySet().iterator().next().getKey();
e eVar = this.l;
if (eVar != null) {
Iterator it = ((p) eVar).d.iterator();
while (true) {
if (!it.hasNext()) {
d(key);
break;
}
if (((String) it.next()).equalsIgnoreCase(key)) {
boolean z = false;
for (String str : this.j.keySet()) {
Iterator it2 = ((p) this.l).d.iterator();
while (true) {
if (it2.hasNext()) {
if (((String) it2.next()).equalsIgnoreCase(str)) {
break;
}
} else {
z |= d(str);
break;
}
}
}
if (!z) {
return;
}
}
}
} else {
d(key);
}
}
}
public static void e(String str) {
if (p.matcher(str).matches()) {
return;
}
throw new IllegalArgumentException("keys must match regex [a-z0-9_-]{1,120}: \"" + str + "\"");
}
public final void b() throws IOException {
a(this.c);
Iterator<d> it = this.j.values().iterator();
while (it.hasNext()) {
d next = it.next();
int i = 0;
if (next.d == null) {
while (i < this.g) {
this.h += next.b[i];
i++;
}
} else {
next.d = null;
while (i < this.g) {
a(next.a(i));
a(next.b(i));
i++;
}
it.remove();
}
}
}
public final synchronized f b(String str) throws IOException {
InputStream inputStream;
a();
e(str);
d dVar = this.j.get(str);
if (dVar == null) {
return null;
}
if (!dVar.c) {
return null;
}
InputStream[] inputStreamArr = new InputStream[this.g];
for (int i = 0; i < this.g; i++) {
try {
inputStreamArr[i] = new FileInputStream(dVar.a(i));
} catch (FileNotFoundException unused) {
for (int i2 = 0; i2 < this.g && (inputStream = inputStreamArr[i2]) != null; i2++) {
o.a(inputStream);
}
return null;
}
}
this.k++;
this.i.append((CharSequence) ("READ " + str + '\n'));
int i3 = this.k;
if (i3 >= 2000 && i3 >= this.j.size()) {
this.n.submit(this.o);
}
return new f(inputStreamArr);
}
public final synchronized boolean d(String str) throws IOException {
try {
IAlog.e("DiskLruCache remove %s", str);
a();
e(str);
d dVar = this.j.get(str);
if (dVar != null && dVar.d == null) {
for (int i = 0; i < this.g; i++) {
File a2 = dVar.a(i);
if (a2.exists() && !a2.delete()) {
throw new IOException("failed to delete " + a2);
}
long j = this.h;
long[] jArr = dVar.b;
this.h = j - jArr[i];
jArr[i] = 0;
}
this.k++;
this.i.append((CharSequence) ("REMOVE " + str + '\n'));
this.j.remove(str);
int i2 = this.k;
if (i2 >= 2000 && i2 >= this.j.size()) {
this.n.submit(this.o);
}
return true;
}
return false;
} catch (Throwable th) {
throw th;
}
}
public final void c(String str) throws IOException {
String substring;
int indexOf = str.indexOf(32);
if (indexOf != -1) {
int i = indexOf + 1;
int indexOf2 = str.indexOf(32, i);
if (indexOf2 == -1) {
substring = str.substring(i);
if (indexOf == 6 && str.startsWith("REMOVE")) {
this.j.remove(substring);
return;
}
} else {
substring = str.substring(i, indexOf2);
}
d dVar = this.j.get(substring);
if (dVar == null) {
dVar = new d(substring);
this.j.put(substring, dVar);
}
if (indexOf2 != -1 && indexOf == 5 && str.startsWith("CLEAN")) {
String[] split = str.substring(indexOf2 + 1).split(" ");
dVar.c = true;
dVar.d = null;
if (split.length == c.this.g) {
for (int i2 = 0; i2 < split.length; i2++) {
try {
dVar.b[i2] = Long.parseLong(split[i2]);
} catch (NumberFormatException unused) {
throw new IOException("unexpected journal line: " + Arrays.toString(split));
}
}
return;
}
throw new IOException("unexpected journal line: " + Arrays.toString(split));
}
if (indexOf2 == -1 && indexOf == 5 && str.startsWith("DIRTY")) {
dVar.d = new C0081c(dVar);
return;
} else {
if (indexOf2 != -1 || indexOf != 4 || !str.startsWith("READ")) {
throw new IOException("unexpected journal line: ".concat(str));
}
return;
}
}
throw new IOException("unexpected journal line: ".concat(str));
}
public static void a(File file) throws IOException {
IAlog.e("DiskLruCache deleteIfExists - %s", file);
if (file.exists() && !file.delete()) {
throw new IOException();
}
}
public final C0081c a(String str) throws IOException {
synchronized (this) {
try {
a();
e(str);
d dVar = this.j.get(str);
if (dVar == null) {
dVar = new d(str);
this.j.put(str, dVar);
} else if (dVar.d != null) {
return null;
}
C0081c c0081c = new C0081c(dVar);
dVar.d = c0081c;
this.i.write("DIRTY " + str + '\n');
this.i.flush();
return c0081c;
} catch (Throwable th) {
throw th;
}
}
}
public final void a() {
if (this.i == null) {
throw new IllegalStateException("cache is closed");
}
}
}

View File

@@ -0,0 +1,348 @@
package com.fyber.inneractive.sdk.player.cache;
import android.net.Uri;
import android.os.HandlerThread;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.j;
import com.fyber.inneractive.sdk.util.n0;
import com.fyber.inneractive.sdk.util.t;
import com.google.firebase.perf.network.FirebasePerfUrlConnection;
import com.mbridge.msdk.foundation.download.Command;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes2.dex */
public final class d implements com.fyber.inneractive.sdk.player.exoplayer2.upstream.f {
public com.fyber.inneractive.sdk.player.cache.a b;
public j c;
public Uri d;
public FileInputStream f;
public FileInputStream g;
public b h;
public c i;
public int j;
public s k;
public boolean a = false;
public long e = 0;
public class a implements j.g {
public final /* synthetic */ com.fyber.inneractive.sdk.util.i a;
public final /* synthetic */ AtomicReference b;
public final /* synthetic */ CountDownLatch c;
public a(com.fyber.inneractive.sdk.util.i iVar, AtomicReference atomicReference, CountDownLatch countDownLatch) {
this.a = iVar;
this.b = atomicReference;
this.c = countDownLatch;
}
}
public interface b {
}
public interface c {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final Uri a() {
return this.d;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final long a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar) throws IOException {
com.fyber.inneractive.sdk.player.cache.b lVar;
r.d dVar;
if (this.b == null) {
CountDownLatch countDownLatch = new CountDownLatch(1);
AtomicReference atomicReference = new AtomicReference();
com.fyber.inneractive.sdk.util.i iVar2 = new com.fyber.inneractive.sdk.util.i();
Uri uri = iVar.a;
this.d = uri;
p pVar = p.f;
int i = this.j;
String uri2 = uri.toString();
s sVar = this.k;
a aVar = new a(iVar2, atomicReference, countDownLatch);
com.fyber.inneractive.sdk.player.cache.c cVar = pVar.b;
boolean a2 = IAConfigManager.L.t.b.a(false, "validateHasVideoTracks");
r rVar = sVar == null ? null : (r) sVar.a(r.class);
if (rVar != null) {
int[] iArr = j.b.a;
r.d dVar2 = r.d.LEGACY;
String a3 = rVar.a("v_type", dVar2.key);
r.d[] values = r.d.values();
int length = values.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
dVar = dVar2;
break;
}
int i3 = length;
r.d dVar3 = values[i2];
r.d[] dVarArr = values;
if (TextUtils.equals(dVar3.key, a3.toLowerCase(Locale.US))) {
dVar = dVar3;
break;
}
i2++;
length = i3;
values = dVarArr;
}
int i4 = iArr[dVar.ordinal()];
lVar = i4 != 1 ? i4 != 2 ? new l(a2) : new k() : new m();
} else {
lVar = new l(a2);
}
j jVar = new j(cVar, uri2, lVar, i, sVar);
jVar.g = aVar;
pVar.d.add(jVar.a());
this.c = jVar;
jVar.q = iVar2;
jVar.o = true;
HandlerThread handlerThread = jVar.i;
if (handlerThread != null) {
handlerThread.start();
n0 n0Var = new n0(jVar.i.getLooper(), jVar);
jVar.j = n0Var;
n0Var.post(new f(jVar));
}
c cVar2 = this.i;
if (cVar2 != null) {
((com.fyber.inneractive.sdk.player.controller.d) cVar2).E.add(this.c);
}
try {
countDownLatch.await(7L, TimeUnit.SECONDS);
if (this.b == null) {
if (atomicReference.get() == null) {
throw new IOException("Cache has failed to download");
}
throw new IOException((Throwable) atomicReference.get());
}
} catch (InterruptedException e) {
j jVar2 = this.c;
jVar2.a(jVar2.o);
throw new IOException(e);
}
}
this.e = iVar.d;
com.fyber.inneractive.sdk.player.cache.a aVar2 = this.b;
String valueOf = aVar2.c ? (String) aVar2.e.get("http.file.length") : String.valueOf(aVar2.a().length());
if (valueOf == null || !TextUtils.isDigitsOnly(valueOf)) {
return -1L;
}
return Long.parseLong(valueOf);
}
/* JADX WARN: Removed duplicated region for block: B:35:0x0086 A[Catch: all -> 0x001f, TryCatch #1 {all -> 0x001f, blocks: (B:10:0x000c, B:12:0x0019, B:13:0x001d, B:15:0x0022, B:22:0x0032, B:23:0x0035, B:26:0x0042, B:27:0x0047, B:29:0x0048, B:31:0x004c, B:33:0x0082, B:35:0x0086, B:36:0x0088, B:39:0x0090, B:42:0x009b, B:43:0x00a2, B:44:0x00a3, B:45:0x00b1, B:48:0x005b, B:50:0x005f), top: B:9:0x000c, inners: #0 }] */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final int read(byte[] r10, int r11, int r12) throws java.io.IOException {
/*
r9 = this;
com.fyber.inneractive.sdk.player.cache.a r0 = r9.b
if (r0 != 0) goto L6
r10 = -1
return r10
L6:
if (r12 != 0) goto L9
return r12
L9:
java.lang.Object r0 = r0.d
monitor-enter(r0)
com.fyber.inneractive.sdk.player.cache.a r1 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r1 = r1.a() // Catch: java.lang.Throwable -> L1f
long r1 = r1.length() // Catch: java.lang.Throwable -> L1f
int r1 = (int) r1 // Catch: java.lang.Throwable -> L1f
if (r11 <= r1) goto L22
int r10 = r9.a(r10, r11, r12) // Catch: java.lang.Throwable -> L1f
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
return r10
L1f:
r10 = move-exception
goto Lb9
L22:
com.fyber.inneractive.sdk.player.cache.a r2 = r9.b // Catch: java.lang.Throwable -> L1f
boolean r2 = r2.c // Catch: java.lang.Throwable -> L1f
r3 = 0
r5 = 0
r6 = 1
if (r2 == 0) goto L5b
L2c:
int r2 = r1 - r11
if (r2 > 0) goto L48
r1 = 50
r9.wait(r3, r1) // Catch: java.lang.Throwable -> L1f java.lang.InterruptedException -> L41
com.fyber.inneractive.sdk.player.cache.a r1 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r1 = r1.a() // Catch: java.lang.Throwable -> L1f
long r1 = r1.length() // Catch: java.lang.Throwable -> L1f
int r1 = (int) r1 // Catch: java.lang.Throwable -> L1f
goto L2c
L41:
r10 = move-exception
java.io.IOException r11 = new java.io.IOException // Catch: java.lang.Throwable -> L1f
r11.<init>(r10) // Catch: java.lang.Throwable -> L1f
throw r11 // Catch: java.lang.Throwable -> L1f
L48:
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L82
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.player.cache.a r5 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r5 = r5.a() // Catch: java.lang.Throwable -> L1f
r2.<init>(r5) // Catch: java.lang.Throwable -> L1f
r9.g = r2 // Catch: java.lang.Throwable -> L1f
L59:
r5 = r6
goto L82
L5b:
java.io.FileInputStream r2 = r9.f // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L82
java.lang.String r2 = "%s creating a single instance of fis"
java.lang.Object[] r7 = new java.lang.Object[r6] // Catch: java.lang.Throwable -> L1f
java.lang.String r8 = r9.toString() // Catch: java.lang.Throwable -> L1f
r7[r5] = r8 // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.util.IAlog.a(r2, r7) // Catch: java.lang.Throwable -> L1f
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.player.cache.a r5 = r9.b // Catch: java.lang.Throwable -> L1f
java.io.File r5 = r5.a() // Catch: java.lang.Throwable -> L1f
r2.<init>(r5) // Catch: java.lang.Throwable -> L1f
r9.f = r2 // Catch: java.lang.Throwable -> L1f
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
com.fyber.inneractive.sdk.util.t.b(r2) // Catch: java.lang.Throwable -> L1f
r2 = 0
r9.g = r2 // Catch: java.lang.Throwable -> L1f
goto L59
L82:
java.io.FileInputStream r2 = r9.f // Catch: java.lang.Throwable -> L1f
if (r2 != 0) goto L88
java.io.FileInputStream r2 = r9.g // Catch: java.lang.Throwable -> L1f
L88:
long r6 = r9.e // Catch: java.lang.Throwable -> L1f
int r3 = (r6 > r3 ? 1 : (r6 == r3 ? 0 : -1))
if (r3 <= 0) goto La3
if (r5 == 0) goto La3
long r3 = r2.skip(r6) // Catch: java.lang.Throwable -> L1f
long r5 = r9.e // Catch: java.lang.Throwable -> L1f
int r3 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))
if (r3 != 0) goto L9b
goto La3
L9b:
java.io.IOException r10 = new java.io.IOException // Catch: java.lang.Throwable -> L1f
java.lang.String r11 = "Failed to skip the stream"
r10.<init>(r11) // Catch: java.lang.Throwable -> L1f
throw r10 // Catch: java.lang.Throwable -> L1f
La3:
int r1 = r1 - r11
int r3 = r10.length // Catch: java.lang.Throwable -> L1f
int r1 = java.lang.Math.min(r3, r1) // Catch: java.lang.Throwable -> L1f
int r12 = java.lang.Math.min(r1, r12) // Catch: java.lang.Throwable -> L1f
int r10 = r2.read(r10, r11, r12) // Catch: java.lang.Throwable -> L1f
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
long r11 = r9.e
long r0 = (long) r10
long r11 = r11 + r0
r9.e = r11
return r10
Lb9:
monitor-exit(r0) // Catch: java.lang.Throwable -> L1f
throw r10
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.d.read(byte[], int, int):int");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final void close() throws IOException {
this.a = true;
this.e = 0L;
t.b(this.f);
t.b(this.g);
this.f = null;
this.g = null;
}
public final int a(byte[] bArr, int i, int i2) throws IOException {
InputStream inputStream;
InputStream inputStream2;
InputStream inputStream3;
HttpURLConnection httpURLConnection;
String str = this.b.b;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bArr.length);
int i3 = (int) this.e;
ByteBuffer byteBuffer = (ByteBuffer) com.fyber.inneractive.sdk.util.g.b.a.poll();
if (byteBuffer == null) {
byteBuffer = ByteBuffer.allocateDirect(16384);
}
HttpURLConnection httpURLConnection2 = null;
try {
httpURLConnection = (HttpURLConnection) ((URLConnection) FirebasePerfUrlConnection.instrument(new URL(str).openConnection()));
} catch (IOException e) {
e = e;
inputStream2 = null;
} catch (Throwable unused) {
inputStream = null;
}
try {
httpURLConnection.setRequestProperty(Command.HTTP_HEADER_RANGE, String.format(Locale.ENGLISH, "bytes=%d-", Integer.valueOf(i3)));
httpURLConnection.connect();
} catch (IOException e2) {
e = e2;
inputStream2 = null;
httpURLConnection2 = httpURLConnection;
try {
throw e;
} finally {
}
} catch (Throwable unused2) {
httpURLConnection2 = httpURLConnection;
inputStream = null;
if (httpURLConnection2 != null) {
try {
httpURLConnection2.disconnect();
} catch (Exception unused3) {
}
}
if (inputStream != null) {
inputStream3 = inputStream;
try {
inputStream3.close();
} catch (Exception unused4) {
}
}
System.arraycopy(byteArrayOutputStream.toByteArray(), 0, bArr, i, i2);
return i2;
}
if (httpURLConnection.getResponseCode() == 206) {
inputStream3 = httpURLConnection.getInputStream();
byte[] array = byteBuffer.array();
while (inputStream3.read(array) != -1) {
byteArrayOutputStream.write(array);
}
inputStream3.close();
httpURLConnection.disconnect();
try {
httpURLConnection.disconnect();
} catch (Exception unused5) {
}
inputStream3.close();
System.arraycopy(byteArrayOutputStream.toByteArray(), 0, bArr, i, i2);
return i2;
}
throw new IOException("Server did not reply with proper range.");
}
}

View File

@@ -0,0 +1,30 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.f;
/* loaded from: classes2.dex */
public final class e implements f.a {
public final d.c a;
public final d.b b;
public final int c;
public final s d;
public e(d.b bVar, d.c cVar, int i, s sVar) {
this.b = bVar;
this.c = i;
this.a = cVar;
this.d = sVar;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f.a
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a() {
d dVar = new d();
dVar.h = this.b;
dVar.j = this.c;
dVar.k = this.d;
dVar.i = this.a;
return dVar;
}
}

View File

@@ -0,0 +1,56 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.network.t;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.player.cache.j;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.n0;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class f implements Runnable {
public final /* synthetic */ j a;
public f(j jVar) {
this.a = jVar;
}
@Override // java.lang.Runnable
public final void run() {
try {
j jVar = this.a;
c.f b = jVar.b.b(jVar.a());
j jVar2 = this.a;
jVar2.c = b;
if (b == null) {
c.C0081c a = jVar2.b.a(jVar2.a());
if (a == null) {
this.a.n = true;
}
if (a != null) {
j jVar3 = this.a;
IAlog.e("%s | start | got an editor for %s", jVar3.a, jVar3.a());
a.a();
}
}
} catch (IOException e) {
j jVar4 = this.a;
IAlog.a(String.format("%s | Exception raised starting a new caching process for %s", jVar4.a, jVar4.a()), e, new Object[0]);
t.a("Exception raised starting a new caching process", e.getMessage(), null, null);
}
j jVar5 = this.a;
if (jVar5.c == null && !jVar5.n) {
j.d dVar = jVar5.h;
if (dVar != null) {
dVar.start();
return;
}
return;
}
g gVar = new g(jVar5);
n0 n0Var = jVar5.j;
if (n0Var != null) {
n0Var.postAtFrontOfQueue(gVar);
}
}
}

View File

@@ -0,0 +1,27 @@
package com.fyber.inneractive.sdk.player.cache;
/* loaded from: classes2.dex */
public final class g implements Runnable {
public final /* synthetic */ j a;
public g(j jVar) {
this.a = jVar;
}
/* JADX WARN: Removed duplicated region for block: B:13:0x005d */
/* JADX WARN: Removed duplicated region for block: B:33:0x0096 */
/* JADX WARN: Removed duplicated region for block: B:36:0x00ae A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:52:0x0098 */
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
Method dump skipped, instructions count: 256
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.g.run():void");
}
}

View File

@@ -0,0 +1,34 @@
package com.fyber.inneractive.sdk.player.cache;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.cache.j;
/* loaded from: classes2.dex */
public final class h implements Runnable {
public final /* synthetic */ j a;
public h(j jVar) {
this.a = jVar;
}
@Override // java.lang.Runnable
public final void run() {
d.b bVar;
j jVar = this.a;
j.g gVar = jVar.g;
if (gVar != null) {
a aVar = jVar.f;
d.a aVar2 = (d.a) gVar;
d dVar = d.this;
if (!dVar.a) {
Bitmap bitmap = aVar2.a.b;
if (bitmap != null && (bVar = dVar.h) != null) {
((com.fyber.inneractive.sdk.player.controller.d) bVar).B = bitmap;
}
dVar.b = aVar;
}
aVar2.c.countDown();
}
}
}

View File

@@ -0,0 +1,41 @@
package com.fyber.inneractive.sdk.player.cache;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.cache.j;
/* loaded from: classes2.dex */
public final class i implements Runnable {
public final /* synthetic */ Exception a;
public final /* synthetic */ j b;
public i(j jVar, Exception exc) {
this.b = jVar;
this.a = exc;
}
@Override // java.lang.Runnable
public final void run() {
d.b bVar;
j jVar = this.b;
j.g gVar = jVar.g;
if (gVar != null) {
a aVar = jVar.f;
Exception exc = this.a;
d.a aVar2 = (d.a) gVar;
d dVar = d.this;
if (!dVar.a) {
if (exc == null) {
Bitmap bitmap = aVar2.a.b;
if (bitmap != null && (bVar = dVar.h) != null) {
((com.fyber.inneractive.sdk.player.controller.d) bVar).B = bitmap;
}
dVar.b = aVar;
} else {
aVar2.b.set(exc);
}
}
aVar2.c.countDown();
}
}
}

View File

@@ -0,0 +1,290 @@
package com.fyber.inneractive.sdk.player.cache;
import android.os.HandlerThread;
import android.os.Message;
import android.webkit.MimeTypeMap;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.config.global.s;
import com.fyber.inneractive.sdk.player.cache.b;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.n0;
import com.fyber.inneractive.sdk.util.o0;
import com.mbridge.msdk.foundation.tools.SameMD5;
import com.unity3d.ads.core.data.datasource.AndroidStaticDeviceInfoDataSource;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;
/* loaded from: classes2.dex */
public final class j implements o0 {
public final com.fyber.inneractive.sdk.player.cache.c b;
public c.f c;
public final com.fyber.inneractive.sdk.player.cache.b d;
public final String e;
public com.fyber.inneractive.sdk.player.cache.a f;
public g g;
public d h;
public n0 j;
public final String l;
public f q;
public final s r;
public final String a = "MediaDownloader-" + hashCode();
public final Object k = new Object();
public volatile boolean m = false;
public boolean n = false;
public boolean o = false;
public String p = null;
public final HandlerThread i = new HandlerThread(String.format("MediaDownloader-%s-A", a()));
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
j.this.a(false);
}
}
public static /* synthetic */ class b {
public static final /* synthetic */ int[] a;
static {
int[] iArr = new int[r.d.values().length];
a = iArr;
try {
iArr[r.d.NONE.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[r.d.EXTRACTOR.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[r.d.LEGACY.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
public static class c extends Exception {
public c(String str) {
super(str);
}
}
public class d extends Thread {
public final AtomicBoolean a;
public InputStream b;
public boolean c;
public boolean d;
public long e;
public long f;
public c.C0081c g;
public final int h;
public final int i;
public final int j;
public final int k;
/* JADX WARN: Removed duplicated region for block: B:45:0x0133 */
/* JADX WARN: Removed duplicated region for block: B:79:0x01d9 A[EDGE_INSN: B:79:0x01d9->B:78:0x01d9 BREAK A[LOOP:0: B:43:0x012a->B:66:0x01d5], SYNTHETIC] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final java.net.HttpURLConnection a(java.io.OutputStream r18, java.net.URL r19, java.nio.ByteBuffer r20, long r21, int r23) throws java.io.IOException, com.fyber.inneractive.sdk.player.cache.j.c {
/*
Method dump skipped, instructions count: 506
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.j.d.a(java.io.OutputStream, java.net.URL, java.nio.ByteBuffer, long, int):java.net.HttpURLConnection");
}
public d(String str, int i) {
super(str);
this.a = new AtomicBoolean(false);
this.c = false;
this.d = false;
this.e = -1L;
this.f = 0L;
this.h = i;
this.i = j.this.r != null ? ((r) j.this.r.a(r.class)).e() : 10;
this.j = j.this.r != null ? ((r) j.this.r.a(r.class)).f() : 500;
this.k = j.this.r != null ? ((r) j.this.r.a(r.class)).i() : 25;
}
/* JADX WARN: Code restructure failed: missing block: B:109:0x020f, code lost:
if (r15 == null) goto L96;
*/
/* JADX WARN: Code restructure failed: missing block: B:75:0x01d6, code lost:
if (r15 != null) goto L114;
*/
/* JADX WARN: Code restructure failed: missing block: B:79:0x0211, code lost:
r15.disconnect();
*/
/* JADX WARN: Finally extract failed */
@Override // java.lang.Thread, java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
Method dump skipped, instructions count: 556
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.j.d.run():void");
}
}
public static class e extends c {
public e(String str) {
super(str);
}
}
public interface f {
}
public interface g {
}
public j(com.fyber.inneractive.sdk.player.cache.c cVar, String str, com.fyber.inneractive.sdk.player.cache.b bVar, int i, s sVar) {
this.b = cVar;
this.e = str;
this.l = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(str).toLowerCase(Locale.US));
this.d = bVar;
this.r = sVar;
this.h = new d(String.format("MediaDownloader-%s-A", a()), i);
}
@Override // com.fyber.inneractive.sdk.util.o0
public final void handleMessage(Message message) {
if (message.what == 4 && !this.f.f) {
synchronized (this.k) {
try {
IAlog.e("%s | reading from cache 1 - %s", this.a, a());
b.a a2 = this.d.a(this.f);
if (a2 == b.a.INVALID) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("Failed cache validation")));
a(true);
} else if (a2 == b.a.PARTIAL_CANNOT_VALIDATE) {
this.m = true;
} else {
this.f.f = true;
a(this.f);
this.f.e.putAll(this.d.a);
com.fyber.inneractive.sdk.util.p.b.post(new h(this));
}
} finally {
}
}
return;
}
int i = message.what;
if (i == 1) {
Object obj = message.obj;
if (obj instanceof Exception) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, (Exception) obj));
} else {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("download failed")));
}
a(false);
return;
}
if (i == 2) {
if (this.m) {
synchronized (this.k) {
try {
IAlog.e("%s | reading from cache 2 - %s", this.a, a());
if (this.d.a(this.f) == b.a.INVALID) {
com.fyber.inneractive.sdk.util.p.b.post(new i(this, new c("Failed cache validation after downloading complete file")));
a(true);
} else {
a(this.f);
this.f.e.putAll(this.d.a);
com.fyber.inneractive.sdk.util.p.b.post(new h(this));
}
} finally {
}
}
} else {
com.fyber.inneractive.sdk.util.p.b.post(new a());
}
IAlog.e("%s | Download success for cache key %s", this.a, a());
}
}
public final void a(boolean z) {
d dVar = this.h;
if (dVar != null) {
dVar.a.compareAndSet(false, true);
this.h = null;
}
HandlerThread handlerThread = this.i;
if (handlerThread != null) {
handlerThread.quit();
}
this.j = null;
if (z) {
try {
this.b.d(a());
} catch (IOException e2) {
IAlog.a("failed to remove cache key", e2, new Object[0]);
}
}
}
public final String a() {
String str = "";
if (this.p == null) {
String str2 = this.e;
try {
try {
MessageDigest messageDigest = MessageDigest.getInstance(AndroidStaticDeviceInfoDataSource.ALGORITHM_SHA1);
messageDigest.update(str2.getBytes());
byte[] digest = messageDigest.digest();
StringBuffer stringBuffer = new StringBuffer();
for (byte b2 : digest) {
stringBuffer.append(Integer.toHexString((b2 & 255) | 256).substring(1));
}
str = stringBuffer.toString();
} catch (NoSuchAlgorithmException unused) {
str = str2.replaceAll("\\W+", "");
}
} catch (NullPointerException unused2) {
} catch (NoSuchAlgorithmException unused3) {
MessageDigest messageDigest2 = MessageDigest.getInstance(SameMD5.TAG);
messageDigest2.update(str2.getBytes());
byte[] digest2 = messageDigest2.digest();
StringBuffer stringBuffer2 = new StringBuffer();
for (byte b3 : digest2) {
stringBuffer2.append(Integer.toHexString((b3 & 255) | 256).substring(1));
}
str = stringBuffer2.toString();
}
this.p = str;
}
return this.p;
}
public final void a(com.fyber.inneractive.sdk.player.cache.a aVar) {
f fVar;
if (aVar == null || (fVar = this.q) == null) {
return;
}
File a2 = aVar.a();
File file = ((com.fyber.inneractive.sdk.util.i) fVar).a;
if (file == null || a2 == null || !file.getAbsolutePath().equals(a2.getAbsolutePath())) {
((com.fyber.inneractive.sdk.util.i) this.q).a(aVar.a());
}
}
}

View File

@@ -0,0 +1,29 @@
package com.fyber.inneractive.sdk.player.cache;
import android.media.MediaExtractor;
import com.fyber.inneractive.sdk.player.cache.b;
/* loaded from: classes2.dex */
public final class k extends b {
@Override // com.fyber.inneractive.sdk.player.cache.b
public final b.a a(a aVar) {
b.a aVar2 = b.a.INVALID;
MediaExtractor mediaExtractor = new MediaExtractor();
try {
mediaExtractor.setDataSource(aVar.a().getAbsolutePath());
for (int i = 0; i < mediaExtractor.getTrackCount(); i++) {
String string = mediaExtractor.getTrackFormat(i).getString("mime");
if (string != null && string.startsWith("video/")) {
aVar2 = b.a.OK;
break;
}
}
} catch (Throwable unused) {
}
try {
mediaExtractor.release();
} catch (Throwable unused2) {
}
return aVar2;
}
}

View File

@@ -0,0 +1,133 @@
package com.fyber.inneractive.sdk.player.cache;
/* loaded from: classes2.dex */
public final class l extends b {
public final boolean b;
public l(boolean z) {
this.b = z;
}
/* JADX WARN: Removed duplicated region for block: B:43:0x00ac A[Catch: all -> 0x00c4, TryCatch #0 {all -> 0x00c4, blocks: (B:40:0x009b, B:41:0x00a6, B:43:0x00ac, B:45:0x00b8), top: B:39:0x009b }] */
@Override // com.fyber.inneractive.sdk.player.cache.b
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final com.fyber.inneractive.sdk.player.cache.b.a a(com.fyber.inneractive.sdk.player.cache.a r8) {
/*
r7 = this;
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.INVALID
android.media.MediaPlayer r1 = new android.media.MediaPlayer
r1.<init>()
java.io.File r2 = r8.a
r3 = 0
if (r2 == 0) goto L89
boolean r2 = r2.exists()
if (r2 == 0) goto L89
java.io.FileInputStream r2 = new java.io.FileInputStream // Catch: java.lang.Throwable -> L6e
java.io.File r4 = r8.a() // Catch: java.lang.Throwable -> L6e
r2.<init>(r4) // Catch: java.lang.Throwable -> L6e
java.io.File r4 = r8.a() // Catch: java.lang.Throwable -> L5c
java.lang.String r4 = r4.getAbsolutePath() // Catch: java.lang.Throwable -> L5c
r1.setDataSource(r4) // Catch: java.lang.Throwable -> L5c
r1.prepare() // Catch: java.lang.Throwable -> L5c
int r4 = r1.getDuration() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L81
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.OK // Catch: java.lang.Throwable -> L5c
int r4 = r1.getVideoWidth() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L5e
int r4 = r1.getVideoHeight() // Catch: java.lang.Throwable -> L5c
if (r4 <= 0) goto L5e
java.lang.String r4 = "video.width"
int r5 = r1.getVideoWidth() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
java.lang.String r4 = "video.height"
int r5 = r1.getVideoHeight() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
goto L5e
L5c:
r4 = move-exception
goto L71
L5e:
java.lang.String r4 = "video.duration"
int r5 = r1.getDuration() // Catch: java.lang.Throwable -> L5c
java.lang.String r5 = java.lang.String.valueOf(r5) // Catch: java.lang.Throwable -> L5c
java.util.HashMap r6 = r7.a // Catch: java.lang.Throwable -> L5c
r6.put(r4, r5) // Catch: java.lang.Throwable -> L5c
goto L81
L6e:
r2 = move-exception
r4 = r2
r2 = 0
L71:
java.lang.String r5 = "Exception raised while trying to open a cache candidate"
java.lang.Object[] r6 = new java.lang.Object[r3] // Catch: java.lang.Throwable -> L7f
com.fyber.inneractive.sdk.util.IAlog.a(r5, r4, r6) // Catch: java.lang.Throwable -> L7f
boolean r4 = r8.c // Catch: java.lang.Throwable -> L7f
if (r4 == 0) goto L81
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.PARTIAL_CANNOT_VALIDATE // Catch: java.lang.Throwable -> L7f
goto L81
L7f:
r8 = move-exception
goto L85
L81:
com.fyber.inneractive.sdk.player.cache.o.a(r2)
goto L89
L85:
com.fyber.inneractive.sdk.player.cache.o.a(r2)
throw r8
L89:
r1.release() // Catch: java.lang.Throwable -> L8c
L8c:
boolean r1 = r7.b
r2 = 1
r1 = r1 ^ r2
if (r1 != 0) goto Lc9
com.fyber.inneractive.sdk.player.cache.b$a r4 = com.fyber.inneractive.sdk.player.cache.b.a.OK
if (r0 != r4) goto Lc9
android.media.MediaExtractor r4 = new android.media.MediaExtractor
r4.<init>()
java.io.File r5 = r8.a() // Catch: java.lang.Throwable -> Lc4
java.lang.String r5 = r5.getAbsolutePath() // Catch: java.lang.Throwable -> Lc4
r4.setDataSource(r5) // Catch: java.lang.Throwable -> Lc4
La6:
int r5 = r4.getTrackCount() // Catch: java.lang.Throwable -> Lc4
if (r3 >= r5) goto Lc4
android.media.MediaFormat r5 = r4.getTrackFormat(r3) // Catch: java.lang.Throwable -> Lc4
java.lang.String r6 = "mime"
java.lang.String r5 = r5.getString(r6) // Catch: java.lang.Throwable -> Lc4
if (r5 == 0) goto Lc1
java.lang.String r6 = "video/"
boolean r5 = r5.startsWith(r6) // Catch: java.lang.Throwable -> Lc4
if (r5 == 0) goto Lc1
goto Lc5
Lc1:
int r3 = r3 + 1
goto La6
Lc4:
r2 = r1
Lc5:
r4.release() // Catch: java.lang.Throwable -> Lc8
Lc8:
r1 = r2
Lc9:
com.fyber.inneractive.sdk.player.cache.b$a r2 = com.fyber.inneractive.sdk.player.cache.b.a.OK
if (r0 != r2) goto Ld8
if (r1 != 0) goto Ld8
boolean r8 = r8.c
if (r8 == 0) goto Ld6
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.PARTIAL_CANNOT_VALIDATE
goto Ld8
Ld6:
com.fyber.inneractive.sdk.player.cache.b$a r0 = com.fyber.inneractive.sdk.player.cache.b.a.INVALID
Ld8:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.cache.l.a(com.fyber.inneractive.sdk.player.cache.a):com.fyber.inneractive.sdk.player.cache.b$a");
}
}

View File

@@ -0,0 +1,11 @@
package com.fyber.inneractive.sdk.player.cache;
import com.fyber.inneractive.sdk.player.cache.b;
/* loaded from: classes2.dex */
public final class m extends b {
@Override // com.fyber.inneractive.sdk.player.cache.b
public final b.a a(a aVar) {
return b.a.OK;
}
}

View File

@@ -0,0 +1,131 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
/* loaded from: classes2.dex */
public final class n implements Closeable {
public final InputStream a;
public final Charset b;
public byte[] c;
public int d;
public int e;
public class a extends ByteArrayOutputStream {
public a(int i) {
super(i);
}
@Override // java.io.ByteArrayOutputStream
public final String toString() {
int i = ((ByteArrayOutputStream) this).count;
if (i > 0) {
int i2 = i - 1;
if (((ByteArrayOutputStream) this).buf[i2] == 13) {
i = i2;
}
}
try {
return new String(((ByteArrayOutputStream) this).buf, 0, i, n.this.b.name());
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
}
public n(FileInputStream fileInputStream, Charset charset) {
charset.getClass();
if (!charset.equals(o.a)) {
throw new IllegalArgumentException("Unsupported encoding");
}
this.a = fileInputStream;
this.b = charset;
this.c = new byte[8192];
}
public final String a() throws IOException {
int i;
synchronized (this.a) {
try {
byte[] bArr = this.c;
if (bArr == null) {
throw new IOException("LineReader is closed");
}
if (this.d >= this.e) {
int read = this.a.read(bArr, 0, bArr.length);
if (read == -1) {
throw new EOFException();
}
this.d = 0;
this.e = read;
}
for (int i2 = this.d; i2 != this.e; i2++) {
byte[] bArr2 = this.c;
if (bArr2[i2] == 10) {
int i3 = this.d;
if (i2 != i3) {
i = i2 - 1;
if (bArr2[i] == 13) {
String str = new String(bArr2, i3, i - i3, this.b.name());
this.d = i2 + 1;
return str;
}
}
i = i2;
String str2 = new String(bArr2, i3, i - i3, this.b.name());
this.d = i2 + 1;
return str2;
}
}
a aVar = new a((this.e - this.d) + 80);
while (true) {
byte[] bArr3 = this.c;
int i4 = this.d;
aVar.write(bArr3, i4, this.e - i4);
this.e = -1;
InputStream inputStream = this.a;
byte[] bArr4 = this.c;
int read2 = inputStream.read(bArr4, 0, bArr4.length);
if (read2 == -1) {
throw new EOFException();
}
this.d = 0;
this.e = read2;
for (int i5 = 0; i5 != this.e; i5++) {
byte[] bArr5 = this.c;
if (bArr5[i5] == 10) {
int i6 = this.d;
if (i5 != i6) {
aVar.write(bArr5, i6, i5 - i6);
}
this.d = i5 + 1;
return aVar.toString();
}
}
}
} catch (Throwable th) {
throw th;
}
}
}
@Override // java.io.Closeable, java.lang.AutoCloseable
public final void close() throws IOException {
synchronized (this.a) {
try {
if (this.c != null) {
this.c = null;
this.a.close();
}
} catch (Throwable th) {
throw th;
}
}
}
}

View File

@@ -0,0 +1,41 @@
package com.fyber.inneractive.sdk.player.cache;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
/* loaded from: classes2.dex */
public final class o {
public static final Charset a = Charset.forName("US-ASCII");
static {
Charset.forName("UTF-8");
}
public static void a(File file) throws IOException {
File[] listFiles = file.listFiles();
if (listFiles == null) {
throw new IOException("not a readable directory: " + file);
}
for (File file2 : listFiles) {
if (file2.isDirectory()) {
a(file2);
}
if (!file2.delete()) {
throw new IOException("failed to delete file: " + file2);
}
}
}
public static void a(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception unused) {
}
}
}
}

View File

@@ -0,0 +1,86 @@
package com.fyber.inneractive.sdk.player.cache;
import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.network.t;
import com.fyber.inneractive.sdk.player.cache.c;
import com.fyber.inneractive.sdk.util.IAlog;
import java.io.File;
import java.util.concurrent.CopyOnWriteArrayList;
/* loaded from: classes2.dex */
public final class p implements c.e {
public static final p f = new p();
public Context a;
public c b;
public boolean c = false;
public final CopyOnWriteArrayList d = new CopyOnWriteArrayList();
public final a e = new a();
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
long j;
File a = p.a(p.this.a, "fyb.vamp.vid.cache");
if (a != null) {
try {
IAlog.a("VideoCache opening the cache in directory - %s", a);
p.this.b = c.b(a);
c cVar = p.this.b;
cVar.getClass();
IAlog.e("DiskLruCache delete cache", new Object[0]);
cVar.close();
o.a(cVar.a);
p.this.b = c.b(a);
Object[] objArr = new Object[2];
objArr[0] = a;
c cVar2 = p.this.b;
synchronized (cVar2) {
j = cVar2.h;
}
objArr[1] = Long.valueOf(j);
IAlog.a("VideoCache opened the cache in directory - %s current size is %d", objArr);
p pVar = p.this;
pVar.b.l = pVar;
pVar.c = true;
} catch (Throwable th) {
t.a("Failed to open cache directory", th.getMessage(), null, null);
IAlog.a("Failed to open cache directory", th, new Object[0]);
}
}
}
}
public static File a(Context context, String str) {
String str2;
File externalCacheDir;
String str3 = "";
if (context != null && !TextUtils.isEmpty(str)) {
if (com.fyber.inneractive.sdk.util.o.a != null && com.fyber.inneractive.sdk.util.o.b("android.permission.WRITE_EXTERNAL_STORAGE")) {
try {
str2 = Environment.getExternalStorageState();
} catch (Throwable unused) {
str2 = "";
}
if ("mounted".equals(str2)) {
try {
str3 = Environment.getExternalStorageState();
} catch (Throwable unused2) {
}
if (("mounted".equals(str3) || "mounted_ro".equals(str3)) && (externalCacheDir = context.getExternalCacheDir()) != null && externalCacheDir.getFreeSpace() > 52428800) {
return new File(context.getExternalCacheDir(), str);
}
}
}
File cacheDir = context.getCacheDir();
if (cacheDir != null && cacheDir.getFreeSpace() > 52428800) {
return new File(context.getCacheDir(), str);
}
}
return null;
}
}

View File

@@ -0,0 +1,219 @@
package com.fyber.inneractive.sdk.player.controller;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.Surface;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/* loaded from: classes2.dex */
public final class a extends i {
public com.fyber.inneractive.sdk.player.mediaplayer.a p;
public int q;
public final int r;
public int s;
public boolean t;
public a(Context context) {
super(context);
this.q = 0;
this.r = 2;
this.s = 0;
this.t = false;
IAlog.a("Creating IAAndroidMediaPlayerController", new Object[0]);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final boolean a() {
return false;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void d(boolean z) {
c(false);
if (i() || !this.n) {
this.n = z;
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
IAlog.a("%s unmute", aVar.c());
aVar.d = false;
if (aVar.b()) {
aVar.a(new com.fyber.inneractive.sdk.player.mediaplayer.d(aVar));
} else {
IAlog.a("%s unmute called when player is not ready!", aVar.c());
}
}
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final Bitmap e() {
return null;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final String f() {
return "media";
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(Surface surface) {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
aVar.setSurface(surface);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b() {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
aVar.reset();
this.p.release();
this.p = null;
}
IAlog.a("%sdestroy started", IAlog.a(this));
com.fyber.inneractive.sdk.player.d dVar = this.h;
if (dVar != null && (scheduledThreadPoolExecutor = dVar.b) != null) {
scheduledThreadPoolExecutor.shutdownNow();
dVar.b = null;
}
this.h = null;
this.i.removeCallbacksAndMessages(null);
this.b.clear();
this.f = null;
this.g = true;
IAlog.a("%sdestroy finished", IAlog.a(this));
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int c() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
return aVar.getCurrentPosition();
}
return 0;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int g() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
return aVar.t;
}
return 0;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int h() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
return aVar.s;
}
return 0;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final boolean i() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
return aVar.d;
}
return false;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void k() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
aVar.pause();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void l() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
aVar.start();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(boolean z) {
if (this.p == null) {
IAlog.a("MediaPlayerController: creating media player", new Object[0]);
this.p = new com.fyber.inneractive.sdk.player.mediaplayer.a(this.a, this, this.i);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(String str, int i) {
this.p.a(str);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(int i) {
super.a(i);
if (i >= d()) {
a(com.fyber.inneractive.sdk.player.enums.b.Completed);
} else if (i == this.q) {
IAlog.a("%sVideo is stuck! Progress doesn't change", IAlog.a(this));
int i2 = this.s + 1;
this.s = i2;
if (i2 == this.r) {
a(com.fyber.inneractive.sdk.player.enums.b.Buffering);
this.t = true;
}
} else if (this.t) {
IAlog.a("%sVideo progress was stuck! but now it goes forward. Remove buffering state", IAlog.a(this));
a(com.fyber.inneractive.sdk.player.enums.b.Playing);
this.s = 0;
this.t = false;
}
this.q = i;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int d() {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
return aVar.r;
}
return 0;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b(boolean z) {
c(true);
if (i() && this.n) {
return;
}
this.n = z;
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
aVar.e();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b(int i) {
com.fyber.inneractive.sdk.player.mediaplayer.a aVar = this.p;
if (aVar != null) {
IAlog.a("%s seek to called with = %d mPlayAfterSeek = %s", aVar.c(), Integer.valueOf(i), Boolean.TRUE);
if (!aVar.b()) {
IAlog.a("%s seek called when player is not ready!", aVar.c());
return;
}
com.fyber.inneractive.sdk.player.enums.b bVar = aVar.b;
com.fyber.inneractive.sdk.player.enums.b bVar2 = com.fyber.inneractive.sdk.player.enums.b.Seeking;
if (bVar == bVar2) {
IAlog.a("%s seek called when player is already seeking!", aVar.c());
return;
}
aVar.a(bVar2);
aVar.c = true;
aVar.a(new com.fyber.inneractive.sdk.player.mediaplayer.c(aVar, i));
}
}
}

View File

@@ -0,0 +1,31 @@
package com.fyber.inneractive.sdk.player.controller;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.player.controller.y;
/* loaded from: classes2.dex */
public interface b<ListenerT extends y> {
void a(long j);
void a(Bitmap bitmap);
void a(ListenerT listenert);
void b(int i);
void b(boolean z);
boolean c();
void destroy();
void e(boolean z);
void f();
com.fyber.inneractive.sdk.flow.vast.e g();
boolean h();
void pauseVideo();
}

View File

@@ -0,0 +1,187 @@
package com.fyber.inneractive.sdk.player.controller;
import android.content.Context;
import android.text.TextUtils;
import android.webkit.WebSettings;
import com.fyber.inneractive.sdk.R;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
import com.fyber.inneractive.sdk.external.InneractiveErrorCode;
import com.fyber.inneractive.sdk.external.InneractiveInfrastructureError;
import com.fyber.inneractive.sdk.ui.IAmraidWebViewController;
import com.fyber.inneractive.sdk.util.b0;
import com.fyber.inneractive.sdk.util.q0;
import com.fyber.inneractive.sdk.web.f;
import com.fyber.inneractive.sdk.web.g0;
import com.fyber.inneractive.sdk.web.j;
/* loaded from: classes2.dex */
public final class c {
public g0 a;
public UnitDisplayType c;
public boolean e;
public j.g b = j.g.INLINE;
public j.d d = j.d.ENABLED;
public static /* synthetic */ class a {
public static final /* synthetic */ int[] a;
public static final /* synthetic */ int[] b;
static {
int[] iArr = new int[com.fyber.inneractive.sdk.model.vast.h.values().length];
b = iArr;
try {
iArr[com.fyber.inneractive.sdk.model.vast.h.Static.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[com.fyber.inneractive.sdk.model.vast.h.Html.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
b[com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
b[com.fyber.inneractive.sdk.model.vast.h.Iframe.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr2 = new int[UnitDisplayType.values().length];
a = iArr2;
try {
iArr2[UnitDisplayType.INTERSTITIAL.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
a[UnitDisplayType.REWARDED.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
}
}
public c(Context context, com.fyber.inneractive.sdk.flow.vast.b bVar, com.fyber.inneractive.sdk.model.vast.h hVar, com.fyber.inneractive.sdk.web.a aVar) {
a(bVar.c(), bVar.e());
try {
this.a = a(aVar, hVar, com.fyber.inneractive.sdk.util.j.a(bVar.c(), IAConfigManager.c().a()));
a(hVar);
if (this.a.f() != null) {
b0.b().a(context, this.a.f(), this.a);
}
this.a.i();
q0 a2 = com.fyber.inneractive.sdk.renderers.h.a(bVar.d(), bVar.a(), bVar.b());
this.a.setAdDefaultSize(a2.a, a2.b);
} catch (Throwable unused) {
this.a = null;
}
}
public final g0 a(com.fyber.inneractive.sdk.web.a aVar, com.fyber.inneractive.sdk.model.vast.h hVar, boolean z) {
if (hVar == com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card) {
return new com.fyber.inneractive.sdk.web.b(aVar, z);
}
return new IAmraidWebViewController(null, null, this.d, this.b, j.h.AD_CONTROLLED, z, true);
}
public final void b() {
com.fyber.inneractive.sdk.web.h hVar;
g0 g0Var = this.a;
if (g0Var == null || (hVar = g0Var.b) == null) {
return;
}
WebSettings settings = hVar.getSettings();
settings.setMediaPlaybackRequiresUserGesture(false);
settings.setLoadWithOverviewMode(true);
settings.setUseWideViewPort(true);
}
public final com.fyber.inneractive.sdk.web.h a() {
g0 g0Var = this.a;
if (g0Var == null) {
return null;
}
return g0Var.b;
}
public final void a(String str, f.b bVar, boolean z) {
String str2;
if (this.a != null && !TextUtils.isEmpty(str)) {
g0 g0Var = this.a;
UnitDisplayType unitDisplayType = this.c;
g0Var.setAutoplayMRAIDVideos(unitDisplayType != null && unitDisplayType.isFullscreenUnit());
this.a.setCenteringTagsRequired(false);
g0 g0Var2 = this.a;
int i = com.fyber.inneractive.sdk.config.g.a;
String property = System.getProperty("ia.testEnvironmentConfiguration.name");
if (TextUtils.isEmpty(property)) {
str2 = "wv.inner-active.mobi/simpleM2M/";
} else {
str2 = property + ".inner-active.mobi/simpleM2M/";
}
String str3 = str2;
UnitDisplayType unitDisplayType2 = this.c;
boolean z2 = this.e;
StringBuilder sb = new StringBuilder();
if (unitDisplayType2 != null && unitDisplayType2.isFullscreenUnit() && !z2) {
sb.append("<script type=\"text/javascript\"> var IaCloseBtnHelper = (function initIaCloseBtnHelper(){ var styleContent = '.celtra-close-button {display:none !important;} .close-button {display:none !important;}'; function getStyle(doc){ var style = doc.createElement('style'); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = styleContent; } else { style.appendChild(doc.createTextNode(styleContent)); } return style; } function onDomReady(){ var iframes = window.document.getElementsByTagName('iframe'), i = 0, len = iframes && iframes.length || 0; for(; i < len; ++i){ if(!iframes[i].src){ try { iframes[i].contentDocument.body.appendChild(getStyle(iframes[i].contentDocument)); }catch(e){ }}}} function registerWindowEvents(){ window.addEventListener('load', function onWindowLoad(){ window.removeEventListener('load', onWindowLoad); onDomReady(); }); } return { init: function init(){ if(window.document.readyState != 'complete'){ registerWindowEvents(); }else{ onDomReady(); }}}})(); IaCloseBtnHelper.init();</script>");
}
String sb2 = sb.toString();
UnitDisplayType unitDisplayType3 = this.c;
StringBuilder sb3 = new StringBuilder();
if (unitDisplayType3 != null && !unitDisplayType3.isFullscreenUnit()) {
if (unitDisplayType3 == UnitDisplayType.BANNER) {
sb3.append(" body {display: flex;} #iawrapper { position:unset !important; display: unset !important; } ");
} else {
sb3.append(" #iawrapper { position:unset !important; display: unset !important; }");
}
}
String sb4 = sb3.toString();
g0Var2.f = bVar;
try {
g0Var2.h();
com.fyber.inneractive.sdk.web.e eVar = new com.fyber.inneractive.sdk.web.e(g0Var2, str, z, sb2, sb4, str3);
g0Var2.o = eVar;
eVar.b(null);
return;
} catch (Throwable th) {
g0Var2.a(new InneractiveInfrastructureError(InneractiveErrorCode.SDK_INTERNAL_ERROR, com.fyber.inneractive.sdk.flow.g.COULD_NOT_CONFIGURE_WEBVIEW, th));
return;
}
}
bVar.a(new InneractiveInfrastructureError(InneractiveErrorCode.UNSPECIFIED, com.fyber.inneractive.sdk.flow.g.NO_WEBVIEW_CONTROLLER_AVAILABLE));
}
public final void a(UnitDisplayType unitDisplayType, boolean z) {
this.c = unitDisplayType;
this.e = z;
int i = a.a[unitDisplayType.ordinal()];
if (i != 1 && i != 2) {
this.d = j.d.ENABLED;
return;
}
this.d = j.d.ENABLED;
if (z) {
this.b = j.g.INTERSTITIAL;
}
}
public final void a(com.fyber.inneractive.sdk.model.vast.h hVar) {
g0 g0Var = this.a;
com.fyber.inneractive.sdk.web.h hVar2 = g0Var != null ? g0Var.b : null;
if (hVar2 == null) {
return;
}
int i = a.b[hVar.ordinal()];
if (i == 1) {
hVar2.setId(R.id.ia_inneractive_vast_endcard_gif);
return;
}
if (i == 2 || i == 3) {
hVar2.setId(R.id.ia_inneractive_vast_endcard_html);
} else {
if (i != 4) {
return;
}
hVar2.setId(R.id.ia_inneractive_vast_endcard_iframe);
}
}
}

View File

@@ -0,0 +1,484 @@
package com.fyber.inneractive.sdk.player.controller;
import android.content.Context;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.Surface;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.player.cache.d;
import com.fyber.inneractive.sdk.player.exoplayer2.audio.MediaCodecAudioRenderer;
import com.fyber.inneractive.sdk.player.exoplayer2.e;
import com.fyber.inneractive.sdk.player.exoplayer2.video.MediaCodecVideoRenderer;
import com.fyber.inneractive.sdk.util.IAlog;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/* loaded from: classes2.dex */
public final class d extends i implements d.b, d.c {
public final boolean A;
public Bitmap B;
public int C;
public String D;
public final CopyOnWriteArrayList E;
public com.fyber.inneractive.sdk.player.exoplayer2.source.p F;
public boolean G;
public int H;
public final int p;
public final com.fyber.inneractive.sdk.config.global.s q;
public final int r;
public com.fyber.inneractive.sdk.player.exoplayer2.e s;
public int t;
public int u;
public boolean v;
public com.fyber.inneractive.sdk.player.exoplayer2.o[] w;
public Handler x;
public w y;
public boolean z;
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = d.this.s;
if (eVar != null) {
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar;
gVar.a((gVar.n.c() || gVar.l > 0) ? gVar.s : gVar.n.a(gVar.r.a, gVar.h, false).c, C.TIME_UNSET);
((com.fyber.inneractive.sdk.player.exoplayer2.g) d.this.s).e.f.sendEmptyMessage(5);
com.fyber.inneractive.sdk.player.exoplayer2.g gVar2 = (com.fyber.inneractive.sdk.player.exoplayer2.g) d.this.s;
gVar2.e.c();
gVar2.d.removeCallbacksAndMessages(null);
d.this.s = null;
}
}
}
public d(Context context, boolean z, com.fyber.inneractive.sdk.config.global.s sVar) {
super(context);
this.t = 0;
this.u = 0;
this.v = false;
this.z = false;
this.E = new CopyOnWriteArrayList();
this.F = null;
this.H = 0;
this.A = z;
this.q = sVar;
this.r = IAConfigManager.c().a().a(6, 3, "extractor_source_retry_count");
com.fyber.inneractive.sdk.config.global.features.r rVar = sVar != null ? (com.fyber.inneractive.sdk.config.global.features.r) sVar.a(com.fyber.inneractive.sdk.config.global.features.r.class) : null;
this.p = rVar == null ? 0 : rVar.h();
IAlog.a("Creating IAExoPlayer2Controller", new Object[0]);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final boolean a() {
return this.A;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b(boolean z) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar;
c(true);
this.n = z;
com.fyber.inneractive.sdk.player.exoplayer2.o[] oVarArr = this.w;
if (oVarArr == null || (eVar = this.s) == null || this.z || oVarArr.length < 2) {
return;
}
e.c[] cVarArr = {new e.c(oVarArr[1], 2, Float.valueOf(0.0f))};
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = ((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).e;
if (hVar.q) {
Log.w("ExoPlayerImplInternal", "Ignoring messages sent after release.");
} else {
hVar.f.obtainMessage(11, cVarArr).sendToTarget();
}
this.v = true;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void d(boolean z) {
c(false);
this.n = z;
if (this.s == null || this.z) {
return;
}
AudioManager audioManager = (AudioManager) this.a.getSystemService("audio");
int streamVolume = audioManager.getStreamVolume(3);
int streamMaxVolume = audioManager.getStreamMaxVolume(3);
float f = streamVolume / streamMaxVolume;
IAlog.a(" unmute maxVolume = %d currentVolume = %d targetVolume = %s", Integer.valueOf(streamMaxVolume), Integer.valueOf(streamVolume), Float.valueOf(f));
if (f == 0.0f) {
f = 0.1f;
}
com.fyber.inneractive.sdk.player.exoplayer2.o[] oVarArr = this.w;
if (oVarArr != null && oVarArr.length >= 2) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
e.c[] cVarArr = {new e.c(oVarArr[1], 2, Float.valueOf(f))};
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = ((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).e;
if (hVar.q) {
Log.w("ExoPlayerImplInternal", "Ignoring messages sent after release.");
} else {
hVar.f.obtainMessage(11, cVarArr).sendToTarget();
}
}
this.v = false;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final Bitmap e() {
return this.B;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final String f() {
return this.A ? "exo_c" : "exo";
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int g() {
return this.u;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int h() {
return this.t;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final boolean i() {
return this.v;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(Surface surface) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar;
IAlog.a("%ssetSurface called with %s", IAlog.a(this), surface);
com.fyber.inneractive.sdk.player.exoplayer2.o[] oVarArr = this.w;
if (oVarArr == null || (eVar = this.s) == null || this.z) {
return;
}
e.c[] cVarArr = {new e.c(oVarArr[0], 1, surface)};
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = ((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).e;
if (hVar.q) {
Log.w("ExoPlayerImplInternal", "Ignoring messages sent after release.");
} else {
hVar.f.obtainMessage(11, cVarArr).sendToTarget();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int c() {
long j;
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
if (eVar == null || this.z) {
return 0;
}
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar;
if (gVar.n.c() || gVar.l > 0) {
j = gVar.t;
} else {
gVar.n.a(gVar.r.a, gVar.h, false);
j = com.fyber.inneractive.sdk.player.exoplayer2.b.a(gVar.r.c) + com.fyber.inneractive.sdk.player.exoplayer2.b.a(gVar.h.e);
}
return (int) j;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final boolean j() {
return (this.s == null || this.z || this.e != com.fyber.inneractive.sdk.player.enums.b.Playing) ? false : true;
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void k() {
com.fyber.inneractive.sdk.player.enums.b bVar;
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
com.fyber.inneractive.sdk.player.enums.b bVar2 = this.e;
if (bVar2 == com.fyber.inneractive.sdk.player.enums.b.Idle || bVar2 == com.fyber.inneractive.sdk.player.enums.b.Completed || bVar2 == (bVar = com.fyber.inneractive.sdk.player.enums.b.Paused) || bVar2 == com.fyber.inneractive.sdk.player.enums.b.Prepared) {
IAlog.a("%s paused called when player is in mState: %s ignoring", IAlog.a(this), bVar2);
return;
}
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
if (eVar != null && !this.z) {
((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).a(false);
}
com.fyber.inneractive.sdk.player.d dVar = this.h;
if (dVar != null && (scheduledThreadPoolExecutor = dVar.b) != null) {
scheduledThreadPoolExecutor.shutdownNow();
dVar.b = null;
}
a(bVar);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void l() {
IAlog.a("%sstart called", IAlog.a(this));
if (j()) {
return;
}
a(com.fyber.inneractive.sdk.player.enums.b.Start_in_progress);
((com.fyber.inneractive.sdk.player.exoplayer2.g) this.s).a(true);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void a(boolean z) {
if (this.s != null || this.z) {
return;
}
this.G = z;
IAlog.a("%sMediaPlayerController: creating media player", IAlog.a(this));
w wVar = this.y;
if (wVar != null) {
wVar.a.clear();
}
this.y = new w(this);
this.x = new Handler(Looper.getMainLooper());
com.fyber.inneractive.sdk.player.exoplayer2.o[] oVarArr = new com.fyber.inneractive.sdk.player.exoplayer2.o[z ? 2 : 1];
this.w = oVarArr;
oVarArr[0] = new MediaCodecVideoRenderer(this.x, this.y);
if (z) {
this.w[1] = new MediaCodecAudioRenderer(0);
}
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = new com.fyber.inneractive.sdk.player.exoplayer2.g(this.w, new com.fyber.inneractive.sdk.player.exoplayer2.trackselection.b(0), new com.fyber.inneractive.sdk.player.exoplayer2.c(new com.fyber.inneractive.sdk.player.exoplayer2.upstream.j(0), 0));
this.s = gVar;
gVar.f.add(this.y);
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b() {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
if (this.s != null) {
if (!this.z) {
this.z = true;
com.fyber.inneractive.sdk.util.p.a.execute(new a());
}
w wVar = this.y;
if (wVar != null) {
wVar.a.clear();
}
this.y = null;
}
Iterator it = this.E.iterator();
while (it.hasNext()) {
com.fyber.inneractive.sdk.player.cache.j jVar = (com.fyber.inneractive.sdk.player.cache.j) it.next();
jVar.a(jVar.o);
com.fyber.inneractive.sdk.player.cache.p.f.d.remove(jVar.a());
}
this.E.clear();
IAlog.a("%sdestroy started", IAlog.a(this));
com.fyber.inneractive.sdk.player.d dVar = this.h;
if (dVar != null && (scheduledThreadPoolExecutor = dVar.b) != null) {
scheduledThreadPoolExecutor.shutdownNow();
dVar.b = null;
}
this.h = null;
this.i.removeCallbacksAndMessages(null);
this.b.clear();
this.f = null;
this.g = true;
IAlog.a("%sdestroy finished", IAlog.a(this));
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final int d() {
int i;
long a2;
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
if (eVar == null || this.z) {
return 0;
}
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar;
if (gVar.n.c()) {
a2 = C.TIME_UNSET;
} else {
com.fyber.inneractive.sdk.player.exoplayer2.q qVar = gVar.n;
if (!qVar.c() && gVar.l <= 0) {
i = gVar.n.a(gVar.r.a, gVar.h, false).c;
} else {
i = gVar.s;
}
a2 = com.fyber.inneractive.sdk.player.exoplayer2.b.a(qVar.a(i, gVar.g, 0L).f);
}
return (int) a2;
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:19:0x00be */
/* JADX WARN: Removed duplicated region for block: B:23:0x00d0 */
/* JADX WARN: Removed duplicated region for block: B:26:0x00a2 */
/* JADX WARN: Type inference failed for: r11v4, types: [com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.e] */
/* JADX WARN: Type inference failed for: r1v2, types: [com.fyber.inneractive.sdk.player.cache.e] */
@Override // com.fyber.inneractive.sdk.player.controller.i
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(java.lang.String r10, int r11) {
/*
r9 = this;
com.fyber.inneractive.sdk.player.exoplayer2.e r0 = r9.s
if (r0 == 0) goto Lde
boolean r0 = r9.z
if (r0 != 0) goto Lde
java.lang.String r0 = com.fyber.inneractive.sdk.util.IAlog.a(r9)
java.lang.Object[] r0 = new java.lang.Object[]{r0, r10}
java.lang.String r1 = "%sloadMediaPlayerUri called with %s"
com.fyber.inneractive.sdk.util.IAlog.a(r1, r0)
r9.D = r10
r9.C = r11
android.net.Uri r3 = android.net.Uri.parse(r10)
int r10 = com.fyber.inneractive.sdk.player.exoplayer2.util.s.a
java.lang.String r10 = r3.getPath()
r0 = 2
r1 = 0
if (r10 != 0) goto L28
goto L61
L28:
java.lang.String r10 = r10.toLowerCase()
java.lang.String r2 = ".mpd"
boolean r2 = r10.endsWith(r2)
if (r2 == 0) goto L36
r10 = r1
goto L64
L36:
java.lang.String r2 = ".m3u8"
boolean r2 = r10.endsWith(r2)
if (r2 == 0) goto L40
r10 = r0
goto L64
L40:
java.lang.String r2 = ".ism"
boolean r2 = r10.endsWith(r2)
if (r2 != 0) goto L63
java.lang.String r2 = ".isml"
boolean r2 = r10.endsWith(r2)
if (r2 != 0) goto L63
java.lang.String r2 = ".ism/manifest"
boolean r2 = r10.endsWith(r2)
if (r2 != 0) goto L63
java.lang.String r2 = ".isml/manifest"
boolean r10 = r10.endsWith(r2)
if (r10 == 0) goto L61
goto L63
L61:
r10 = 3
goto L64
L63:
r10 = 1
L64:
boolean r2 = r9.A
if (r2 == 0) goto L7f
com.fyber.inneractive.sdk.player.cache.p r2 = com.fyber.inneractive.sdk.player.cache.p.f
boolean r2 = r2.c
if (r2 == 0) goto L7f
boolean r2 = com.fyber.inneractive.sdk.util.s.a()
if (r2 == 0) goto L7f
if (r10 == r0) goto L7f
com.fyber.inneractive.sdk.player.cache.e r1 = new com.fyber.inneractive.sdk.player.cache.e
com.fyber.inneractive.sdk.config.global.s r2 = r9.q
r1.<init>(r9, r9, r11, r2)
r4 = r1
goto Lbc
L7f:
com.fyber.inneractive.sdk.player.exoplayer2.upstream.k r11 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.k
r11.<init>(r1)
com.fyber.inneractive.sdk.player.exoplayer2.upstream.o r2 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.o
com.fyber.inneractive.sdk.config.IAConfigManager r4 = com.fyber.inneractive.sdk.config.IAConfigManager.L
com.fyber.inneractive.sdk.util.z0 r4 = r4.x
java.lang.String r4 = r4.a()
r2.<init>(r4, r11)
com.fyber.inneractive.sdk.player.exoplayer2.upstream.m r4 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.m
android.content.Context r5 = r9.a
r4.<init>(r5, r11, r2)
android.content.Context r11 = r9.a
java.lang.String r2 = "ia-vid-cache-ex2"
java.io.File r11 = com.fyber.inneractive.sdk.player.cache.p.a(r11, r2)
if (r11 == 0) goto Lbc
com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.j r2 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.j
r2.<init>()
com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.l r5 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.l
r5.<init>(r11, r2)
com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.e r11 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.e
com.fyber.inneractive.sdk.player.exoplayer2.upstream.q r2 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.q
r2.<init>(r1)
com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.c r6 = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.cache.c
r6.<init>(r5, r1)
r11.<init>(r5, r4, r2, r6)
r4 = r11
Lbc:
if (r10 == r0) goto Ld0
com.fyber.inneractive.sdk.player.exoplayer2.source.n r10 = new com.fyber.inneractive.sdk.player.exoplayer2.source.n
com.fyber.inneractive.sdk.player.exoplayer2.extractor.c r5 = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.c
r5.<init>()
int r6 = r9.r
android.os.Handler r7 = r9.x
com.fyber.inneractive.sdk.player.controller.w r8 = r9.y
r2 = r10
r2.<init>(r3, r4, r5, r6, r7, r8)
goto Ld9
Ld0:
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.h r10 = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.h
android.os.Handler r11 = r9.x
com.fyber.inneractive.sdk.player.controller.w r0 = r9.y
r10.<init>(r3, r4, r11, r0)
Ld9:
r9.F = r10
r9.a(r10)
Lde:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.controller.d.a(java.lang.String, int):void");
}
@Override // com.fyber.inneractive.sdk.player.controller.i
public final void b(int i) {
int i2;
IAlog.a("%sseekTo called with %d playAfterSeek = %s", IAlog.a(this), Integer.valueOf(i), Boolean.TRUE);
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
if (eVar == null || this.z) {
return;
}
((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).a(true);
long j = i;
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) this.s;
if (!gVar.n.c() && gVar.l <= 0) {
i2 = gVar.n.a(gVar.r.a, gVar.h, false).c;
} else {
i2 = gVar.s;
}
gVar.a(i2, j);
}
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.p pVar) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = this.s;
if (eVar == null || pVar == null) {
return;
}
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar;
if (!gVar.n.c() || gVar.o != null) {
gVar.n = com.fyber.inneractive.sdk.player.exoplayer2.q.a;
gVar.o = null;
Iterator<e.a> it = gVar.f.iterator();
while (it.hasNext()) {
it.next().d();
}
}
if (gVar.i) {
gVar.i = false;
com.fyber.inneractive.sdk.player.exoplayer2.source.u uVar = com.fyber.inneractive.sdk.player.exoplayer2.source.u.d;
gVar.p = gVar.c;
gVar.b.a(null);
Iterator<e.a> it2 = gVar.f.iterator();
while (it2.hasNext()) {
it2.next().e();
}
}
gVar.m++;
gVar.e.f.obtainMessage(0, 1, 0, pVar).sendToTarget();
a(com.fyber.inneractive.sdk.player.enums.b.Preparing);
}
}

View File

@@ -0,0 +1,322 @@
package com.fyber.inneractive.sdk.player.controller;
import android.annotation.SuppressLint;
import android.media.AudioManager;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.Skip;
import com.fyber.inneractive.sdk.config.enums.TapAction;
import com.fyber.inneractive.sdk.config.f0;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.p0;
/* loaded from: classes2.dex */
public final class e extends o<y> {
public final boolean C;
public boolean D;
public final boolean E;
public e(com.fyber.inneractive.sdk.player.e eVar, com.fyber.inneractive.sdk.player.ui.s sVar, f0 f0Var, com.fyber.inneractive.sdk.config.global.s sVar2, boolean z, Skip skip, boolean z2, String str, boolean z3) {
super(eVar, sVar, f0Var, sVar2, z, skip, str, z3);
this.D = false;
this.C = false;
this.E = z2;
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.controller.b
public final void e(boolean z) {
i iVar;
com.fyber.inneractive.sdk.player.enums.b bVar;
super.e(z);
if (this.C) {
this.d.o();
this.d.h(false);
this.f = 0;
}
w();
com.fyber.inneractive.sdk.player.c cVar = this.a;
this.d.d((cVar == null || (iVar = cVar.b) == null || ((bVar = iVar.e) != com.fyber.inneractive.sdk.player.enums.b.Preparing && bVar != com.fyber.inneractive.sdk.player.enums.b.Prepared)) ? false : true);
this.d.f(false);
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
com.fyber.inneractive.sdk.player.ui.c cVar2 = new com.fyber.inneractive.sdk.player.ui.c();
cVar2.b = false;
sVar.c(new com.fyber.inneractive.sdk.player.ui.b(cVar2));
}
@Override // com.fyber.inneractive.sdk.player.controller.o
@SuppressLint({"NewApi"})
public final void j() {
int i;
int i2;
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
i iVar2;
AudioManager audioManager;
super.j();
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (cVar2 != null && cVar2.b != null && !this.D) {
try {
audioManager = (AudioManager) this.d.getContext().getSystemService("audio");
i = audioManager.getRingerMode();
} catch (Throwable unused) {
i = 0;
}
try {
i2 = audioManager.getStreamVolume(2);
} catch (Throwable unused2) {
i2 = 0;
if (this.C) {
}
if (i2 > 0) {
IAlog.a("%s setting default volume. unmuting player", IAlog.a(this));
cVar = this.a;
if (cVar != null) {
iVar.d(false);
}
this.d.setMuteButtonState(false);
}
this.d.setMuteButtonState(o());
this.D = true;
h(false);
}
if ((this.C && ((e0) this.b).f.d.booleanValue()) || this.E || o()) {
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null && (iVar2 = cVar3.b) != null) {
iVar2.b(false);
}
this.d.setMuteButtonState(true);
} else if (i2 > 0 && i == 2) {
IAlog.a("%s setting default volume. unmuting player", IAlog.a(this));
cVar = this.a;
if (cVar != null && (iVar = cVar.b) != null) {
iVar.d(false);
}
this.d.setMuteButtonState(false);
}
this.d.setMuteButtonState(o());
this.D = true;
}
h(false);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final int m() {
return IAConfigManager.L.t.b.a(12, 1, "VideoFullscreenBufferingTimeout") * 1000;
}
/* JADX WARN: Can't wrap try/catch for region: R(16:0|1|(2:5|(13:7|8|(2:10|(1:51))(1:52)|13|14|15|(6:17|18|(1:23)|(1:(1:(2:34|(1:39)(2:37|38)))(2:27|28))(1:(2:43|(1:45)(2:46|47)))|32|33)|49|18|(2:21|23)|(0)(0)|32|33))|53|8|(0)(0)|13|14|15|(0)|49|18|(0)|(0)(0)|32|33) */
/* JADX WARN: Removed duplicated region for block: B:10:0x0038 */
/* JADX WARN: Removed duplicated region for block: B:17:0x0067 A[Catch: Exception -> 0x0074, TRY_LEAVE, TryCatch #0 {Exception -> 0x0074, blocks: (B:15:0x005f, B:17:0x0067), top: B:14:0x005f }] */
/* JADX WARN: Removed duplicated region for block: B:20:0x007b A[ADDED_TO_REGION] */
/* JADX WARN: Removed duplicated region for block: B:25:0x0087 */
/* JADX WARN: Removed duplicated region for block: B:41:0x00a7 */
/* JADX WARN: Removed duplicated region for block: B:52:0x0045 */
@Override // com.fyber.inneractive.sdk.player.controller.o
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final int n() {
/*
r10 = this;
com.fyber.inneractive.sdk.config.global.s r0 = r10.c
if (r0 == 0) goto L31
java.lang.Class<com.fyber.inneractive.sdk.config.global.features.b> r1 = com.fyber.inneractive.sdk.config.global.features.b.class
com.fyber.inneractive.sdk.config.global.features.g r0 = r0.a(r1)
if (r0 == 0) goto L31
com.fyber.inneractive.sdk.config.global.s r0 = r10.c
com.fyber.inneractive.sdk.config.global.features.g r0 = r0.a(r1)
com.fyber.inneractive.sdk.config.global.features.b r0 = (com.fyber.inneractive.sdk.config.global.features.b) r0
r0.getClass()
java.util.ArrayList r2 = new java.util.ArrayList
java.util.HashMap r0 = r0.c
java.util.Collection r0 = r0.values()
r2.<init>(r0)
int r0 = r2.size()
if (r0 <= 0) goto L31
com.fyber.inneractive.sdk.config.global.s r0 = r10.c
com.fyber.inneractive.sdk.config.global.features.g r0 = r0.a(r1)
com.fyber.inneractive.sdk.config.global.features.b r0 = (com.fyber.inneractive.sdk.config.global.features.b) r0
goto L32
L31:
r0 = 0
L32:
r1 = 8
r2 = 5
r3 = -1
if (r0 == 0) goto L45
java.lang.String r4 = "skip_time_sec"
int r0 = r0.a(r4, r2)
if (r0 < 0) goto L43
if (r0 > r1) goto L43
goto L46
L43:
r0 = r2
goto L46
L45:
r0 = r3
L46:
com.fyber.inneractive.sdk.config.IAConfigManager r4 = com.fyber.inneractive.sdk.config.IAConfigManager.L
com.fyber.inneractive.sdk.config.m r4 = r4.t
com.fyber.inneractive.sdk.config.k r4 = r4.b
com.fyber.inneractive.sdk.config.f0 r5 = r10.b
com.fyber.inneractive.sdk.config.enums.Skip r6 = r10.A
boolean r7 = com.fyber.inneractive.sdk.external.InneractiveAdManager.isCurrentUserAChild()
java.lang.String r8 = "vast_configuration"
com.fyber.inneractive.sdk.config.h r4 = r4.a(r8)
java.lang.String r8 = "skip_d"
r4.getClass()
java.util.HashMap r9 = r4.a // Catch: java.lang.Exception -> L74
boolean r9 = r9.containsKey(r8) // Catch: java.lang.Exception -> L74
if (r9 == 0) goto L74
java.util.HashMap r4 = r4.a // Catch: java.lang.Exception -> L74
java.lang.Object r4 = r4.get(r8) // Catch: java.lang.Exception -> L74
java.lang.String r4 = (java.lang.String) r4 // Catch: java.lang.Exception -> L74
int r4 = java.lang.Integer.parseInt(r4) // Catch: java.lang.Exception -> L74
goto L75
L74:
r4 = r3
L75:
int r4 = java.lang.Math.max(r4, r3)
if (r6 != 0) goto L85
if (r5 == 0) goto L85
com.fyber.inneractive.sdk.config.e0 r5 = (com.fyber.inneractive.sdk.config.e0) r5
com.fyber.inneractive.sdk.config.g0 r5 = r5.f
if (r5 == 0) goto L85
com.fyber.inneractive.sdk.config.enums.Skip r6 = r5.h
L85:
if (r7 == 0) goto La7
if (r0 <= r3) goto L8d
if (r0 > r1) goto L8d
r2 = r0
goto Lbd
L8d:
if (r4 <= r3) goto L92
if (r4 > r1) goto L92
goto Lab
L92:
java.lang.Integer r0 = r6.value()
int r0 = r0.intValue()
if (r0 <= r3) goto Lbd
if (r0 > r1) goto Lbd
java.lang.Integer r0 = r6.value()
int r2 = r0.intValue()
goto Lbd
La7:
if (r4 <= r3) goto Lad
if (r4 > r2) goto Lad
Lab:
r2 = r4
goto Lbd
Lad:
com.fyber.inneractive.sdk.config.enums.Skip r0 = com.fyber.inneractive.sdk.config.enums.Skip.DEFAULT
if (r6 != r0) goto Lb5
r2 = 99999(0x1869f, float:1.40128E-40)
goto Lbd
Lb5:
java.lang.Integer r0 = r6.value()
int r2 = r0.intValue()
Lbd:
return r2
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.controller.e.n():int");
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void s() {
this.d.h(true);
w();
l();
j();
h(true);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void u() {
super.u();
this.d.d(false);
if (this.C) {
this.d.o();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final boolean v() {
return !this.C;
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void x() {
i iVar;
super.x();
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null || !iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed) || !this.C) {
return;
}
this.d.o();
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.ui.m
public final void a(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
if (z && (cVar = this.a) != null && (iVar = cVar.b) != null && !iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed) && !this.d.i()) {
h(false);
}
super.a(z);
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.ui.m
public final void b() {
if (!this.h) {
j();
return;
}
if (this.d.i()) {
return;
}
this.d.a(false);
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
x();
this.k = false;
this.h = true;
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void q() {
ListenerT listenert = this.g;
if (listenert != 0) {
listenert.q();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void p() {
this.u = true;
IAlog.a("%s onBufferingTimeout reached. Skipping to end card", IAlog.a(this));
b(false);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void a(p0 p0Var) {
com.fyber.inneractive.sdk.player.ui.s sVar;
TapAction tapAction = ((e0) this.b).f.i;
if (tapAction == TapAction.CTR) {
a(false, VideoClickOrigin.VIDEO, p0Var);
return;
}
if (tapAction != TapAction.FULLSCREEN && tapAction != TapAction.DO_NOTHING) {
IAlog.a("% sonVideoClicked called, but we recieved an unknown tap action %s", IAlog.a(this), tapAction);
return;
}
if (((com.fyber.inneractive.sdk.config.global.features.r) this.c.a(com.fyber.inneractive.sdk.config.global.features.r.class)).d().equals(r.b.OPEN) || ((this.w != com.fyber.inneractive.sdk.ignite.l.NONE && IAConfigManager.L.D.m()) || ((sVar = this.d) != null && sVar.a()))) {
a(false, VideoClickOrigin.VIDEO, p0Var);
}
}
}

View File

@@ -0,0 +1,86 @@
package com.fyber.inneractive.sdk.player.controller;
import android.graphics.SurfaceTexture;
import android.view.Surface;
import android.view.TextureView;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.util.IAlog;
/* loaded from: classes2.dex */
public final class f implements TextureView.SurfaceTextureListener {
public final /* synthetic */ i a;
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
i.f fVar = f.this.a.d;
if (fVar != null) {
((n) fVar).a.d.post(new m());
}
}
}
public f(i iVar) {
this.a = iVar;
}
@Override // android.view.TextureView.SurfaceTextureListener
public final void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
i iVar = this.a;
iVar.getClass();
IAlog.a("%sonSurfaceTextureAvailable", IAlog.a(iVar));
i.a(this.a, surfaceTexture);
i.f fVar = this.a.d;
if (fVar != null) {
o oVar = ((n) fVar).a;
oVar.getClass();
IAlog.a("%sonSurfaceTextureAvailable", IAlog.a(oVar));
}
}
@Override // android.view.TextureView.SurfaceTextureListener
public final boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
i iVar = this.a;
iVar.getClass();
IAlog.a("%s onSurfaceTextureDestroyed", IAlog.a(iVar));
this.a.k();
this.a.a((Surface) null);
i iVar2 = this.a;
iVar2.o = true;
com.fyber.inneractive.sdk.player.enums.b bVar = iVar2.e;
if (bVar == com.fyber.inneractive.sdk.player.enums.b.Completed || bVar == com.fyber.inneractive.sdk.player.enums.b.Error || bVar == com.fyber.inneractive.sdk.player.enums.b.Idle) {
IAlog.a("%sReleasing surface texture", IAlog.a(iVar2));
this.a.k = null;
return true;
}
IAlog.a("%s caching surface texture", IAlog.a(iVar2));
i iVar3 = this.a;
iVar3.k = surfaceTexture;
iVar3.i.post(new a());
return false;
}
@Override // android.view.TextureView.SurfaceTextureListener
public final void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
}
@Override // android.view.TextureView.SurfaceTextureListener
public final void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
Surface surface;
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
i.f fVar = this.a.d;
if (fVar != null && (cVar = ((n) fVar).a.a) != null && (iVar = cVar.b) != null) {
iVar.i.post(new j(iVar));
}
i iVar2 = this.a;
if (!iVar2.o || (surface = iVar2.l) == null) {
return;
}
iVar2.a(surface);
this.a.o = false;
}
}

View File

@@ -0,0 +1,37 @@
package com.fyber.inneractive.sdk.player.controller;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.player.mediaplayer.a;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.Iterator;
/* loaded from: classes2.dex */
public final class g implements Runnable {
public final /* synthetic */ Exception a;
public final /* synthetic */ i b;
public g(i iVar, a.l lVar) {
this.b = iVar;
this.a = lVar;
}
@Override // java.lang.Runnable
public final void run() {
i iVar = this.b;
if (iVar.g) {
return;
}
try {
Iterator it = iVar.b.iterator();
while (it.hasNext()) {
((i.e) it.next()).a(this.a);
}
} catch (Exception e) {
if (IAlog.a <= 3) {
i iVar2 = this.b;
iVar2.getClass();
IAlog.a("%sonPlayerError callback threw an exception!", e, IAlog.a(iVar2));
}
}
}
}

View File

@@ -0,0 +1,36 @@
package com.fyber.inneractive.sdk.player.controller;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.Iterator;
/* loaded from: classes2.dex */
public final class h implements Runnable {
public final /* synthetic */ boolean a;
public final /* synthetic */ i b;
public h(i iVar, boolean z) {
this.b = iVar;
this.a = z;
}
@Override // java.lang.Runnable
public final void run() {
i iVar = this.b;
if (iVar.g) {
return;
}
try {
Iterator it = iVar.b.iterator();
while (it.hasNext()) {
((i.e) it.next()).c(this.a);
}
} catch (Exception e) {
if (IAlog.a <= 3) {
i iVar2 = this.b;
iVar2.getClass();
IAlog.a("%sonPlayerError callback threw an exception!", e, IAlog.a(iVar2));
}
}
}
}

View File

@@ -0,0 +1,352 @@
package com.fyber.inneractive.sdk.player.controller;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.SurfaceTexture;
import android.os.Handler;
import android.view.Surface;
import android.view.TextureView;
import com.fyber.inneractive.sdk.player.c;
import com.fyber.inneractive.sdk.player.mediaplayer.a;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/* loaded from: classes2.dex */
public abstract class i implements a.k {
public final Context a;
public f d;
public c f;
public boolean g;
public final Handler i;
public TextureView j;
public SurfaceTexture k;
public Surface l;
public com.fyber.inneractive.sdk.player.controller.f m;
public boolean o;
public com.fyber.inneractive.sdk.player.enums.b e = com.fyber.inneractive.sdk.player.enums.b.Idle;
public boolean n = false;
public final CopyOnWriteArrayList b = new CopyOnWriteArrayList();
public final CopyOnWriteArrayList c = new CopyOnWriteArrayList();
public com.fyber.inneractive.sdk.player.d h = new com.fyber.inneractive.sdk.player.d(this);
public class a implements Runnable {
public final /* synthetic */ int a;
public a(int i) {
this.a = i;
}
@Override // java.lang.Runnable
public final void run() {
try {
Iterator it = i.this.c.iterator();
while (it.hasNext()) {
((d) it.next()).a(this.a);
}
} catch (Exception e) {
if (IAlog.a <= 3) {
i iVar = i.this;
iVar.getClass();
IAlog.a("%sonPlayerProgress callback threw an exception!", e, IAlog.a(iVar));
}
}
}
}
public class b implements Runnable {
public final /* synthetic */ com.fyber.inneractive.sdk.player.enums.b a;
public b(com.fyber.inneractive.sdk.player.enums.b bVar) {
this.a = bVar;
}
/* JADX WARN: Code restructure failed: missing block: B:21:0x003c, code lost:
if (r1.getParent() != null) goto L40;
*/
/* JADX WARN: Code restructure failed: missing block: B:22:0x0076, code lost:
((android.view.ViewGroup) r6.b.j.getParent()).removeView(r6.b.j);
*/
/* JADX WARN: Code restructure failed: missing block: B:43:0x0074, code lost:
if (r1.getParent() != null) goto L40;
*/
@Override // java.lang.Runnable
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void run() {
/*
r6 = this;
r0 = 0
com.fyber.inneractive.sdk.player.controller.i r1 = com.fyber.inneractive.sdk.player.controller.i.this // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
java.util.concurrent.CopyOnWriteArrayList r1 = r1.b // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
java.util.Iterator r1 = r1.iterator() // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
L9:
boolean r2 = r1.hasNext() // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
if (r2 == 0) goto L20
java.lang.Object r2 = r1.next() // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
com.fyber.inneractive.sdk.player.controller.i$e r2 = (com.fyber.inneractive.sdk.player.controller.i.e) r2 // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
com.fyber.inneractive.sdk.player.enums.b r3 = r6.a // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
r2.a(r3) // Catch: java.lang.Throwable -> L1b java.lang.Exception -> L1e
goto L9
L1b:
r1 = move-exception
goto L8e
L1e:
r1 = move-exception
goto L3f
L20:
com.fyber.inneractive.sdk.player.enums.b r1 = r6.a
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Idle
if (r1 == r2) goto L2e
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Error
if (r1 == r2) goto L2e
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Completed
if (r1 != r2) goto L8d
L2e:
com.fyber.inneractive.sdk.player.controller.i r1 = com.fyber.inneractive.sdk.player.controller.i.this
android.graphics.SurfaceTexture r2 = r1.k
if (r2 == 0) goto L87
android.view.TextureView r1 = r1.j
if (r1 == 0) goto L87
android.view.ViewParent r1 = r1.getParent()
if (r1 == 0) goto L87
goto L76
L3f:
int r2 = com.fyber.inneractive.sdk.util.IAlog.a // Catch: java.lang.Throwable -> L1b
r3 = 3
if (r2 > r3) goto L58
java.lang.String r2 = "%sonPlayerStateChanged callback threw an exception!"
r3 = 1
java.lang.Object[] r3 = new java.lang.Object[r3] // Catch: java.lang.Throwable -> L1b
com.fyber.inneractive.sdk.player.controller.i r4 = com.fyber.inneractive.sdk.player.controller.i.this // Catch: java.lang.Throwable -> L1b
r4.getClass() // Catch: java.lang.Throwable -> L1b
java.lang.String r4 = com.fyber.inneractive.sdk.util.IAlog.a(r4) // Catch: java.lang.Throwable -> L1b
r5 = 0
r3[r5] = r4 // Catch: java.lang.Throwable -> L1b
com.fyber.inneractive.sdk.util.IAlog.a(r2, r1, r3) // Catch: java.lang.Throwable -> L1b
L58:
com.fyber.inneractive.sdk.player.enums.b r1 = r6.a
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Idle
if (r1 == r2) goto L66
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Error
if (r1 == r2) goto L66
com.fyber.inneractive.sdk.player.enums.b r2 = com.fyber.inneractive.sdk.player.enums.b.Completed
if (r1 != r2) goto L8d
L66:
com.fyber.inneractive.sdk.player.controller.i r1 = com.fyber.inneractive.sdk.player.controller.i.this
android.graphics.SurfaceTexture r2 = r1.k
if (r2 == 0) goto L87
android.view.TextureView r1 = r1.j
if (r1 == 0) goto L87
android.view.ViewParent r1 = r1.getParent()
if (r1 == 0) goto L87
L76:
com.fyber.inneractive.sdk.player.controller.i r1 = com.fyber.inneractive.sdk.player.controller.i.this
android.view.TextureView r1 = r1.j
android.view.ViewParent r1 = r1.getParent()
android.view.ViewGroup r1 = (android.view.ViewGroup) r1
com.fyber.inneractive.sdk.player.controller.i r2 = com.fyber.inneractive.sdk.player.controller.i.this
android.view.TextureView r2 = r2.j
r1.removeView(r2)
L87:
com.fyber.inneractive.sdk.player.controller.i r1 = com.fyber.inneractive.sdk.player.controller.i.this
r1.j = r0
r1.k = r0
L8d:
return
L8e:
com.fyber.inneractive.sdk.player.enums.b r2 = r6.a
com.fyber.inneractive.sdk.player.enums.b r3 = com.fyber.inneractive.sdk.player.enums.b.Idle
if (r2 == r3) goto L9c
com.fyber.inneractive.sdk.player.enums.b r3 = com.fyber.inneractive.sdk.player.enums.b.Error
if (r2 == r3) goto L9c
com.fyber.inneractive.sdk.player.enums.b r3 = com.fyber.inneractive.sdk.player.enums.b.Completed
if (r2 != r3) goto Lc3
L9c:
com.fyber.inneractive.sdk.player.controller.i r2 = com.fyber.inneractive.sdk.player.controller.i.this
android.graphics.SurfaceTexture r3 = r2.k
if (r3 == 0) goto Lbd
android.view.TextureView r2 = r2.j
if (r2 == 0) goto Lbd
android.view.ViewParent r2 = r2.getParent()
if (r2 == 0) goto Lbd
com.fyber.inneractive.sdk.player.controller.i r2 = com.fyber.inneractive.sdk.player.controller.i.this
android.view.TextureView r2 = r2.j
android.view.ViewParent r2 = r2.getParent()
android.view.ViewGroup r2 = (android.view.ViewGroup) r2
com.fyber.inneractive.sdk.player.controller.i r3 = com.fyber.inneractive.sdk.player.controller.i.this
android.view.TextureView r3 = r3.j
r2.removeView(r3)
Lbd:
com.fyber.inneractive.sdk.player.controller.i r2 = com.fyber.inneractive.sdk.player.controller.i.this
r2.j = r0
r2.k = r0
Lc3:
throw r1
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.controller.i.b.run():void");
}
}
public interface c {
}
public interface d {
void a(int i);
}
public interface e {
void a(com.fyber.inneractive.sdk.player.enums.b bVar);
void a(Exception exc);
void c(boolean z);
void e();
}
public interface f {
}
public i(Context context) {
this.a = context.getApplicationContext();
this.i = new Handler(context.getMainLooper());
a(true);
}
public abstract void a(Surface surface);
public abstract void a(String str, int i);
public abstract void a(boolean z);
public abstract boolean a();
@SuppressLint({"NewApi"})
public abstract void b();
public abstract void b(int i);
public abstract void b(boolean z);
public abstract int c();
public abstract int d();
public abstract void d(boolean z);
public abstract Bitmap e();
public abstract String f();
public abstract int g();
public abstract int h();
public abstract boolean i();
public boolean j() {
return this.e == com.fyber.inneractive.sdk.player.enums.b.Playing;
}
public abstract void k();
public abstract void l();
public final void c(boolean z) {
com.fyber.inneractive.sdk.measurement.d dVar;
c cVar = this.f;
if (cVar == null || (dVar = ((c.a) cVar).a.h) == null) {
return;
}
if (z) {
if (dVar.c == null || !dVar.d) {
return;
}
IAlog.a("%s mute", "OMVideo");
try {
dVar.c.volumeChange(0.0f);
return;
} catch (Throwable th) {
dVar.a(th);
return;
}
}
if (dVar.c == null || !dVar.d) {
return;
}
IAlog.a("%s unMute", "OMVideo");
try {
dVar.c.volumeChange(1.0f);
} catch (Throwable th2) {
dVar.a(th2);
}
}
public final void a(com.fyber.inneractive.sdk.player.ui.f fVar) {
TextureView textureView = this.j;
if (textureView != fVar) {
if (textureView != null) {
textureView.setSurfaceTextureListener(null);
}
this.j = fVar;
if (this.m == null) {
this.m = new com.fyber.inneractive.sdk.player.controller.f(this);
}
if (fVar != null) {
fVar.setSurfaceTextureListener(this.m);
}
if (this.k != null) {
IAlog.a("%scalling setSurfaceTexture with cached texture", IAlog.a(this));
if (this.j.getSurfaceTexture() != null && this.j.getSurfaceTexture().equals(this.k)) {
IAlog.a("%scalling setSurfaceTexture with cached texture failed", IAlog.a(this));
} else {
IAlog.a("%scalling setSurfaceTexture with cached texture success", IAlog.a(this));
this.j.setSurfaceTexture(this.k);
}
}
}
}
public static void a(i iVar, SurfaceTexture surfaceTexture) {
boolean z = !surfaceTexture.equals(iVar.k);
iVar.k = surfaceTexture;
if (iVar.l == null || z) {
iVar.l = new Surface(iVar.k);
}
iVar.a(iVar.l);
}
public void a(int i) {
this.i.post(new a(i));
}
public final void a(com.fyber.inneractive.sdk.player.enums.b bVar) {
com.fyber.inneractive.sdk.player.d dVar;
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
if (bVar == this.e) {
return;
}
this.e = bVar;
if (bVar == com.fyber.inneractive.sdk.player.enums.b.Playing) {
com.fyber.inneractive.sdk.player.d dVar2 = this.h;
if (dVar2 != null && dVar2.b == null) {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor2 = new ScheduledThreadPoolExecutor(1);
dVar2.b = scheduledThreadPoolExecutor2;
scheduledThreadPoolExecutor2.scheduleAtFixedRate(dVar2.c, 100, 1000, TimeUnit.MILLISECONDS);
}
} else if ((bVar == com.fyber.inneractive.sdk.player.enums.b.Paused || bVar == com.fyber.inneractive.sdk.player.enums.b.Idle || bVar == com.fyber.inneractive.sdk.player.enums.b.Completed) && (dVar = this.h) != null && (scheduledThreadPoolExecutor = dVar.b) != null) {
scheduledThreadPoolExecutor.shutdownNow();
dVar.b = null;
}
this.i.post(new b(bVar));
}
}

View File

@@ -0,0 +1,30 @@
package com.fyber.inneractive.sdk.player.controller;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.Iterator;
/* loaded from: classes2.dex */
public final class j implements Runnable {
public final /* synthetic */ i a;
public j(i iVar) {
this.a = iVar;
}
@Override // java.lang.Runnable
public final void run() {
try {
Iterator it = this.a.b.iterator();
while (it.hasNext()) {
((i.e) it.next()).e();
}
} catch (Exception e) {
if (IAlog.a <= 3) {
i iVar = this.a;
iVar.getClass();
IAlog.a("%sonDrawnToSurface callback threw an exception!", e, IAlog.a(iVar));
}
}
}
}

View File

@@ -0,0 +1,350 @@
package com.fyber.inneractive.sdk.player.controller;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.TapAction;
import com.fyber.inneractive.sdk.player.controller.v;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.p0;
import com.fyber.inneractive.sdk.util.s0;
/* loaded from: classes2.dex */
public final class k extends o<v.a> implements v {
public a C;
public final float D;
public float E;
public boolean F;
public boolean G;
public boolean H;
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
k.this.h(false);
k.this.C = null;
}
}
public k(com.fyber.inneractive.sdk.player.e eVar, com.fyber.inneractive.sdk.player.ui.p pVar, e0 e0Var, com.fyber.inneractive.sdk.config.global.s sVar, boolean z, String str, boolean z2) {
super(eVar, pVar, e0Var, sVar, z, str, z2);
this.E = 0.0f;
this.F = false;
this.G = false;
this.H = false;
this.D = ((e0) this.b).b().b().intValue() / 100.0f;
B();
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.ui.m
public final void a(boolean z) {
if (z) {
a(this.E);
}
super.a(z);
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.controller.b
public final boolean c() {
return true;
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.ui.m
public final void d() {
super.d();
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.controller.b
public final void destroy() {
A();
this.g = null;
super.destroy();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
@SuppressLint({"NewApi"})
public final void j() {
super.j();
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null && cVar.b != null) {
IAlog.a("%sconnectToTextureView playing state = %s", IAlog.a(this), this.a.b.e);
if (this.a.b.j()) {
this.d.f(!this.a.j);
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
com.fyber.inneractive.sdk.player.ui.c cVar2 = new com.fyber.inneractive.sdk.player.ui.c();
cVar2.b = false;
sVar.c(new com.fyber.inneractive.sdk.player.ui.b(cVar2));
this.d.d(false);
B();
}
}
a(this.E);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void k() {
A();
super.k();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final int m() {
return IAConfigManager.L.t.b.a(5, 1, "VideoAdBufferingTimeout") * 1000;
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final int n() {
return 0;
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.controller.b
public final void pauseVideo() {
A();
super.pauseVideo();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void q() {
y();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void r() {
super.r();
A();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void t() {
z();
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void u() {
super.u();
if (((e0) this.b).f.i != TapAction.FULLSCREEN) {
this.d.p();
}
w();
this.d.d(false);
this.F = true;
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final boolean v() {
return false;
}
public final void B() {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null || iVar.n) {
return;
}
if (((e0) this.b).f.d.booleanValue()) {
this.a.b.b(false);
} else {
if (o()) {
return;
}
this.a.b.d(false);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void b(int i) {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null || iVar.e == com.fyber.inneractive.sdk.player.enums.b.Playing || this.C != null) {
return;
}
IAlog.a("%splayVideo %s", IAlog.a(this), this.d);
if (i == 0) {
h(false);
return;
}
a aVar = new a();
this.C = aVar;
this.d.postDelayed(aVar, i);
}
@Override // com.fyber.inneractive.sdk.player.controller.o, com.fyber.inneractive.sdk.player.controller.b
public final void e(boolean z) {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null && (iVar = cVar.b) != null && !iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed)) {
if (((e0) this.b).f.i != TapAction.FULLSCREEN) {
this.d.p();
}
w();
}
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
Bitmap bitmap = cVar2 != null ? cVar2.k : null;
if (bitmap != null) {
this.d.d(true);
this.d.setLastFrameBitmap(bitmap);
}
super.e(z);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void h(boolean z) {
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || cVar.b == null) {
return;
}
B();
super.h(false);
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void p() {
IAlog.a("%s onBufferingTimeout reached. Skipping to end card", IAlog.a(this));
if (this.d.e) {
this.u = true;
b(false);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void s() {
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || cVar.b == null) {
return;
}
j();
h(false);
}
public final void y() {
if (this.g == 0 || this.H) {
return;
}
A();
super.k();
((v.a) this.g).c();
IAlog.a("%sopening fullscreen", IAlog.a(this));
this.H = true;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null) {
com.fyber.inneractive.sdk.player.e eVar = (com.fyber.inneractive.sdk.player.e) cVar;
eVar.a(eVar.v, VideoClickOrigin.InvalidOrigin, com.fyber.inneractive.sdk.model.vast.v.EVENT_FULLSCREEN, com.fyber.inneractive.sdk.model.vast.v.EVENT_EXPAND);
}
}
public final void z() {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
com.fyber.inneractive.sdk.player.ui.s sVar;
if (this.E < this.D || (cVar = this.a) == null || (iVar = cVar.b) == null || iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed) || (sVar = this.d) == null || sVar.i() || this.a.b.j == null) {
return;
}
if (((e0) this.b).f.a.booleanValue() || this.F) {
b(IAConfigManager.L.i.a);
}
}
public final void A() {
if (this.C != null) {
IAlog.a("%sCancelling play runnable", IAlog.a(this));
this.d.removeCallbacks(this.C);
this.C = null;
}
}
@Override // com.fyber.inneractive.sdk.player.controller.o
public final void a(p0 p0Var) {
i iVar;
TapAction tapAction = ((e0) this.b).f.i;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || cVar.b == null || this.E >= this.D) {
if (tapAction == TapAction.CTR) {
if (a(false, VideoClickOrigin.CTA, p0Var)) {
a(false, (s0) new l(this));
return;
}
return;
}
if (tapAction == TapAction.FULLSCREEN) {
y();
return;
}
if (tapAction != TapAction.DO_NOTHING) {
IAlog.a("%sonVideoClicked called, but we recieved an unknown tap action %s", IAlog.a(this), tapAction);
return;
}
if (cVar == null || (iVar = cVar.b) == null) {
return;
}
com.fyber.inneractive.sdk.player.enums.b bVar = iVar.e;
if (bVar != com.fyber.inneractive.sdk.player.enums.b.Completed && bVar != com.fyber.inneractive.sdk.player.enums.b.Prepared) {
iVar.l();
} else {
iVar.b(1);
}
}
}
@Override // com.fyber.inneractive.sdk.player.controller.v
public final void d(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
this.G = z;
if (!z || (cVar = this.a) == null || (iVar = cVar.b) == null || iVar.j != null || !this.d.e || iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed)) {
return;
}
j();
a(this.E);
}
@Override // com.fyber.inneractive.sdk.player.controller.v
public final void a(float f) {
i iVar;
i iVar2;
this.E = f;
if (IAlog.a >= 3) {
IAlog.c("%sonVisibilityChanged called with: %s vfpl = %s vfpa = %s", IAlog.a(this), Float.valueOf(f), Float.valueOf(this.D), Float.valueOf(1.0f - this.D));
}
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null) {
return;
}
if (iVar.e != com.fyber.inneractive.sdk.player.enums.b.Playing) {
z();
return;
}
if (f <= this.D) {
IAlog.e("%sonVisibilityChanged pausing player", IAlog.a(this));
if (this.a.b.j != null) {
this.F = false;
a(false, (s0) null);
A();
super.pauseVideo();
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (cVar2 != null && (iVar2 = cVar2.b) != null) {
iVar2.b(false);
}
this.d.setMuteButtonState(true);
}
}
}
@Override // com.fyber.inneractive.sdk.player.controller.v
public final void a() {
i iVar;
IAlog.a("%sfullscreenExited called", IAlog.a(this));
this.H = false;
d(this.G);
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null) {
return;
}
a(iVar.e);
a(this.a.b.c());
}
}

View File

@@ -0,0 +1,18 @@
package com.fyber.inneractive.sdk.player.controller;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.util.s0;
/* loaded from: classes2.dex */
public final class l implements s0 {
public final /* synthetic */ k a;
public l(k kVar) {
this.a = kVar;
}
@Override // com.fyber.inneractive.sdk.util.s0
public final void a(Bitmap bitmap) {
o.a(this.a.d, bitmap, true, true);
}
}

View File

@@ -0,0 +1,8 @@
package com.fyber.inneractive.sdk.player.controller;
/* loaded from: classes2.dex */
public final class m implements Runnable {
@Override // java.lang.Runnable
public final void run() {
}
}

View File

@@ -0,0 +1,12 @@
package com.fyber.inneractive.sdk.player.controller;
import com.fyber.inneractive.sdk.player.controller.i;
/* loaded from: classes2.dex */
public final class n implements i.f {
public final /* synthetic */ o a;
public n(o oVar) {
this.a = oVar;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
package com.fyber.inneractive.sdk.player.controller;
import android.view.GestureDetector;
import android.view.MotionEvent;
/* loaded from: classes2.dex */
public final class p extends GestureDetector.SimpleOnGestureListener {
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnDoubleTapListener
public final boolean onSingleTapConfirmed(MotionEvent motionEvent) {
return true;
}
}

View File

@@ -0,0 +1,17 @@
package com.fyber.inneractive.sdk.player.controller;
/* loaded from: classes2.dex */
public final class q implements Runnable {
public final /* synthetic */ o a;
public q(o oVar) {
this.a = oVar;
}
@Override // java.lang.Runnable
public final void run() {
o oVar = this.a;
oVar.j = null;
oVar.p();
}
}

View File

@@ -0,0 +1,18 @@
package com.fyber.inneractive.sdk.player.controller;
import android.graphics.Bitmap;
import com.fyber.inneractive.sdk.util.s0;
/* loaded from: classes2.dex */
public final class r implements s0 {
public final /* synthetic */ o a;
public r(o oVar) {
this.a = oVar;
}
@Override // com.fyber.inneractive.sdk.util.s0
public final void a(Bitmap bitmap) {
o.a(this.a.d, bitmap, false, false);
}
}

View File

@@ -0,0 +1,50 @@
package com.fyber.inneractive.sdk.player.controller;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
/* loaded from: classes2.dex */
public final class s implements Application.ActivityLifecycleCallbacks {
public final /* synthetic */ o a;
public s(o oVar) {
this.a = oVar;
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityCreated(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityDestroyed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityPaused(Activity activity) {
if (activity.equals(this.a.d.getContext())) {
this.a.d.c();
this.a.d.e();
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityResumed(Activity activity) {
if (activity.equals(this.a.d.getContext())) {
this.a.d.d();
this.a.d.e();
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityStarted(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public final void onActivityStopped(Activity activity) {
}
}

View File

@@ -0,0 +1,14 @@
package com.fyber.inneractive.sdk.player.controller;
import com.fyber.inneractive.sdk.player.controller.x;
/* loaded from: classes2.dex */
public final class t implements x.c {
public final /* synthetic */ boolean a;
public final /* synthetic */ o b;
public t(o oVar, boolean z) {
this.b = oVar;
this.a = z;
}
}

View File

@@ -0,0 +1,157 @@
package com.fyber.inneractive.sdk.player.controller;
import android.view.View;
import com.fyber.inneractive.sdk.config.enums.Orientation;
import com.fyber.inneractive.sdk.config.i0;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.ui.IAmraidWebViewController;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.a0;
import com.fyber.inneractive.sdk.util.p0;
import com.fyber.inneractive.sdk.web.a;
import com.fyber.inneractive.sdk.web.j;
/* loaded from: classes2.dex */
public final class u extends j.l {
public final /* synthetic */ o a;
public u(o oVar) {
this.a = oVar;
}
@Override // com.fyber.inneractive.sdk.web.h0
public final void a(String str, String str2) {
StringBuilder sb = new StringBuilder();
o oVar = this.a;
oVar.getClass();
sb.append(IAlog.a(oVar));
sb.append("web view callback: onSuspiciousNoUserWebActionDetected");
IAlog.a(sb.toString(), new Object[0]);
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.a(str, str2);
}
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void b(boolean z) {
o oVar = this.a;
oVar.getClass();
IAlog.a("%sonCustomCloseButtonAvailableEnabled : %s", IAlog.a(oVar), Boolean.valueOf(z));
ListenerT listenert = this.a.g;
if (listenert == 0 || !z) {
return;
}
listenert.g();
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void c() {
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.l();
}
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void d() {
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.l();
}
}
@Override // com.fyber.inneractive.sdk.web.h0
public final void e() {
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.p();
}
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void onClose() {
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.q();
}
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void a() {
o oVar = this.a;
oVar.getClass();
IAlog.a("%sweb view callback: onClickedAndOpen", IAlog.a(oVar));
this.a.a(i0.b.COMPANION.e());
o oVar2 = this.a;
if (oVar2.g != 0) {
com.fyber.inneractive.sdk.player.c cVar = oVar2.a;
if (cVar != null) {
com.fyber.inneractive.sdk.model.vast.b bVar = ((com.fyber.inneractive.sdk.player.e) cVar).v;
com.fyber.inneractive.sdk.model.vast.c cVar2 = bVar != null ? bVar.i : null;
if (cVar2 != null) {
cVar.a(cVar2, VideoClickOrigin.COMPANION, com.fyber.inneractive.sdk.model.vast.v.EVENT_CLICK);
}
}
this.a.g.o();
}
}
@Override // com.fyber.inneractive.sdk.web.h0
public final a0.a a(String str, p0 p0Var, a.b bVar) {
o oVar = this.a;
oVar.getClass();
IAlog.a("%sweb view callback: onClicked", IAlog.a(oVar));
this.a.a(i0.b.COMPANION.e());
o oVar2 = this.a;
if (oVar2.g != 0) {
com.fyber.inneractive.sdk.player.c cVar = oVar2.a;
if (cVar != null) {
com.fyber.inneractive.sdk.model.vast.b bVar2 = ((com.fyber.inneractive.sdk.player.e) cVar).v;
com.fyber.inneractive.sdk.model.vast.c cVar2 = bVar2 != null ? bVar2.i : null;
if (cVar2 != null) {
cVar.a(cVar2, VideoClickOrigin.COMPANION, com.fyber.inneractive.sdk.model.vast.v.EVENT_CLICK);
} else if (o.a(oVar2)) {
com.fyber.inneractive.sdk.player.e eVar = (com.fyber.inneractive.sdk.player.e) this.a.a;
eVar.a(eVar.v, VideoClickOrigin.COMPANION, com.fyber.inneractive.sdk.model.vast.v.EVENT_CLICK);
}
}
com.fyber.inneractive.sdk.player.ui.s sVar = this.a.d;
if (sVar != null) {
sVar.f();
}
return this.a.g.a(str, p0Var, bVar, false);
}
return new a0.a(a0.d.FAILED, new Exception("mListener is null, internal SDK fatal error"));
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final boolean a(String str) {
View endCardView = this.a.d.getEndCardView();
ListenerT listenert = this.a.g;
if (listenert == 0) {
return false;
}
listenert.a(endCardView, str);
return true;
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void a(IAmraidWebViewController.MraidVideoFailedToDisplayError mraidVideoFailedToDisplayError) {
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.onPlayerError();
}
}
@Override // com.fyber.inneractive.sdk.web.j.f
public final void a(boolean z, Orientation orientation) {
o oVar = this.a;
oVar.getClass();
IAlog.a("%sonOrientationProperties: allowOrientationChange: %s, forceOrientationType: %s", IAlog.a(oVar), Boolean.valueOf(z), orientation.toString());
ListenerT listenert = this.a.g;
if (listenert != 0) {
listenert.a(z, orientation);
}
}
}

View File

@@ -0,0 +1,15 @@
package com.fyber.inneractive.sdk.player.controller;
/* loaded from: classes2.dex */
public interface v extends b<a> {
public interface a extends y {
void c();
}
void a();
void a(float f);
void d(boolean z);
}

View File

@@ -0,0 +1,172 @@
package com.fyber.inneractive.sdk.player.controller;
import android.view.Surface;
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.e;
import com.fyber.inneractive.sdk.player.exoplayer2.source.n;
import com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener;
import com.fyber.inneractive.sdk.player.mediaplayer.a;
import com.fyber.inneractive.sdk.util.IAlog;
import java.lang.ref.WeakReference;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/* loaded from: classes2.dex */
public final class w implements n.a, VideoRendererEventListener, e.a, com.fyber.inneractive.sdk.player.exoplayer2.source.f {
public final WeakReference<d> a;
public boolean b = false;
public w(d dVar) {
this.a = new WeakReference<>(dVar);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void a() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void a(int i, boolean z) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar;
IAlog.a("%sonPlayerStateChanged called with pwr = %s state = %d", f(), Boolean.valueOf(z), Integer.valueOf(i));
d dVar = this.a.get();
if (dVar == null || (eVar = dVar.s) == null || dVar.z) {
return;
}
if (i != 3) {
if (i == 2) {
if (dVar.e == com.fyber.inneractive.sdk.player.enums.b.Playing) {
dVar.a(com.fyber.inneractive.sdk.player.enums.b.Buffering);
return;
}
return;
} else {
if (i == 4) {
dVar.a(com.fyber.inneractive.sdk.player.enums.b.Completed);
return;
}
return;
}
}
if (z) {
dVar.a(com.fyber.inneractive.sdk.player.enums.b.Playing);
return;
}
if (dVar.e == com.fyber.inneractive.sdk.player.enums.b.Preparing) {
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.f fVar = ((com.fyber.inneractive.sdk.player.exoplayer2.g) eVar).p;
if (fVar != null && fVar.a > 0) {
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar2 = fVar.b[0];
com.fyber.inneractive.sdk.player.exoplayer2.j d = eVar2 == null ? null : eVar2.d();
if (d != null) {
int i2 = d.j;
int i3 = d.k;
dVar.t = i2;
dVar.u = i3;
}
}
this.b = true;
dVar.a(com.fyber.inneractive.sdk.player.enums.b.Prepared);
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void b() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void c() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void d() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void e() {
}
public final String f() {
d dVar = this.a.get();
return dVar == null ? w.class.getName() : IAlog.a(dVar);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onDroppedFrames(int i, long j) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onRenderedFirstFrame(Surface surface) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onVideoDecoderInitialized(String str, long j, long j2) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onVideoDisabled(DecoderCounters decoderCounters) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onVideoEnabled(DecoderCounters decoderCounters) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onVideoInputFormatChanged(com.fyber.inneractive.sdk.player.exoplayer2.j jVar) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.video.VideoRendererEventListener
public final void onVideoSizeChanged(int i, int i2, int i3, float f) {
d dVar = this.a.get();
if (dVar != null) {
dVar.t = i;
dVar.u = i2;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.e.a
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.d dVar) {
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
d dVar2 = this.a.get();
if (dVar2 != null && (dVar.getCause() instanceof c.e) && (this.b || (dVar2.G && dVar2.A))) {
dVar2.v = true;
com.fyber.inneractive.sdk.player.exoplayer2.e eVar = dVar2.s;
if (eVar != null) {
com.fyber.inneractive.sdk.player.exoplayer2.g gVar = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar;
gVar.e.c();
gVar.d.removeCallbacksAndMessages(null);
dVar2.s = null;
}
dVar2.a(false);
dVar2.a(dVar2.F);
dVar2.i.post(new h(dVar2, false));
return;
}
if (dVar2 != null && dVar2.A && !this.b && com.fyber.inneractive.sdk.player.cache.p.f.c && com.fyber.inneractive.sdk.util.s.a() && dVar2.H < dVar2.p) {
com.fyber.inneractive.sdk.player.exoplayer2.e eVar2 = dVar2.s;
if (eVar2 != null) {
com.fyber.inneractive.sdk.player.exoplayer2.g gVar2 = (com.fyber.inneractive.sdk.player.exoplayer2.g) eVar2;
gVar2.e.c();
gVar2.d.removeCallbacksAndMessages(null);
dVar2.s = null;
}
dVar2.a(true);
dVar2.a(dVar2.F);
dVar2.H++;
dVar2.i.post(new h(dVar2, true));
return;
}
a.l lVar = new a.l(dVar.getCause() == null ? "empty" : dVar.getCause().getMessage(), dVar);
IAlog.a("%sonPlayerError called with %s for sendErrorState", f(), lVar);
d dVar3 = (d) com.fyber.inneractive.sdk.util.t.a(this.a);
if (dVar3 != null) {
dVar3.a(com.fyber.inneractive.sdk.player.enums.b.Error);
IAlog.a("%sonPlayerError called with: %s for onPlayerError", IAlog.a(dVar3), lVar);
dVar3.i.post(new g(dVar3, lVar));
com.fyber.inneractive.sdk.player.d dVar4 = dVar3.h;
if (dVar4 == null || (scheduledThreadPoolExecutor = dVar4.b) == null) {
return;
}
scheduledThreadPoolExecutor.shutdownNow();
dVar4.b = null;
}
}
}

View File

@@ -0,0 +1,94 @@
package com.fyber.inneractive.sdk.player.controller;
import android.app.Dialog;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import com.fyber.inneractive.sdk.R;
import com.fyber.inneractive.sdk.util.t0;
/* loaded from: classes2.dex */
public final class x {
public final Context a;
public final c b;
public final Dialog c;
public final com.fyber.inneractive.sdk.config.global.features.b d;
public class a implements View.OnClickListener {
public a() {
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
x.this.c.dismiss();
t tVar = (t) x.this.b;
tVar.b.f(tVar.a);
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
x.this.c.dismiss();
x.this.b.getClass();
}
}
public interface c {
}
public x(Context context, com.fyber.inneractive.sdk.config.global.features.b bVar, t tVar) {
this.a = context;
this.d = bVar;
this.b = tVar;
this.c = new Dialog(context);
a();
}
public final void a() {
this.c.requestWindowFeature(1);
this.c.setContentView(R.layout.ia_layout_skip_rewarded_dialog);
Button button = (Button) this.c.findViewById(R.id.ia_keep_watching_button);
Button button2 = (Button) this.c.findViewById(R.id.ia_close_button);
TextView textView = (TextView) this.c.findViewById(R.id.ia_skip_dialog_title_textview);
TextView textView2 = (TextView) this.c.findViewById(R.id.ia_skip_dialog_sub_title_textview);
String string = this.a.getString(R.string.ia_skip_rewarded_dialog_keep_watching);
String string2 = this.a.getString(R.string.ia_skip_rewarded_dialog_close_button);
String string3 = this.a.getString(R.string.ia_skip_rewarded_dialog_title);
String string4 = this.a.getString(R.string.ia_skip_rewarded_dialog_sub_title);
com.fyber.inneractive.sdk.config.global.features.b bVar = this.d;
if (bVar != null) {
String a2 = bVar.a("skip_reward_dialog_keep_watching_button", "KEEP WATCHING");
String trim = a2.trim().length() > 0 ? a2.trim() : "KEEP WATCHING";
if (!TextUtils.isEmpty(trim)) {
string = trim;
}
String a3 = this.d.a("skip_reward_dialog_close_button", "CLOSE");
String trim2 = a3.trim().length() > 0 ? a3.trim() : "CLOSE";
if (!TextUtils.isEmpty(trim2)) {
string2 = trim2;
}
String a4 = this.d.a("skip_reward_dialog_title", "Close Video?");
String trim3 = a4.trim().length() > 0 ? a4.trim() : "Close Video?";
if (!TextUtils.isEmpty(trim3)) {
string3 = trim3;
}
String a5 = this.d.a("skip_reward_dialog_sub_title", "Reward will not be received before video completion.");
String trim4 = a5.trim().length() > 0 ? a5.trim() : "Reward will not be received before video completion.";
if (!TextUtils.isEmpty(trim4)) {
string4 = trim4;
}
}
button.setText(t0.a(string, 13));
button2.setText(t0.a(string2, 13));
textView.setText(t0.a(string3, 20));
textView2.setText(t0.a(string4, 100));
button2.setOnClickListener(new a());
button.setOnClickListener(new b());
}
}

View File

@@ -0,0 +1,44 @@
package com.fyber.inneractive.sdk.player.controller;
import android.view.View;
import com.fyber.inneractive.sdk.config.enums.Orientation;
import com.fyber.inneractive.sdk.util.a0;
import com.fyber.inneractive.sdk.util.p0;
import com.fyber.inneractive.sdk.web.a;
/* loaded from: classes2.dex */
public interface y {
a0.a a(p0 p0Var, com.fyber.inneractive.sdk.util.h hVar);
a0.a a(String str, p0 p0Var, a.b bVar, boolean z);
void a(View view, String str);
void a(String str, String str2);
void a(boolean z);
void a(boolean z, Orientation orientation);
void e();
void g();
void i();
com.fyber.inneractive.sdk.ignite.l j();
void l();
void o();
void onCompleted();
void onPlayerError();
void onProgress(int i, int i2);
void p();
void q();
}

View File

@@ -0,0 +1,38 @@
package com.fyber.inneractive.sdk.player;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.util.IAlog;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/* loaded from: classes2.dex */
public final class d {
public final i a;
public ScheduledThreadPoolExecutor b;
public boolean d = false;
public final a c = new a();
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
d dVar = d.this;
dVar.getClass();
IAlog.a("player progress monitor: run started", new Object[0]);
int c = dVar.a.c();
if (!dVar.d) {
IAlog.a("run: 2 seconds passed? played for %d since last play started", Integer.valueOf(c));
if (c >= 2000) {
IAlog.a("run: setting played 2 seconds flag", new Object[0]);
dVar.d = true;
}
}
dVar.a.a(c);
}
}
public d(i iVar) {
this.a = iVar;
}
}

View File

@@ -0,0 +1,615 @@
package com.fyber.inneractive.sdk.player;
import android.app.Application;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.view.View;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
import com.fyber.inneractive.sdk.config.f0;
import com.fyber.inneractive.sdk.config.global.features.r;
import com.fyber.inneractive.sdk.external.ImpressionData;
import com.fyber.inneractive.sdk.external.InneractiveAdRequest;
import com.fyber.inneractive.sdk.external.InneractiveVideoError;
import com.fyber.inneractive.sdk.flow.g0;
import com.fyber.inneractive.sdk.flow.m;
import com.fyber.inneractive.sdk.flow.o;
import com.fyber.inneractive.sdk.model.vast.d;
import com.fyber.inneractive.sdk.model.vast.q;
import com.fyber.inneractive.sdk.model.vast.v;
import com.fyber.inneractive.sdk.network.j0;
import com.fyber.inneractive.sdk.network.s;
import com.fyber.inneractive.sdk.player.a;
import com.fyber.inneractive.sdk.player.c;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.player.h;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.z;
import com.iab.omid.library.fyber.adsession.media.Position;
import com.iab.omid.library.fyber.adsession.media.VastProperties;
import com.ironsource.gi;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public final class e extends com.fyber.inneractive.sdk.player.c implements a.InterfaceC0079a {
public static final a C = new a();
public boolean A;
public final com.fyber.inneractive.sdk.player.ui.remote.g B;
public final com.fyber.inneractive.sdk.model.vast.b v;
public com.fyber.inneractive.sdk.player.enums.a w;
public boolean x;
public f0 y;
public m z;
public class a extends HashMap<String, c> {
/* renamed from: com.fyber.inneractive.sdk.player.e$a$a, reason: collision with other inner class name */
public class C0082a implements c {
@Override // com.fyber.inneractive.sdk.player.e.c
public final String a(i iVar, VideoClickOrigin videoClickOrigin) {
return videoClickOrigin.name().toLowerCase();
}
}
public class b implements c {
@Override // com.fyber.inneractive.sdk.player.e.c
public final String a(i iVar, VideoClickOrigin videoClickOrigin) {
return iVar != null ? z.a(iVar.c()) : "00:00:00.000";
}
}
public a() {
put("[CLICKAREA]", new C0082a());
put("[ADPLAYHEAD]", new b());
}
}
public static /* synthetic */ class b {
public static final /* synthetic */ int[] a;
public static final /* synthetic */ int[] b;
public static final /* synthetic */ int[] c;
static {
int[] iArr = new int[com.fyber.inneractive.sdk.player.enums.a.values().length];
c = iArr;
try {
iArr[com.fyber.inneractive.sdk.player.enums.a.Uninitialized.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
c[com.fyber.inneractive.sdk.player.enums.a.Started.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
c[com.fyber.inneractive.sdk.player.enums.a.FirstQuarter.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
c[com.fyber.inneractive.sdk.player.enums.a.MidPoint.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
c[com.fyber.inneractive.sdk.player.enums.a.ThirdPQuarter.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
c[com.fyber.inneractive.sdk.player.enums.a.Completed.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
int[] iArr2 = new int[com.fyber.inneractive.sdk.player.enums.b.values().length];
b = iArr2;
try {
iArr2[com.fyber.inneractive.sdk.player.enums.b.Prepared.ordinal()] = 1;
} catch (NoSuchFieldError unused7) {
}
try {
b[com.fyber.inneractive.sdk.player.enums.b.Playing.ordinal()] = 2;
} catch (NoSuchFieldError unused8) {
}
try {
b[com.fyber.inneractive.sdk.player.enums.b.Completed.ordinal()] = 3;
} catch (NoSuchFieldError unused9) {
}
int[] iArr3 = new int[com.fyber.inneractive.sdk.model.vast.h.values().length];
a = iArr3;
try {
iArr3[com.fyber.inneractive.sdk.model.vast.h.Default_End_Card.ordinal()] = 1;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card.ordinal()] = 2;
} catch (NoSuchFieldError unused11) {
}
}
}
public interface c {
String a(i iVar, VideoClickOrigin videoClickOrigin);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public e(Application application, com.fyber.inneractive.sdk.response.g gVar, f0 f0Var, InneractiveAdRequest inneractiveAdRequest, g0 g0Var, com.fyber.inneractive.sdk.measurement.a aVar) {
super(application, g0Var == null ? null : g0Var.b());
if (f0Var != null) {
((e0) f0Var).b().getClass();
}
this.w = com.fyber.inneractive.sdk.player.enums.a.Uninitialized;
this.A = false;
if (gVar == null || gVar.d() == null) {
throw new IllegalArgumentException("IAVastMediaPlayerFlowManager ctor - vastData can't be null");
}
this.g = aVar;
this.e = g0Var;
this.v = gVar.d();
this.f = inneractiveAdRequest;
m mVar = new m(application, gVar, inneractiveAdRequest, this.e.b(), a(gVar, f0Var));
this.z = mVar;
mVar.c();
if (IAlog.a <= 3) {
IAlog.e("IAVastMediaPlayerFlowManager:ctor - got media files: ", new Object[0]);
for (int i = 0; i < this.v.b(); i++) {
q qVar = (q) this.v.c().get(i);
if (qVar != null) {
IAlog.a("IAVastMediaPlayerFlowManager(%d): %s", Integer.valueOf(i), qVar.a());
}
}
}
if (f0Var != null) {
a(f0Var);
e0 e0Var = (e0) f0Var;
if (e0Var.a() != null) {
a(e0Var.a().b().booleanValue());
}
}
if (g0Var == null || g0Var.b() == null) {
this.s = IAConfigManager.c().a().a(10, 0, gVar.a() == UnitDisplayType.INTERSTITIAL ? "prebuffer_interstitial" : "prebuffer_rewarded");
} else {
this.s = ((r) g0Var.b().a(r.class)).a(gVar.a());
}
if (d()) {
this.B = new com.fyber.inneractive.sdk.player.ui.remote.g(application, g0Var, this.v.a());
}
}
public final com.fyber.inneractive.sdk.flow.vast.b a(com.fyber.inneractive.sdk.response.g gVar, f0 f0Var) {
UnitDisplayType unitDisplayType = gVar.n;
InneractiveAdRequest inneractiveAdRequest = this.f;
return new com.fyber.inneractive.sdk.flow.vast.b(unitDisplayType, inneractiveAdRequest == null || inneractiveAdRequest.getAllowFullscreen(), gVar.e, gVar.f, f0Var);
}
public final void a(f0 f0Var) {
this.y = f0Var;
}
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void e() {
}
public final void b(int i) {
com.fyber.inneractive.sdk.model.vast.b bVar = this.v;
if (bVar == null || bVar.n.isEmpty()) {
return;
}
while (this.v.n.size() > 0 && i >= ((com.fyber.inneractive.sdk.model.vast.d) this.v.n.get(0)).c) {
com.fyber.inneractive.sdk.model.vast.d dVar = (com.fyber.inneractive.sdk.model.vast.d) this.v.n.get(0);
String str = dVar.a;
if (!TextUtils.isEmpty(str)) {
IAlog.a("IAVastMediaPlayerFlowManager: Firing event for type: progress", new Object[0]);
j0.b(str);
}
this.v.n.remove(dVar);
}
}
@Override // com.fyber.inneractive.sdk.player.c
public final View c() {
PriorityQueue<com.fyber.inneractive.sdk.flow.vast.a> priorityQueue;
com.fyber.inneractive.sdk.flow.vast.a peek;
m mVar = this.z;
if (mVar == null || (priorityQueue = mVar.l) == null || priorityQueue.size() <= 0 || (peek = this.z.l.peek()) == null || !peek.a) {
return null;
}
if (peek instanceof com.fyber.inneractive.sdk.flow.vast.e) {
this.z.n = ((com.fyber.inneractive.sdk.flow.vast.e) peek).g;
}
return peek.b;
}
public final boolean d() {
com.fyber.inneractive.sdk.model.vast.b bVar = this.v;
return bVar != null && (TextUtils.isEmpty(bVar.o) ^ true);
}
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void a(com.fyber.inneractive.sdk.player.enums.b bVar) {
boolean z;
s.a aVar;
String str;
int i;
int i2;
T t;
T t2;
T t3;
f0 f0Var;
VastProperties createVastPropertiesForNonSkippableMedia;
IAlog.a("IAMediaPlayerFlowManager: onPlayerStateChanged with - %s", bVar);
f fVar = this.i;
if (fVar != null && bVar != com.fyber.inneractive.sdk.player.enums.b.Prepared) {
fVar.a(bVar);
} else if (bVar == com.fyber.inneractive.sdk.player.enums.b.Prepared && fVar != null) {
fVar.d = true;
}
int i3 = c.b.a[bVar.ordinal()];
if (i3 == 1) {
IAlog.a("IAMediaPlayerFlowManager: onPlayerPrepared called", new Object[0]);
if (this.o) {
IAlog.a("IMediaPlayerFlowManager: onPlayerPrepared is called, but object is already destroyed?? ignore", new Object[0]);
} else {
if (this.b.a() && this.b.e() != null) {
Bitmap e = this.b.e();
IAlog.a("IAMediaPlayerFlowManager: saving snapshot %s", e);
this.k = e;
}
this.n = true;
if (this.h != null && this.e != null && (f0Var = this.y) != null) {
int intValue = ((e0) f0Var).f.h.value().intValue();
boolean a2 = com.fyber.inneractive.sdk.player.c.a(this.b.d(), ((com.fyber.inneractive.sdk.response.g) this.e.b).w, this.y);
boolean booleanValue = ((e0) this.y).f.a.booleanValue();
com.fyber.inneractive.sdk.measurement.d dVar = this.h;
if (!a2) {
intValue = 0;
}
if (dVar.b != null) {
try {
if (a2) {
createVastPropertiesForNonSkippableMedia = VastProperties.createVastPropertiesForSkippableMedia(intValue, booleanValue, Position.STANDALONE);
} else {
createVastPropertiesForNonSkippableMedia = VastProperties.createVastPropertiesForNonSkippableMedia(booleanValue, Position.STANDALONE);
}
dVar.b.loaded(createVastPropertiesForNonSkippableMedia);
} catch (Throwable th) {
dVar.a(th);
}
}
}
if (this.r != null) {
g0 g0Var = this.e;
if (g0Var == null || (t3 = g0Var.b) == 0) {
z = false;
} else {
z = com.fyber.inneractive.sdk.player.c.a(this.b.d(), t3.w, this.y);
t3.r.setVideo(new ImpressionData.Video(z, (int) TimeUnit.MILLISECONDS.toSeconds(this.b.d())));
}
try {
g0 g0Var2 = this.e;
com.fyber.inneractive.sdk.response.g gVar = g0Var2 != null ? (com.fyber.inneractive.sdk.response.g) g0Var2.b : null;
com.fyber.inneractive.sdk.network.r rVar = com.fyber.inneractive.sdk.network.r.EVENT_READY_ON_CLIENT;
InneractiveAdRequest inneractiveAdRequest = this.f;
g0 g0Var3 = this.e;
s.a aVar2 = new s.a(rVar, inneractiveAdRequest, gVar, g0Var3 == null ? null : g0Var3.c.c());
if (this.t == null || gVar == null) {
aVar = aVar2;
} else {
IAlog.a("Video content loader: Vast load took: " + (System.currentTimeMillis() - gVar.K) + " msec", new Object[0]);
g0 g0Var4 = this.e;
if (g0Var4 == null || (t2 = g0Var4.b) == 0 || ((com.fyber.inneractive.sdk.response.g) t2).L == null) {
str = "";
i = 0;
i2 = 0;
} else {
i = ((com.fyber.inneractive.sdk.response.g) t2).L.j;
i2 = ((com.fyber.inneractive.sdk.response.g) t2).L.k;
str = ((com.fyber.inneractive.sdk.response.g) t2).L.a;
}
String str2 = "0";
if (g0Var4 != null && (t = g0Var4.b) != 0 && !TextUtils.isEmpty(((com.fyber.inneractive.sdk.response.g) t).C)) {
str2 = ((com.fyber.inneractive.sdk.response.g) this.e.b).C;
}
s.b bVar2 = new s.b();
bVar2.a(Integer.valueOf(this.b.d() / 1000), IronSourceConstants.EVENTS_DURATION).a(this.t.g, "url").a(this.t.e, "bitrate").a(TextUtils.isEmpty(this.t.d) ? "na" : this.t.d, "mime").a(this.t.a, gi.h).a(Long.valueOf(System.currentTimeMillis() - gVar.K), "load_time").a(Integer.valueOf(this.q), "media_file_index").a(this.b.f(), "player").a(Boolean.valueOf(z), "is_video_skippable").a(Integer.valueOf(i), "supported_media_files").a(Integer.valueOf(i2), "total_media_files").a(str, "vast_version");
if (str2 != null && str2.equals("1")) {
bVar2.a(str2, "hide_endcard");
}
aVar = aVar2;
aVar.f.put(bVar2.a);
}
aVar.a((String) null);
} catch (Exception unused) {
}
h hVar = (h) this.r;
if (!hVar.g) {
hVar.g = true;
h.b bVar3 = hVar.d;
if (bVar3 != null) {
((o) bVar3).f();
}
}
}
}
} else if (i3 == 2) {
IAlog.a("IAMediaPlayerFlowManager: onPlayerBuffering", new Object[0]);
} else if (i3 == 3) {
this.b.c();
}
int i4 = b.b[bVar.ordinal()];
if (i4 != 1) {
if (i4 == 2) {
if (this.w.equals(com.fyber.inneractive.sdk.player.enums.a.Completed)) {
a(com.fyber.inneractive.sdk.player.enums.a.Restarted);
return;
}
return;
} else {
if (i4 != 3) {
return;
}
b(this.b.d());
a(com.fyber.inneractive.sdk.player.enums.a.Completed);
return;
}
}
com.fyber.inneractive.sdk.model.vast.b bVar4 = this.v;
if (bVar4 == null || bVar4.n.size() == 0) {
return;
}
int d = this.b.d();
Iterator it = this.v.n.iterator();
while (it.hasNext()) {
com.fyber.inneractive.sdk.model.vast.d dVar2 = (com.fyber.inneractive.sdk.model.vast.d) it.next();
int i5 = -1;
if (dVar2.c == -1) {
if (!TextUtils.isEmpty(dVar2.b)) {
String str3 = dVar2.b;
i5 = Integer.parseInt(str3.substring(0, str3.length() - 1));
}
dVar2.c = (i5 * d) / 100;
}
}
Collections.sort(this.v.n, new d.a());
}
public final void b(InneractiveVideoError inneractiveVideoError, JSONObject jSONObject) {
try {
if (this.t != null && inneractiveVideoError.getPlayerError() != InneractiveVideoError.Error.ERROR_FAILED_PLAYING_ALL_MEDIA_FILES) {
jSONObject.put("url", this.t.g);
jSONObject.put("bitrate", this.t.e);
jSONObject.put("mime", this.t.d);
jSONObject.put(gi.h, this.t.a);
}
i iVar = this.b;
jSONObject.put("player", iVar != null ? iVar.f() : "");
if (inneractiveVideoError.getCause() != null) {
jSONObject.put("exception", inneractiveVideoError.getCause().getClass().getName());
jSONObject.put("message", inneractiveVideoError.getCause().getMessage() == null ? "empty" : inneractiveVideoError.getCause().getMessage());
}
} catch (Exception unused) {
IAlog.a("onReportError: Failed creating Json object from media file!", new Object[0]);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i.d
public final void a(int i) {
int d = this.b.d();
b(i);
int i2 = b.c[this.w.ordinal()];
if (i2 == 1) {
if (this.b.e != com.fyber.inneractive.sdk.player.enums.b.Buffering) {
a(com.fyber.inneractive.sdk.player.enums.a.Started);
com.fyber.inneractive.sdk.measurement.d dVar = this.h;
if (dVar != null) {
if (dVar.b != null && !dVar.e) {
IAlog.a("%s impression", "OMVideo");
dVar.e = true;
try {
dVar.b.impressionOccurred();
} catch (Throwable th) {
dVar.a(th);
}
}
com.fyber.inneractive.sdk.measurement.d dVar2 = this.h;
long d2 = this.b.d();
float f = this.b.i() ? 0.0f : 1.0f;
if (dVar2.c == null || dVar2.d) {
return;
}
dVar2.d = true;
IAlog.a("%s start", "OMVideo");
try {
dVar2.c.start(d2, f);
return;
} catch (Throwable th2) {
dVar2.a(th2);
return;
}
}
return;
}
return;
}
if (i2 == 2) {
if (i > d / 4) {
a(com.fyber.inneractive.sdk.player.enums.a.FirstQuarter);
com.fyber.inneractive.sdk.measurement.d dVar3 = this.h;
if (dVar3 == null || dVar3.c == null) {
return;
}
IAlog.a("%s firstQuartile", "OMVideo");
try {
dVar3.c.firstQuartile();
return;
} catch (Throwable th3) {
dVar3.a(th3);
return;
}
}
return;
}
if (i2 != 3) {
if (i2 == 4 && i > (d / 4) * 3) {
a(com.fyber.inneractive.sdk.player.enums.a.ThirdPQuarter);
com.fyber.inneractive.sdk.measurement.d dVar4 = this.h;
if (dVar4 == null || dVar4.c == null) {
return;
}
IAlog.a("%s thirdQuartile", "OMVideo");
try {
dVar4.c.thirdQuartile();
return;
} catch (Throwable th4) {
dVar4.a(th4);
return;
}
}
return;
}
if (i > d / 2) {
a(com.fyber.inneractive.sdk.player.enums.a.MidPoint);
com.fyber.inneractive.sdk.measurement.d dVar5 = this.h;
if (dVar5 == null || dVar5.c == null) {
return;
}
IAlog.a("%s midpoint", "OMVideo");
try {
dVar5.c.midpoint();
} catch (Throwable th5) {
dVar5.a(th5);
}
}
}
@Override // com.fyber.inneractive.sdk.player.c
public final void a(InneractiveVideoError inneractiveVideoError, JSONObject jSONObject) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_ERROR);
b(inneractiveVideoError, jSONObject);
IAlog.f("IAMediaPlayerFlowManager: reporting error to listeners: %s", inneractiveVideoError.getPlayerError().toString());
g gVar = this.r;
if (gVar != null) {
try {
((h) gVar).a(inneractiveVideoError, jSONObject, false);
} catch (Exception e) {
if (IAlog.a <= 3) {
e.printStackTrace();
}
}
}
com.fyber.inneractive.sdk.util.r rVar = this.l;
if (rVar != null) {
rVar.b();
rVar.h = null;
this.m = null;
}
}
@Override // com.fyber.inneractive.sdk.player.c
public final void a(com.fyber.inneractive.sdk.response.i iVar, VideoClickOrigin videoClickOrigin, v... vVarArr) {
if (vVarArr.length == 0) {
IAlog.f("IAVastMediaPlayerFlowManager: eventTypes array is empty", new Object[0]);
return;
}
if (iVar == null) {
IAlog.f("IAVastMediaPlayerFlowManager: parser is null", new Object[0]);
return;
}
ArrayList arrayList = new ArrayList();
for (v vVar : vVarArr) {
String e = vVar.e();
IAlog.a("IAVastMediaPlayerFlowManager: Firing events for type: %s", e);
List<String> a2 = iVar.a(vVar);
if (a2 != null && a2.size() != 0) {
arrayList.addAll(a2);
IAlog.a("found %d events for type: %s, url: %s", Integer.valueOf(a2.size()), e, a2.get(0));
a(a2, vVar);
} else {
IAlog.a("IAVastMediaPlayerFlowManager: no events for type: %s", e);
}
if (vVar == v.EVENT_CLICK) {
for (Map.Entry<String, c> entry : C.entrySet()) {
String key = entry.getKey();
String a3 = entry.getValue().a(this.b, videoClickOrigin);
for (int i = 0; i < arrayList.size(); i++) {
String str = (String) arrayList.get(i);
if (str.contains(key)) {
arrayList.set(i, str.replace(key, a3));
}
}
}
}
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
String str2 = (String) it.next();
if (!TextUtils.isEmpty(str2)) {
j0.b(str2);
}
}
}
public static void a(com.fyber.inneractive.sdk.measurement.e eVar, v... vVarArr) {
ArrayList arrayList = new ArrayList();
for (v vVar : vVarArr) {
String e = vVar.e();
IAlog.a("IAVastMediaPlayerFlowManager: Firing events for type: %s", e);
List<String> a2 = eVar.a(vVar);
if (a2 != null) {
ArrayList arrayList2 = (ArrayList) a2;
if (arrayList2.size() != 0) {
arrayList.addAll(a2);
IAlog.a("found %d events for type: %s", Integer.valueOf(arrayList2.size()), e);
a(a2, vVar);
}
}
IAlog.a("IAVastMediaPlayerFlowManager: no events for type: %s", e);
}
Iterator it = arrayList.iterator();
while (it.hasNext()) {
String str = (String) it.next();
if (!TextUtils.isEmpty(str)) {
j0.b(str);
}
}
}
public static void a(List<String> list, v vVar) {
for (String str : list) {
IAlog.a(" event url: %s", str);
if (!TextUtils.isEmpty(str)) {
vVar.e();
}
}
}
public final void a(com.fyber.inneractive.sdk.player.enums.a aVar) {
if (this.w == aVar) {
return;
}
if (aVar == com.fyber.inneractive.sdk.player.enums.a.Started) {
this.x = false;
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_IMPRESSION, v.EVENT_START);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.FirstQuarter) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_FIRSTQ);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.MidPoint) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_MID);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.ThirdPQuarter) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_THIRDQ);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.Completed && !this.x) {
this.x = true;
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_COMPLETE);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.Restarted) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_REWIND);
} else if (aVar == com.fyber.inneractive.sdk.player.enums.a.Progress) {
a(this.v, VideoClickOrigin.InvalidOrigin, v.EVENT_PROGRESS);
}
this.w = aVar;
}
}

View File

@@ -0,0 +1,11 @@
package com.fyber.inneractive.sdk.player.enums;
/* loaded from: classes2.dex */
public enum VideoClickOrigin {
CTA,
COMPANION,
VIDEO,
MUTE,
APP_INFO,
InvalidOrigin
}

View File

@@ -0,0 +1,13 @@
package com.fyber.inneractive.sdk.player.enums;
/* loaded from: classes2.dex */
public enum a {
Uninitialized,
Started,
Restarted,
FirstQuarter,
MidPoint,
ThirdPQuarter,
Completed,
Progress
}

View File

@@ -0,0 +1,15 @@
package com.fyber.inneractive.sdk.player.enums;
/* loaded from: classes2.dex */
public enum b {
Idle,
Preparing,
Prepared,
Buffering,
Seeking,
Start_in_progress,
Playing,
Paused,
Completed,
Error
}

View File

@@ -0,0 +1,147 @@
package com.fyber.inneractive.sdk.player.exoplayer2;
import java.io.IOException;
/* loaded from: classes2.dex */
public abstract class a implements o {
public final int a;
public p b;
public int c;
public com.fyber.inneractive.sdk.player.exoplayer2.source.q d;
public long e;
public boolean f = true;
public boolean g;
public a(int i) {
this.a = i;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void a(p pVar, j[] jVarArr, com.fyber.inneractive.sdk.player.exoplayer2.source.q qVar, long j, boolean z, long j2) throws d {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.c == 0);
this.b = pVar;
this.c = 1;
a(z);
a(jVarArr, qVar, j2);
a(z, j);
}
public abstract void a(boolean z) throws d;
public abstract void a(boolean z, long j) throws d;
public void a(j[] jVarArr) throws d {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final boolean b() {
return this.f;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void c() {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.c == 1);
this.c = 0;
this.d = null;
this.g = false;
n();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final com.fyber.inneractive.sdk.player.exoplayer2.source.q d() {
return this.d;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final int e() {
return this.c;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void f() {
this.g = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void g() throws IOException {
this.d.a();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final boolean h() {
return this.g;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public com.fyber.inneractive.sdk.player.exoplayer2.util.g j() {
return null;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final int k() {
return this.a;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final a l() {
return this;
}
public abstract void n();
public abstract void o() throws d;
public abstract void p() throws d;
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void setIndex(int i) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void start() throws d {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.c == 1);
this.c = 2;
o();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void stop() throws d {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.c == 2);
this.c = 1;
p();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void a(j[] jVarArr, com.fyber.inneractive.sdk.player.exoplayer2.source.q qVar, long j) throws d {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(!this.g);
this.d = qVar;
this.f = false;
this.e = j;
a(jVarArr);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void a(long j) throws d {
this.g = false;
this.f = false;
a(false, j);
}
public final int a(k kVar, com.fyber.inneractive.sdk.player.exoplayer2.decoder.b bVar, boolean z) {
int a = this.d.a(kVar, bVar, z);
if (a == -4) {
if (bVar.a(4)) {
this.f = true;
return this.g ? -4 : -3;
}
bVar.d += this.e;
} else if (a == -5) {
j jVar = kVar.a;
long j = jVar.w;
if (j != Long.MAX_VALUE) {
kVar.a = new j(jVar.a, jVar.e, jVar.f, jVar.c, jVar.b, jVar.g, jVar.j, jVar.k, jVar.l, jVar.m, jVar.n, jVar.p, jVar.o, jVar.q, jVar.r, jVar.s, jVar.t, jVar.u, jVar.v, jVar.x, jVar.y, jVar.z, j + this.e, jVar.h, jVar.i, jVar.d);
}
}
return a;
}
}

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);
}
}

View File

@@ -0,0 +1,23 @@
package com.fyber.inneractive.sdk.player.exoplayer2;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.util.UUID;
/* loaded from: classes2.dex */
public final class b {
public static final int a;
public static final UUID b;
static {
a = s.a < 23 ? 1020 : 6396;
b = new UUID(0L, 0L);
new UUID(1186680826959645954L, -5988876978535335093L);
new UUID(-1301668207276963122L, -6645017420763422227L);
new UUID(-7348484286925749626L, -6083546864340672619L);
}
public static long a(long j) {
return j == C.TIME_UNSET ? C.TIME_UNSET : j / 1000;
}
}

View File

@@ -0,0 +1,60 @@
package com.fyber.inneractive.sdk.player.exoplayer2;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
/* loaded from: classes2.dex */
public final class c {
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.j a;
public final long b;
public final long c;
public final long d;
public final long e;
public int f;
public boolean g;
public c(com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar, int i) {
this(jVar, (Object) null);
}
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.j a() {
return this.a;
}
public c(com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar, Object obj) {
this.a = jVar;
this.b = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS * 1000;
this.c = 30000 * 1000;
this.d = 2500000L;
this.e = 5000000L;
}
public final boolean a(long j) {
int i;
boolean z = false;
char c = j > this.c ? (char) 0 : j < this.b ? (char) 2 : (char) 1;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar = this.a;
synchronized (jVar) {
i = jVar.f * jVar.b;
}
boolean z2 = i >= this.f;
boolean z3 = this.g;
if (c == 2 || (c == 1 && z3 && !z2)) {
z = true;
}
this.g = z;
return z;
}
public final void a(boolean z) {
this.f = 0;
this.g = false;
if (z) {
com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar = this.a;
synchronized (jVar) {
if (jVar.a) {
jVar.a(0);
}
}
}
}
}

View File

@@ -0,0 +1,8 @@
package com.fyber.inneractive.sdk.player.exoplayer2;
/* loaded from: classes2.dex */
public final class d extends Exception {
public d(Throwable th) {
super(null, th);
}
}

View File

@@ -0,0 +1,25 @@
package com.fyber.inneractive.sdk.player.exoplayer2.decoder;
/* loaded from: classes2.dex */
public final class DecoderCounters {
public int decoderInitCount;
public int decoderReleaseCount;
public int droppedOutputBufferCount;
public int inputBufferCount;
public int maxConsecutiveDroppedOutputBufferCount;
public int renderedOutputBufferCount;
public int skippedOutputBufferCount;
public synchronized void ensureUpdated() {
}
public void merge(DecoderCounters decoderCounters) {
this.decoderInitCount += decoderCounters.decoderInitCount;
this.decoderReleaseCount += decoderCounters.decoderReleaseCount;
this.inputBufferCount += decoderCounters.inputBufferCount;
this.renderedOutputBufferCount += decoderCounters.renderedOutputBufferCount;
this.skippedOutputBufferCount += decoderCounters.skippedOutputBufferCount;
this.droppedOutputBufferCount += decoderCounters.droppedOutputBufferCount;
this.maxConsecutiveDroppedOutputBufferCount = Math.max(this.maxConsecutiveDroppedOutputBufferCount, decoderCounters.maxConsecutiveDroppedOutputBufferCount);
}
}

View File

@@ -0,0 +1,66 @@
package com.fyber.inneractive.sdk.player.exoplayer2.decoder;
import android.annotation.TargetApi;
import android.media.MediaCodec;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
/* loaded from: classes2.dex */
public final class a {
public byte[] a;
public int[] b;
public int[] c;
public final MediaCodec.CryptoInfo d;
public final C0084a e;
@TargetApi(24)
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.decoder.a$a, reason: collision with other inner class name */
public static final class C0084a {
public final MediaCodec.CryptoInfo a;
public final MediaCodec.CryptoInfo.Pattern b;
public /* synthetic */ C0084a(MediaCodec.CryptoInfo cryptoInfo, int i) {
this(cryptoInfo);
}
public static void a(C0084a c0084a, int i, int i2) {
c0084a.b.set(i, i2);
c0084a.a.setPattern(c0084a.b);
}
public C0084a(MediaCodec.CryptoInfo cryptoInfo) {
this.a = cryptoInfo;
this.b = new MediaCodec.CryptoInfo.Pattern(0, 0);
}
}
public a() {
int i = s.a;
MediaCodec.CryptoInfo a = i >= 16 ? a() : null;
this.d = a;
this.e = i >= 24 ? new C0084a(a, 0) : null;
}
public final void a(int i, int[] iArr, int[] iArr2, byte[] bArr, byte[] bArr2) {
this.b = iArr;
this.c = iArr2;
this.a = bArr2;
int i2 = s.a;
if (i2 >= 16) {
MediaCodec.CryptoInfo cryptoInfo = this.d;
cryptoInfo.numSubSamples = i;
cryptoInfo.numBytesOfClearData = iArr;
cryptoInfo.numBytesOfEncryptedData = iArr2;
cryptoInfo.key = bArr;
cryptoInfo.iv = bArr2;
cryptoInfo.mode = 1;
if (i2 >= 24) {
C0084a.a(this.e, 0, 0);
}
}
}
@TargetApi(16)
public static MediaCodec.CryptoInfo a() {
return new MediaCodec.CryptoInfo();
}
}

View File

@@ -0,0 +1,28 @@
package com.fyber.inneractive.sdk.player.exoplayer2.decoder;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
public final class b {
public int a;
public ByteBuffer c;
public long d;
public final a b = new a();
public final int e = 0;
public static b b() {
return new b();
}
public final boolean a(int i) {
return (this.a & i) == i;
}
public final void a() {
this.a = 0;
ByteBuffer byteBuffer = this.c;
if (byteBuffer != null) {
byteBuffer.clear();
}
}
}

View File

@@ -0,0 +1,159 @@
package com.fyber.inneractive.sdk.player.exoplayer2.drm;
import android.os.Parcel;
import android.os.Parcelable;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import java.util.Arrays;
import java.util.Comparator;
import java.util.UUID;
/* loaded from: classes2.dex */
public final class a implements Comparator<b>, Parcelable {
public static final Parcelable.Creator<a> CREATOR = new C0085a();
public final b[] a;
public int b;
public final int c;
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.drm.a$a, reason: collision with other inner class name */
public class C0085a implements Parcelable.Creator<a> {
@Override // android.os.Parcelable.Creator
public final a createFromParcel(Parcel parcel) {
return new a(parcel);
}
@Override // android.os.Parcelable.Creator
public final a[] newArray(int i) {
return new a[i];
}
}
public static final class b implements Parcelable {
public static final Parcelable.Creator<b> CREATOR = new C0086a();
public int a;
public final UUID b;
public final String c;
public final byte[] d;
public final boolean e;
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.drm.a$b$a, reason: collision with other inner class name */
public class C0086a implements Parcelable.Creator<b> {
@Override // android.os.Parcelable.Creator
public final b createFromParcel(Parcel parcel) {
return new b(parcel);
}
@Override // android.os.Parcelable.Creator
public final b[] newArray(int i) {
return new b[i];
}
}
public b() {
throw null;
}
public b(UUID uuid, String str, byte[] bArr) {
this.b = (UUID) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(uuid);
this.c = (String) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(str);
this.d = (byte[]) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(bArr);
this.e = false;
}
@Override // android.os.Parcelable
public final int describeContents() {
return 0;
}
public final boolean equals(Object obj) {
if (!(obj instanceof b)) {
return false;
}
if (obj == this) {
return true;
}
b bVar = (b) obj;
return this.c.equals(bVar.c) && s.a(this.b, bVar.b) && Arrays.equals(this.d, bVar.d);
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
parcel.writeLong(this.b.getMostSignificantBits());
parcel.writeLong(this.b.getLeastSignificantBits());
parcel.writeString(this.c);
parcel.writeByteArray(this.d);
parcel.writeByte(this.e ? (byte) 1 : (byte) 0);
}
public final int hashCode() {
if (this.a == 0) {
this.a = Arrays.hashCode(this.d) + ((this.c.hashCode() + (this.b.hashCode() * 31)) * 31);
}
return this.a;
}
public b(Parcel parcel) {
this.b = new UUID(parcel.readLong(), parcel.readLong());
this.c = parcel.readString();
this.d = parcel.createByteArray();
this.e = parcel.readByte() != 0;
}
}
public a() {
throw null;
}
public a(boolean z, b... bVarArr) {
bVarArr = z ? (b[]) bVarArr.clone() : bVarArr;
Arrays.sort(bVarArr, this);
for (int i = 1; i < bVarArr.length; i++) {
if (bVarArr[i - 1].b.equals(bVarArr[i].b)) {
throw new IllegalArgumentException("Duplicate data for uuid: " + bVarArr[i].b);
}
}
this.a = bVarArr;
this.c = bVarArr.length;
}
@Override // java.util.Comparator
public final int compare(b bVar, b bVar2) {
b bVar3 = bVar;
b bVar4 = bVar2;
UUID uuid = com.fyber.inneractive.sdk.player.exoplayer2.b.b;
return uuid.equals(bVar3.b) ? uuid.equals(bVar4.b) ? 0 : 1 : bVar3.b.compareTo(bVar4.b);
}
@Override // android.os.Parcelable
public final int describeContents() {
return 0;
}
@Override // java.util.Comparator
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || a.class != obj.getClass()) {
return false;
}
return Arrays.equals(this.a, ((a) obj).a);
}
@Override // android.os.Parcelable
public final void writeToParcel(Parcel parcel, int i) {
parcel.writeTypedArray(this.a, 0);
}
public final int hashCode() {
if (this.b == 0) {
this.b = Arrays.hashCode(this.a);
}
return this.b;
}
public a(Parcel parcel) {
b[] bVarArr = (b[]) parcel.createTypedArray(b.CREATOR);
this.a = bVarArr;
this.c = bVarArr.length;
}
}

View File

@@ -0,0 +1,37 @@
package com.fyber.inneractive.sdk.player.exoplayer2;
/* loaded from: classes2.dex */
public interface e {
public interface a {
void a();
void a(int i, boolean z);
void a(d dVar);
void b();
void c();
void d();
void e();
}
public interface b {
void a(int i, Object obj) throws d;
}
public static final class c {
public final b a;
public final int b;
public final Object c;
public c(o oVar, int i, Object obj) {
this.a = oVar;
this.b = i;
this.c = obj;
}
}
}

View File

@@ -0,0 +1,37 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
/* loaded from: classes2.dex */
public final class a implements l {
public final long[] a;
public final long[] b;
public final long c;
public a(int[] iArr, long[] jArr, long[] jArr2, long[] jArr3) {
this.a = jArr;
this.b = jArr3;
int length = iArr.length;
if (length <= 0) {
this.c = 0L;
} else {
int i = length - 1;
this.c = jArr2[i] + jArr3[i];
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final boolean b() {
return true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final long c() {
return this.c;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final long a(long j) {
return this.a[s.a(this.b, j, true)];
}
}

View File

@@ -0,0 +1,109 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import java.io.EOFException;
import java.io.IOException;
import java.util.Arrays;
/* loaded from: classes2.dex */
public final class b {
public static final byte[] g = new byte[4096];
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a;
public final long b;
public long c;
public byte[] d = new byte[65536];
public int e;
public int f;
public b(com.fyber.inneractive.sdk.player.exoplayer2.upstream.f fVar, long j, long j2) {
this.a = fVar;
this.c = j;
this.b = j2;
}
public final boolean a(byte[] bArr, int i, int i2, boolean z) throws IOException, InterruptedException {
if (!a(i2, z)) {
return false;
}
System.arraycopy(this.d, this.e - i2, bArr, i, i2);
return true;
}
public final boolean b(byte[] bArr, int i, int i2, boolean z) throws IOException, InterruptedException {
int i3;
int i4 = this.f;
if (i4 == 0) {
i3 = 0;
} else {
int min = Math.min(i4, i2);
System.arraycopy(this.d, 0, bArr, i, min);
int i5 = this.f - min;
this.f = i5;
this.e = 0;
byte[] bArr2 = this.d;
byte[] bArr3 = i5 < bArr2.length - 524288 ? new byte[65536 + i5] : bArr2;
System.arraycopy(bArr2, min, bArr3, 0, i5);
this.d = bArr3;
i3 = min;
}
while (i3 < i2 && i3 != -1) {
i3 = a(bArr, i, i2, i3, z);
}
if (i3 != -1) {
this.c += i3;
}
return i3 != -1;
}
public final boolean a(int i, boolean z) throws IOException, InterruptedException {
int i2 = this.e + i;
byte[] bArr = this.d;
if (i2 > bArr.length) {
int i3 = s.a;
this.d = Arrays.copyOf(this.d, Math.max(65536 + i2, Math.min(bArr.length * 2, i2 + 524288)));
}
int min = Math.min(this.f - this.e, i);
while (min < i) {
min = a(this.d, this.e, i, min, z);
if (min == -1) {
return false;
}
}
int i4 = this.e + i;
this.e = i4;
this.f = Math.max(this.f, i4);
return true;
}
public final void a(int i) throws IOException, InterruptedException {
int min = Math.min(this.f, i);
int i2 = this.f - min;
this.f = i2;
this.e = 0;
byte[] bArr = this.d;
byte[] bArr2 = i2 < bArr.length - 524288 ? new byte[65536 + i2] : bArr;
System.arraycopy(bArr, min, bArr2, 0, i2);
this.d = bArr2;
int i3 = min;
while (i3 < i && i3 != -1) {
i3 = a(g, -i3, Math.min(i, i3 + 4096), i3, false);
}
if (i3 != -1) {
this.c += i3;
}
}
public final int a(byte[] bArr, int i, int i2, int i3, boolean z) throws InterruptedException, IOException {
if (!Thread.interrupted()) {
int read = this.a.read(bArr, i + i3, i2 - i3);
if (read != -1) {
return i3 + read;
}
if (i3 == 0 && z) {
return -1;
}
throw new EOFException();
}
throw new InterruptedException();
}
}

View File

@@ -0,0 +1,47 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.p;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.u;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.lang.reflect.Constructor;
/* loaded from: classes2.dex */
public final class c implements h {
public static final Constructor<? extends f> a;
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.h
public final synchronized f[] a() {
f[] fVarArr;
Constructor<? extends f> constructor = a;
fVarArr = new f[constructor == null ? 11 : 12];
fVarArr[0] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.mkv.d();
fVarArr[1] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.mp4.d(null);
fVarArr[2] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.mp4.f();
fVarArr[3] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.mp3.b(C.TIME_UNSET);
fVarArr[4] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.c(0L);
fVarArr[5] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.a(0L);
fVarArr[6] = new u(0);
fVarArr[7] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv.b();
fVarArr[8] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.ogg.c();
fVarArr[9] = new p();
fVarArr[10] = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.wav.a();
if (constructor != null) {
try {
fVarArr[11] = constructor.newInstance(new Object[0]);
} catch (Exception e) {
throw new IllegalStateException("Unexpected error creating FLAC extractor", e);
}
}
return fVarArr;
}
static {
Constructor<? extends f> constructor;
try {
constructor = Class.forName("com.fyber.inneractive.sdk.player.exoplayer2.ext.flac.FlacExtractor").asSubclass(f.class).getConstructor(new Class[0]);
} catch (ClassNotFoundException | NoSuchMethodException unused) {
constructor = null;
}
a = constructor;
}
}

View File

@@ -0,0 +1,691 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.jvm.internal.ByteCompanionObject;
/* loaded from: classes2.dex */
public final class d implements m {
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.b a;
public final int b;
public final b c;
public final LinkedBlockingDeque<com.fyber.inneractive.sdk.player.exoplayer2.upstream.a> d;
public final a e;
public final com.fyber.inneractive.sdk.player.exoplayer2.util.k f;
public final AtomicInteger g;
public long h;
public com.fyber.inneractive.sdk.player.exoplayer2.j i;
public long j;
public com.fyber.inneractive.sdk.player.exoplayer2.upstream.a k;
public int l;
public boolean m;
public c n;
public static final class a {
public int a;
public long b;
public long c;
public byte[] d;
public a() {
}
public /* synthetic */ a(int i) {
this();
}
}
public interface c {
void g();
}
public d(com.fyber.inneractive.sdk.player.exoplayer2.upstream.b bVar) {
this.a = bVar;
int a2 = ((com.fyber.inneractive.sdk.player.exoplayer2.upstream.j) bVar).a();
this.b = a2;
this.c = new b();
this.d = new LinkedBlockingDeque<>();
this.e = new a(0);
this.f = new com.fyber.inneractive.sdk.player.exoplayer2.util.k(32);
this.g = new AtomicInteger();
this.l = a2;
}
public final void a(boolean z) {
int andSet = this.g.getAndSet(z ? 0 : 2);
a();
b bVar = this.c;
bVar.m = Long.MIN_VALUE;
bVar.n = Long.MIN_VALUE;
if (andSet == 2) {
this.i = null;
}
}
public final void b() {
if (this.g.getAndSet(2) == 0) {
a();
}
}
public final void c() {
if (this.g.compareAndSet(1, 0)) {
return;
}
a();
}
public final long d() {
long max;
b bVar = this.c;
synchronized (bVar) {
max = Math.max(bVar.m, bVar.n);
}
return max;
}
public final com.fyber.inneractive.sdk.player.exoplayer2.j e() {
com.fyber.inneractive.sdk.player.exoplayer2.j jVar;
b bVar = this.c;
synchronized (bVar) {
jVar = bVar.p ? null : bVar.q;
}
return jVar;
}
public final void f() {
long j;
b bVar = this.c;
synchronized (bVar) {
int i = bVar.i;
if (i == 0) {
j = -1;
} else {
int i2 = bVar.k + i;
int i3 = bVar.a;
int i4 = (i2 - 1) % i3;
bVar.k = i2 % i3;
bVar.j += i;
bVar.i = 0;
j = bVar.c[i4] + bVar.d[i4];
}
}
if (j != -1) {
a(j);
}
}
public final boolean a(boolean z, long j) {
long j2;
b bVar = this.c;
synchronized (bVar) {
try {
if (bVar.i != 0) {
long[] jArr = bVar.f;
int i = bVar.k;
if (j >= jArr[i] && (j <= bVar.n || z)) {
int i2 = -1;
int i3 = 0;
while (i != bVar.l && bVar.f[i] <= j) {
if ((bVar.e[i] & 1) != 0) {
i2 = i3;
}
i = (i + 1) % bVar.a;
i3++;
}
if (i2 != -1) {
int i4 = (bVar.k + i2) % bVar.a;
bVar.k = i4;
bVar.j += i2;
bVar.i -= i2;
j2 = bVar.c[i4];
}
}
}
j2 = -1;
} catch (Throwable th) {
throw th;
}
}
if (j2 == -1) {
return false;
}
a(j2);
return true;
}
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.k kVar, com.fyber.inneractive.sdk.player.exoplayer2.decoder.b bVar, boolean z, boolean z2, long j) {
long j2;
char c2;
ByteBuffer allocateDirect;
ByteBuffer allocateDirect2;
int i;
b bVar2 = this.c;
com.fyber.inneractive.sdk.player.exoplayer2.j jVar = this.i;
a aVar = this.e;
synchronized (bVar2) {
try {
if (bVar2.i != 0) {
if (!z) {
com.fyber.inneractive.sdk.player.exoplayer2.j[] jVarArr = bVar2.h;
int i2 = bVar2.k;
if (jVarArr[i2] == jVar) {
if (bVar.c != null || bVar.e != 0) {
long j3 = bVar2.f[i2];
bVar.d = j3;
bVar.a = bVar2.e[i2];
aVar.a = bVar2.d[i2];
aVar.b = bVar2.c[i2];
aVar.d = bVar2.g[i2];
bVar2.m = Math.max(bVar2.m, j3);
int i3 = bVar2.i - 1;
bVar2.i = i3;
int i4 = bVar2.k + 1;
bVar2.k = i4;
bVar2.j++;
if (i4 == bVar2.a) {
bVar2.k = 0;
}
if (i3 > 0) {
j2 = bVar2.c[bVar2.k];
} else {
j2 = aVar.b + aVar.a;
}
aVar.c = j2;
c2 = 65532;
}
c2 = 65533;
}
}
kVar.a = bVar2.h[bVar2.k];
c2 = 65531;
} else if (z2) {
bVar.a = 4;
c2 = 65532;
} else {
com.fyber.inneractive.sdk.player.exoplayer2.j jVar2 = bVar2.q;
if (jVar2 != null && (z || jVar2 != jVar)) {
kVar.a = jVar2;
c2 = 65531;
}
c2 = 65533;
}
} catch (Throwable th) {
throw th;
}
}
if (c2 == 65531) {
this.i = kVar.a;
return -5;
}
if (c2 != 65532) {
if (c2 == 65533) {
return -3;
}
throw new IllegalStateException();
}
if (bVar.a(4)) {
return -4;
}
if (bVar.d < j) {
bVar.a |= Integer.MIN_VALUE;
}
if (bVar.a(1073741824)) {
a aVar2 = this.e;
long j4 = aVar2.b;
this.f.c(1);
a(1, j4, this.f.a);
long j5 = j4 + 1;
byte b2 = this.f.a[0];
boolean z3 = (b2 & ByteCompanionObject.MIN_VALUE) != 0;
int i5 = b2 & Byte.MAX_VALUE;
com.fyber.inneractive.sdk.player.exoplayer2.decoder.a aVar3 = bVar.b;
if (aVar3.a == null) {
aVar3.a = new byte[16];
}
a(i5, j5, aVar3.a);
long j6 = j5 + i5;
if (z3) {
this.f.c(2);
a(2, j6, this.f.a);
j6 += 2;
i = this.f.o();
} else {
i = 1;
}
com.fyber.inneractive.sdk.player.exoplayer2.decoder.a aVar4 = bVar.b;
int[] iArr = aVar4.b;
if (iArr == null || iArr.length < i) {
iArr = new int[i];
}
int[] iArr2 = iArr;
int[] iArr3 = aVar4.c;
if (iArr3 == null || iArr3.length < i) {
iArr3 = new int[i];
}
int[] iArr4 = iArr3;
if (z3) {
int i6 = i * 6;
this.f.c(i6);
a(i6, j6, this.f.a);
j6 += i6;
this.f.e(0);
for (int i7 = 0; i7 < i; i7++) {
iArr2[i7] = this.f.o();
iArr4[i7] = this.f.m();
}
} else {
iArr2[0] = 0;
iArr4[0] = aVar2.a - ((int) (j6 - aVar2.b));
}
com.fyber.inneractive.sdk.player.exoplayer2.decoder.a aVar5 = bVar.b;
aVar5.a(i, iArr2, iArr4, aVar2.d, aVar5.a);
long j7 = aVar2.b;
int i8 = (int) (j6 - j7);
aVar2.b = j7 + i8;
aVar2.a -= i8;
}
int i9 = this.e.a;
ByteBuffer byteBuffer = bVar.c;
if (byteBuffer == null) {
int i10 = bVar.e;
if (i10 == 1) {
allocateDirect2 = ByteBuffer.allocate(i9);
} else if (i10 == 2) {
allocateDirect2 = ByteBuffer.allocateDirect(i9);
} else {
throw new IllegalStateException("Buffer too small (" + (byteBuffer != null ? byteBuffer.capacity() : 0) + " < " + i9 + ")");
}
bVar.c = allocateDirect2;
} else {
int capacity = byteBuffer.capacity();
int position = bVar.c.position();
int i11 = i9 + position;
if (capacity < i11) {
int i12 = bVar.e;
if (i12 == 1) {
allocateDirect = ByteBuffer.allocate(i11);
} else if (i12 == 2) {
allocateDirect = ByteBuffer.allocateDirect(i11);
} else {
ByteBuffer byteBuffer2 = bVar.c;
throw new IllegalStateException("Buffer too small (" + (byteBuffer2 != null ? byteBuffer2.capacity() : 0) + " < " + i11 + ")");
}
if (position > 0) {
bVar.c.position(0);
bVar.c.limit(position);
allocateDirect.put(bVar.c);
}
bVar.c = allocateDirect;
}
}
a aVar6 = this.e;
long j8 = aVar6.b;
ByteBuffer byteBuffer3 = bVar.c;
int i13 = aVar6.a;
while (i13 > 0) {
a(j8);
int i14 = (int) (j8 - this.h);
int min = Math.min(i13, this.b - i14);
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a peek = this.d.peek();
byteBuffer3.put(peek.a, peek.b + i14, min);
j8 += min;
i13 -= min;
}
a(this.e.c);
return -4;
}
public static final class b {
public int i;
public int j;
public int k;
public int l;
public com.fyber.inneractive.sdk.player.exoplayer2.j q;
public int r;
public int a = 1000;
public int[] b = new int[1000];
public long[] c = new long[1000];
public long[] f = new long[1000];
public int[] e = new int[1000];
public int[] d = new int[1000];
public byte[][] g = new byte[1000][];
public com.fyber.inneractive.sdk.player.exoplayer2.j[] h = new com.fyber.inneractive.sdk.player.exoplayer2.j[1000];
public long m = Long.MIN_VALUE;
public long n = Long.MIN_VALUE;
public boolean p = true;
public boolean o = true;
public final synchronized void a(long j, int i, long j2, int i2, byte[] bArr) {
try {
if (this.o) {
if ((i & 1) == 0) {
return;
} else {
this.o = false;
}
}
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(!this.p);
b(j);
long[] jArr = this.f;
int i3 = this.l;
jArr[i3] = j;
long[] jArr2 = this.c;
jArr2[i3] = j2;
this.d[i3] = i2;
this.e[i3] = i;
this.g[i3] = bArr;
this.h[i3] = this.q;
this.b[i3] = this.r;
int i4 = this.i + 1;
this.i = i4;
int i5 = this.a;
if (i4 == i5) {
int i6 = i5 + 1000;
int[] iArr = new int[i6];
long[] jArr3 = new long[i6];
long[] jArr4 = new long[i6];
int[] iArr2 = new int[i6];
int[] iArr3 = new int[i6];
byte[][] bArr2 = new byte[i6][];
com.fyber.inneractive.sdk.player.exoplayer2.j[] jVarArr = new com.fyber.inneractive.sdk.player.exoplayer2.j[i6];
int i7 = this.k;
int i8 = i5 - i7;
System.arraycopy(jArr2, i7, jArr3, 0, i8);
System.arraycopy(this.f, this.k, jArr4, 0, i8);
System.arraycopy(this.e, this.k, iArr2, 0, i8);
System.arraycopy(this.d, this.k, iArr3, 0, i8);
System.arraycopy(this.g, this.k, bArr2, 0, i8);
System.arraycopy(this.h, this.k, jVarArr, 0, i8);
System.arraycopy(this.b, this.k, iArr, 0, i8);
int i9 = this.k;
System.arraycopy(this.c, 0, jArr3, i8, i9);
System.arraycopy(this.f, 0, jArr4, i8, i9);
System.arraycopy(this.e, 0, iArr2, i8, i9);
System.arraycopy(this.d, 0, iArr3, i8, i9);
System.arraycopy(this.g, 0, bArr2, i8, i9);
System.arraycopy(this.h, 0, jVarArr, i8, i9);
System.arraycopy(this.b, 0, iArr, i8, i9);
this.c = jArr3;
this.f = jArr4;
this.e = iArr2;
this.d = iArr3;
this.g = bArr2;
this.h = jVarArr;
this.b = iArr;
this.k = 0;
int i10 = this.a;
this.l = i10;
this.i = i10;
this.a = i6;
} else {
int i11 = i3 + 1;
this.l = i11;
if (i11 == i5) {
this.l = 0;
}
}
} catch (Throwable th) {
throw th;
}
}
public final synchronized void b(long j) {
this.n = Math.max(this.n, j);
}
public final synchronized boolean a(long j) {
try {
boolean z = false;
if (this.m >= j) {
return false;
}
int i = this.i;
while (i > 0 && this.f[((this.k + i) - 1) % this.a] >= j) {
i--;
}
int i2 = this.j;
int i3 = this.i;
int i4 = (i2 + i3) - (i + i2);
if (i4 >= 0 && i4 <= i3) {
z = true;
}
com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(z);
if (i4 != 0) {
int i5 = this.i - i4;
this.i = i5;
int i6 = this.l;
int i7 = this.a;
this.l = ((i6 + i7) - i4) % i7;
this.n = Long.MIN_VALUE;
for (int i8 = i5 - 1; i8 >= 0; i8--) {
int i9 = (this.k + i8) % this.a;
this.n = Math.max(this.n, this.f[i9]);
if ((this.e[i9] & 1) != 0) {
break;
}
}
long j2 = this.c[this.l];
} else if (this.j != 0) {
int i10 = this.l;
if (i10 == 0) {
i10 = this.a;
}
int i11 = i10 - 1;
long j3 = this.c[i11];
int i12 = this.d[i11];
}
return true;
} catch (Throwable th) {
throw th;
}
}
}
public final void a(int i, long j, byte[] bArr) {
int i2 = 0;
while (i2 < i) {
a(j);
int i3 = (int) (j - this.h);
int min = Math.min(i - i2, this.b - i3);
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a peek = this.d.peek();
System.arraycopy(peek.a, peek.b + i3, bArr, i2, min);
j += min;
i2 += min;
}
}
public final void a(long j) {
int i = ((int) (j - this.h)) / this.b;
for (int i2 = 0; i2 < i; i2++) {
com.fyber.inneractive.sdk.player.exoplayer2.upstream.b bVar = this.a;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a remove = this.d.remove();
com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar = (com.fyber.inneractive.sdk.player.exoplayer2.upstream.j) bVar;
synchronized (jVar) {
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a[] aVarArr = jVar.d;
aVarArr[0] = remove;
jVar.a(aVarArr);
}
this.h += this.b;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.j jVar) {
boolean z;
if (jVar == null) {
jVar = null;
}
b bVar = this.c;
synchronized (bVar) {
z = true;
if (jVar == null) {
bVar.p = true;
} else {
bVar.p = false;
if (!s.a(jVar, bVar.q)) {
bVar.q = jVar;
}
}
z = false;
}
c cVar = this.n;
if (cVar == null || !z) {
return;
}
cVar.g();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar, int i, boolean z) throws IOException, InterruptedException {
int i2 = 0;
if (!this.g.compareAndSet(0, 1)) {
int min = Math.min(bVar.f, i);
int i3 = bVar.f - min;
bVar.f = i3;
bVar.e = 0;
byte[] bArr = bVar.d;
byte[] bArr2 = i3 < bArr.length - 524288 ? new byte[65536 + i3] : bArr;
System.arraycopy(bArr, min, bArr2, 0, i3);
bVar.d = bArr2;
if (min == 0) {
min = bVar.a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b.g, 0, Math.min(i, 4096), 0, true);
}
if (min != -1) {
bVar.c += min;
}
if (min != -1) {
return min;
}
if (z) {
return -1;
}
throw new EOFException();
}
try {
int a2 = a(i);
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a aVar = this.k;
byte[] bArr3 = aVar.a;
int i4 = this.l + aVar.b;
int i5 = bVar.f;
if (i5 != 0) {
int min2 = Math.min(i5, a2);
System.arraycopy(bVar.d, 0, bArr3, i4, min2);
int i6 = bVar.f - min2;
bVar.f = i6;
bVar.e = 0;
byte[] bArr4 = bVar.d;
byte[] bArr5 = i6 < bArr4.length - 524288 ? new byte[65536 + i6] : bArr4;
System.arraycopy(bArr4, min2, bArr5, 0, i6);
bVar.d = bArr5;
i2 = min2;
}
if (i2 == 0) {
i2 = bVar.a(bArr3, i4, a2, 0, true);
}
if (i2 != -1) {
bVar.c += i2;
}
if (i2 == -1) {
if (z) {
c();
return -1;
}
throw new EOFException();
}
this.l += i2;
this.j += i2;
c();
return i2;
} catch (Throwable th) {
c();
throw th;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(int i, com.fyber.inneractive.sdk.player.exoplayer2.util.k kVar) {
if (!this.g.compareAndSet(0, 1)) {
kVar.f(i);
return;
}
while (i > 0) {
int a2 = a(i);
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a aVar = this.k;
kVar.a(aVar.a, aVar.b + this.l, a2);
this.l += a2;
this.j += a2;
i -= a2;
}
c();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(long j, int i, int i2, int i3, byte[] bArr) {
if (!this.g.compareAndSet(0, 1)) {
this.c.b(j);
return;
}
try {
if (this.m) {
if ((i & 1) != 0 && this.c.a(j)) {
this.m = false;
}
return;
}
this.c.a(j, i, (this.j - i2) - i3, i2, bArr);
} finally {
c();
}
}
public final void a() {
b bVar = this.c;
bVar.j = 0;
bVar.k = 0;
bVar.l = 0;
bVar.i = 0;
bVar.o = true;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.b bVar2 = this.a;
LinkedBlockingDeque<com.fyber.inneractive.sdk.player.exoplayer2.upstream.a> linkedBlockingDeque = this.d;
((com.fyber.inneractive.sdk.player.exoplayer2.upstream.j) bVar2).a((com.fyber.inneractive.sdk.player.exoplayer2.upstream.a[]) linkedBlockingDeque.toArray(new com.fyber.inneractive.sdk.player.exoplayer2.upstream.a[linkedBlockingDeque.size()]));
this.d.clear();
((com.fyber.inneractive.sdk.player.exoplayer2.upstream.j) this.a).b();
this.h = 0L;
this.j = 0L;
this.k = null;
this.l = this.b;
}
public final int a(int i) {
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a aVar;
if (this.l == this.b) {
this.l = 0;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar = (com.fyber.inneractive.sdk.player.exoplayer2.upstream.j) this.a;
synchronized (jVar) {
try {
jVar.f++;
int i2 = jVar.g;
if (i2 > 0) {
com.fyber.inneractive.sdk.player.exoplayer2.upstream.a[] aVarArr = jVar.h;
int i3 = i2 - 1;
jVar.g = i3;
aVar = aVarArr[i3];
aVarArr[i3] = null;
} else {
aVar = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.a(new byte[jVar.b], 0);
}
} catch (Throwable th) {
throw th;
}
}
this.k = aVar;
this.d.add(aVar);
}
return Math.min(i, this.b - this.l);
}
}

View File

@@ -0,0 +1,45 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import java.io.EOFException;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class e implements m {
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(int i, com.fyber.inneractive.sdk.player.exoplayer2.util.k kVar) {
kVar.f(i);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(long j, int i, int i2, int i3, byte[] bArr) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.j jVar) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.m
public final int a(b bVar, int i, boolean z) throws IOException, InterruptedException {
int min = Math.min(bVar.f, i);
int i2 = bVar.f - min;
bVar.f = i2;
bVar.e = 0;
byte[] bArr = bVar.d;
byte[] bArr2 = i2 < bArr.length - 524288 ? new byte[65536 + i2] : bArr;
System.arraycopy(bArr, min, bArr2, 0, i2);
bVar.d = bArr2;
if (min == 0) {
min = bVar.a(b.g, 0, Math.min(i, 4096), 0, true);
}
if (min != -1) {
bVar.c += min;
}
if (min != -1) {
return min;
}
if (z) {
return -1;
}
throw new EOFException();
}
}

View File

@@ -0,0 +1,16 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import java.io.IOException;
/* loaded from: classes2.dex */
public interface f {
int a(b bVar, k kVar) throws IOException, InterruptedException;
void a();
void a(long j, long j2);
void a(g gVar);
boolean a(b bVar) throws IOException, InterruptedException;
}

View File

@@ -0,0 +1,67 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv;
import android.util.Pair;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv.d;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.m;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import com.fyber.inneractive.sdk.player.exoplayer2.util.k;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import java.util.Collections;
/* loaded from: classes2.dex */
public final class a extends d {
public static final int[] e = {5512, 11025, 22050, 44100};
public boolean b;
public boolean c;
public int d;
public a(m mVar) {
super(mVar);
}
public final boolean a(k kVar) throws d.a {
if (this.b) {
kVar.f(1);
} else {
int j = kVar.j();
int i = (j >> 4) & 15;
this.d = i;
if (i == 2) {
this.a.a(j.a(null, MimeTypes.AUDIO_MPEG, -1, -1, 1, e[(j >> 2) & 3], -1, null, null, 0, null));
this.c = true;
} else if (i == 7 || i == 8) {
this.a.a(j.a(null, i == 7 ? MimeTypes.AUDIO_ALAW : MimeTypes.AUDIO_MLAW, -1, -1, 1, 8000, (j & 1) == 1 ? 2 : 3, null, null, 0, null));
this.c = true;
} else if (i != 10) {
throw new d.a("Audio format not supported: " + this.d);
}
this.b = true;
}
return true;
}
public final void a(long j, k kVar) {
if (this.d == 2) {
int a = kVar.a();
this.a.a(a, kVar);
this.a.a(j, 1, a, 0, null);
return;
}
int j2 = kVar.j();
if (j2 != 0 || this.c) {
if (this.d != 10 || j2 == 1) {
int a2 = kVar.a();
this.a.a(a2, kVar);
this.a.a(j, 1, a2, 0, null);
return;
}
return;
}
int a3 = kVar.a();
byte[] bArr = new byte[a3];
kVar.a(bArr, 0, a3);
Pair<Integer, Integer> a4 = com.fyber.inneractive.sdk.player.exoplayer2.util.c.a(bArr);
this.a.a(j.a(null, MimeTypes.AUDIO_AAC, -1, -1, ((Integer) a4.second).intValue(), ((Integer) a4.first).intValue(), -1, Collections.singletonList(bArr), null, 0, null));
this.c = true;
}
}

View File

@@ -0,0 +1,174 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.f;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.g;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.l;
import com.fyber.inneractive.sdk.player.exoplayer2.util.k;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class b implements f, l {
public static final int n = s.a("FLV");
public g e;
public int g;
public int h;
public int i;
public long j;
public a k;
public e l;
public c m;
public final k a = new k(4);
public final k b = new k(9);
public final k c = new k(11);
public final k d = new k();
public int f = 1;
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final long a(long j) {
return 0L;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a(long j, long j2) {
this.f = 1;
this.g = 0;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a(g gVar) {
this.e = gVar;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final boolean a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar) throws IOException, InterruptedException {
bVar.a(this.a.a, 0, 3, false);
this.a.e(0);
if (this.a.l() != n) {
return false;
}
bVar.a(this.a.a, 0, 2, false);
this.a.e(0);
if ((this.a.o() & 250) != 0) {
return false;
}
bVar.a(this.a.a, 0, 4, false);
this.a.e(0);
int c = this.a.c();
bVar.e = 0;
bVar.a(c, false);
bVar.a(this.a.a, 0, 4, false);
this.a.e(0);
return this.a.c() == 0;
}
public final k b(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar) throws IOException, InterruptedException {
if (this.i > this.d.b()) {
k kVar = this.d;
kVar.a(new byte[Math.max(kVar.b() * 2, this.i)], 0);
} else {
this.d.e(0);
}
this.d.d(this.i);
bVar.b(this.d.a, 0, this.i, false);
return this.d;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final boolean b() {
return false;
}
public final boolean c(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar) throws IOException, InterruptedException {
boolean z;
c cVar;
e eVar;
a aVar;
int i = this.h;
if (i == 8 && (aVar = this.k) != null) {
k b = b(bVar);
long j = this.j;
aVar.a(b);
aVar.a(j, b);
} else if (i == 9 && (eVar = this.l) != null) {
k b2 = b(bVar);
long j2 = this.j;
if (eVar.a(b2)) {
eVar.a(j2, b2);
}
} else {
if (i != 18 || (cVar = this.m) == null) {
bVar.a(this.i);
z = false;
this.g = 4;
this.f = 2;
return z;
}
cVar.a(this.j, b(bVar));
}
z = true;
this.g = 4;
this.f = 2;
return z;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.l
public final long c() {
return this.m.b;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar, com.fyber.inneractive.sdk.player.exoplayer2.extractor.k kVar) throws IOException, InterruptedException {
while (true) {
int i = this.f;
if (i != 1) {
if (i == 2) {
bVar.a(this.g);
this.g = 0;
this.f = 3;
} else if (i != 3) {
if (i == 4 && c(bVar)) {
return 0;
}
} else {
if (!bVar.b(this.c.a, 0, 11, true)) {
return -1;
}
this.c.e(0);
this.h = this.c.j();
this.i = this.c.l();
this.j = this.c.l();
this.j = ((this.c.j() << 24) | this.j) * 1000;
this.c.f(3);
this.f = 4;
}
} else {
if (!bVar.b(this.b.a, 0, 9, true)) {
return -1;
}
this.b.e(0);
this.b.f(4);
int j = this.b.j();
boolean z = (j & 4) != 0;
boolean z2 = (j & 1) != 0;
if (z && this.k == null) {
this.k = new a(this.e.a(8, 1));
}
if (z2 && this.l == null) {
this.l = new e(this.e.a(9, 2));
}
if (this.m == null) {
this.m = new c();
}
this.e.b();
this.e.a(this);
this.g = this.b.c() - 5;
this.f = 2;
}
}
}
}

View File

@@ -0,0 +1,96 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv;
import com.fyber.inneractive.sdk.player.exoplayer2.m;
import com.fyber.inneractive.sdk.player.exoplayer2.util.k;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
/* loaded from: classes2.dex */
public final class c extends d {
public long b;
public c() {
super(null);
this.b = C.TIME_UNSET;
}
public final void a(long j, k kVar) throws m {
if (kVar.j() != 2) {
throw new m();
}
int o = kVar.o();
int i = kVar.b;
kVar.f(o);
if ("onMetaData".equals(new String(kVar.a, i, o)) && kVar.j() == 8) {
HashMap<String, Object> a = a(kVar);
if (a.containsKey(IronSourceConstants.EVENTS_DURATION)) {
double doubleValue = ((Double) a.get(IronSourceConstants.EVENTS_DURATION)).doubleValue();
if (doubleValue > 0.0d) {
this.b = (long) (doubleValue * 1000000.0d);
}
}
}
}
public static Serializable a(int i, k kVar) {
if (i == 8) {
return a(kVar);
}
if (i == 10) {
int m = kVar.m();
ArrayList arrayList = new ArrayList(m);
for (int i2 = 0; i2 < m; i2++) {
arrayList.add(a(kVar.j(), kVar));
}
return arrayList;
}
if (i == 11) {
Date date = new Date((long) Double.valueOf(Double.longBitsToDouble(kVar.h())).doubleValue());
kVar.f(2);
return date;
}
if (i == 0) {
return Double.valueOf(Double.longBitsToDouble(kVar.h()));
}
if (i == 1) {
return Boolean.valueOf(kVar.j() == 1);
}
if (i == 2) {
int o = kVar.o();
int i3 = kVar.b;
kVar.f(o);
return new String(kVar.a, i3, o);
}
if (i != 3) {
return null;
}
HashMap hashMap = new HashMap();
while (true) {
int o2 = kVar.o();
int i4 = kVar.b;
kVar.f(o2);
String str = new String(kVar.a, i4, o2);
int j = kVar.j();
if (j == 9) {
return hashMap;
}
hashMap.put(str, a(j, kVar));
}
}
public static HashMap<String, Object> a(k kVar) {
int m = kVar.m();
HashMap<String, Object> hashMap = new HashMap<>(m);
for (int i = 0; i < m; i++) {
int o = kVar.o();
int i2 = kVar.b;
kVar.f(o);
hashMap.put(new String(kVar.a, i2, o), a(kVar.j(), kVar));
}
return hashMap;
}
}

View File

@@ -0,0 +1,18 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.m;
/* loaded from: classes2.dex */
public abstract class d {
public final m a;
public static final class a extends com.fyber.inneractive.sdk.player.exoplayer2.m {
public a(String str) {
super(str);
}
}
public d(m mVar) {
this.a = mVar;
}
}

View File

@@ -0,0 +1,65 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.flv.d;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.m;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import com.fyber.inneractive.sdk.player.exoplayer2.util.i;
import com.fyber.inneractive.sdk.player.exoplayer2.util.k;
/* loaded from: classes2.dex */
public final class e extends d {
public final k b;
public final k c;
public int d;
public boolean e;
public int f;
public e(m mVar) {
super(mVar);
this.b = new k(i.a);
this.c = new k(4);
}
public final boolean a(k kVar) throws d.a {
int j = kVar.j();
int i = (j >> 4) & 15;
int i2 = j & 15;
if (i2 != 7) {
throw new d.a(com.fyber.inneractive.sdk.player.exoplayer2.i.a("Video format not supported: ", i2));
}
this.f = i;
return i != 5;
}
public final void a(long j, k kVar) throws com.fyber.inneractive.sdk.player.exoplayer2.m {
int j2 = kVar.j();
long l = (kVar.l() * 1000) + j;
if (j2 == 0 && !this.e) {
k kVar2 = new k(new byte[kVar.a()]);
kVar.a(kVar2.a, 0, kVar.a());
com.fyber.inneractive.sdk.player.exoplayer2.video.a a = com.fyber.inneractive.sdk.player.exoplayer2.video.a.a(kVar2);
this.d = a.b;
this.a.a(new j(null, null, "video/avc", null, -1, -1, a.c, a.d, -1.0f, -1, a.e, null, -1, null, -1, -1, -1, -1, -1, 0, null, -1, Long.MAX_VALUE, a.a, null, null));
this.e = true;
return;
}
if (j2 == 1 && this.e) {
byte[] bArr = this.c.a;
bArr[0] = 0;
bArr[1] = 0;
bArr[2] = 0;
int i = 4 - this.d;
int i2 = 0;
while (kVar.a() > 0) {
kVar.a(this.c.a, i, this.d);
this.c.e(0);
int m = this.c.m();
this.b.e(0);
this.a.a(4, this.b);
this.a.a(m, kVar);
i2 = i2 + 4 + m;
}
this.a.a(l, this.f == 1 ? 1 : 0, i2, 0, null);
}
}
}

View File

@@ -0,0 +1,10 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
/* loaded from: classes2.dex */
public interface g {
d a(int i, int i2);
void a(l lVar);
void b();
}

View File

@@ -0,0 +1,6 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
/* loaded from: classes2.dex */
public interface h {
f[] a();
}

View File

@@ -0,0 +1,63 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.net.Uri;
import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/* loaded from: classes2.dex */
public final class a implements com.fyber.inneractive.sdk.player.exoplayer2.upstream.f {
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a;
public final byte[] b;
public final byte[] c;
public CipherInputStream d;
public a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.f fVar, byte[] bArr, byte[] bArr2) {
this.a = fVar;
this.b = bArr;
this.c = bArr2;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final long a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar) throws IOException {
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
try {
cipher.init(2, new SecretKeySpec(this.b, "AES"), new IvParameterSpec(this.c));
this.d = new CipherInputStream(new com.fyber.inneractive.sdk.player.exoplayer2.upstream.h(this.a, iVar), cipher);
return -1L;
} catch (InvalidAlgorithmParameterException | InvalidKeyException e) {
throw new RuntimeException(e);
}
} catch (NoSuchAlgorithmException | NoSuchPaddingException e2) {
throw new RuntimeException(e2);
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final int read(byte[] bArr, int i, int i2) throws IOException {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.d != null);
int read = this.d.read(bArr, i, i2);
if (read < 0) {
return -1;
}
return read;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final void close() throws IOException {
this.d = null;
this.a.close();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.f
public final Uri a() {
return this.a.a();
}
}

View File

@@ -0,0 +1,16 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.f;
/* loaded from: classes2.dex */
public final class b implements d {
public final f.a a;
public b(f.a aVar) {
this.a = aVar;
}
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a() {
return this.a.a();
}
}

View File

@@ -0,0 +1,124 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.net.Uri;
import android.os.SystemClock;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.source.t;
import java.math.BigInteger;
import java.util.List;
import java.util.Locale;
/* loaded from: classes2.dex */
public final class c {
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a;
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f b;
public final k c;
public final a.C0088a[] d;
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e e;
public final t f;
public final List<com.fyber.inneractive.sdk.player.exoplayer2.j> g;
public boolean h;
public byte[] i;
public com.fyber.inneractive.sdk.player.exoplayer2.source.g j;
public a.C0088a k;
public Uri l;
public byte[] m;
public String n;
public byte[] o;
public com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e p;
public static final class a extends com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.c {
public final String l;
public byte[] m;
public a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.f fVar, com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar, com.fyber.inneractive.sdk.player.exoplayer2.j jVar, int i, Object obj, byte[] bArr, String str) {
super(fVar, iVar, jVar, i, obj, bArr);
this.l = str;
}
}
public static final class b {
public com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a a;
public boolean b;
public a.C0088a c;
public b() {
a();
}
public final void a() {
this.a = null;
this.b = false;
this.c = null;
}
}
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.c$c, reason: collision with other inner class name */
public static final class C0087c extends com.fyber.inneractive.sdk.player.exoplayer2.trackselection.a {
public int g;
public C0087c(t tVar, int[] iArr) {
super(tVar, iArr);
this.g = a(tVar.a(0));
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e
public final void a() {
long elapsedRealtime = SystemClock.elapsedRealtime();
if (this.e[this.g] > elapsedRealtime) {
for (int i = this.b - 1; i >= 0; i--) {
if (this.e[i] <= elapsedRealtime) {
this.g = i;
return;
}
}
throw new IllegalStateException();
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e
public final int e() {
return 0;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e
public final int f() {
return this.g;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e
public final Object g() {
return null;
}
}
public c(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e eVar, a.C0088a[] c0088aArr, d dVar, k kVar, List<com.fyber.inneractive.sdk.player.exoplayer2.j> list) {
this.e = eVar;
this.d = c0088aArr;
this.c = kVar;
this.g = list;
com.fyber.inneractive.sdk.player.exoplayer2.j[] jVarArr = new com.fyber.inneractive.sdk.player.exoplayer2.j[c0088aArr.length];
int[] iArr = new int[c0088aArr.length];
for (int i = 0; i < c0088aArr.length; i++) {
jVarArr[i] = c0088aArr[i].b;
iArr[i] = i;
}
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.b bVar = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.b) dVar;
this.a = bVar.a();
this.b = bVar.a();
t tVar = new t(jVarArr);
this.f = tVar;
this.p = new C0087c(tVar, iArr);
}
public final void a(Uri uri, String str, byte[] bArr) {
byte[] byteArray = new BigInteger(str.toLowerCase(Locale.getDefault()).startsWith("0x") ? str.substring(2) : str, 16).toByteArray();
byte[] bArr2 = new byte[16];
int length = byteArray.length > 16 ? byteArray.length - 16 : 0;
System.arraycopy(byteArray, length, bArr2, (16 - byteArray.length) + length, byteArray.length - length);
this.l = uri;
this.m = bArr;
this.n = str;
this.o = bArr2;
}
}

View File

@@ -0,0 +1,5 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
/* loaded from: classes2.dex */
public interface d {
}

View File

@@ -0,0 +1,5 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
/* loaded from: classes2.dex */
public final class e {
}

View File

@@ -0,0 +1,155 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.metadata.a;
import com.fyber.inneractive.sdk.player.exoplayer2.util.p;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes2.dex */
public final class f extends com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.d {
public static final AtomicInteger G = new AtomicInteger();
public int A;
public int B;
public boolean C;
public j D;
public volatile boolean E;
public volatile boolean F;
public final int j;
public final int k;
public final a.C0088a l;
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.f m;
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.i n;
public final boolean o;
public final boolean p;
public final p q;
public final String r;
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.f s;
public final boolean t;
public final boolean u;
public final List<com.fyber.inneractive.sdk.player.exoplayer2.j> v;
public final boolean w;
public final com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.g x;
public final com.fyber.inneractive.sdk.player.exoplayer2.util.k y;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.f z;
public f(com.fyber.inneractive.sdk.player.exoplayer2.upstream.f fVar, com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar, com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar2, a.C0088a c0088a, List<com.fyber.inneractive.sdk.player.exoplayer2.j> list, int i, Object obj, long j, long j2, int i2, int i3, boolean z, p pVar, f fVar2, byte[] bArr, byte[] bArr2) {
super(i, i2, j, j2, c0088a.b, a(fVar, bArr, bArr2), iVar, obj);
this.k = i3;
this.n = iVar2;
this.l = c0088a;
this.v = list;
this.p = z;
this.q = pVar;
this.o = this.h instanceof a;
String lastPathSegment = iVar.a.getLastPathSegment();
this.r = lastPathSegment;
boolean z2 = lastPathSegment.endsWith(".aac") || lastPathSegment.endsWith(".ac3") || lastPathSegment.endsWith(".ec3") || lastPathSegment.endsWith(".mp3");
this.w = z2;
if (fVar2 != null) {
this.x = fVar2.x;
this.y = fVar2.y;
this.s = fVar2.z;
boolean z3 = fVar2.l != c0088a;
this.t = z3;
this.u = fVar2.k != i3 || z3;
} else {
this.x = z2 ? new com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.g() : null;
this.y = z2 ? new com.fyber.inneractive.sdk.player.exoplayer2.util.k(10) : null;
this.s = null;
this.t = false;
this.u = true;
}
this.m = fVar;
this.j = G.getAndIncrement();
}
public final long a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar) throws IOException, InterruptedException {
com.fyber.inneractive.sdk.player.exoplayer2.metadata.a a;
bVar.e = 0;
if (!bVar.a(this.y.a, 0, 10, true)) {
return C.TIME_UNSET;
}
this.y.c(10);
if (this.y.l() != com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.g.b) {
return C.TIME_UNSET;
}
this.y.f(3);
int i = this.y.i();
int i2 = i + 10;
if (i2 > this.y.b()) {
com.fyber.inneractive.sdk.player.exoplayer2.util.k kVar = this.y;
byte[] bArr = kVar.a;
kVar.c(i2);
System.arraycopy(bArr, 0, this.y.a, 0, 10);
}
if (!bVar.a(this.y.a, 10, i, true) || (a = this.x.a(this.y.a, i)) == null) {
return C.TIME_UNSET;
}
int length = a.a.length;
for (int i3 = 0; i3 < length; i3++) {
a.b bVar2 = a.a[i3];
if (bVar2 instanceof com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.i) {
com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.i iVar = (com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.i) bVar2;
if ("com.apple.streaming.transportStreamTimestamp".equals(iVar.b)) {
System.arraycopy(iVar.c, 0, this.y.a, 0, 8);
this.y.c(8);
return this.y.h();
}
}
}
return C.TIME_UNSET;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.c
public final boolean a() {
return this.E;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.c
public final void b() {
this.E = true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a
public final long c() {
return this.B;
}
/* JADX WARN: Removed duplicated region for block: B:15:0x00e8 */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.c
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void load() throws java.io.IOException, java.lang.InterruptedException {
/*
Method dump skipped, instructions count: 573
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f.load():void");
}
public static com.fyber.inneractive.sdk.player.exoplayer2.upstream.f a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.f fVar, byte[] bArr, byte[] bArr2) {
return (bArr == null || bArr2 == null) ? fVar : new a(fVar, bArr, bArr2);
}
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.f a(long j) {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.f aVar;
if (this.r.endsWith(".aac")) {
aVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.c(j);
} else if (!this.r.endsWith(".ac3") && !this.r.endsWith(".ec3")) {
if (this.r.endsWith(".mp3")) {
aVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.mp3.b(j);
} else {
throw new IllegalArgumentException("Unkown extension for audio file: " + this.r);
}
} else {
aVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.ts.a(j);
}
aVar.a(this.D);
return aVar;
}
}

View File

@@ -0,0 +1,466 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.os.Handler;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.j;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e;
import com.fyber.inneractive.sdk.player.exoplayer2.source.f;
import com.fyber.inneractive.sdk.player.exoplayer2.source.o;
import com.fyber.inneractive.sdk.player.exoplayer2.source.q;
import com.fyber.inneractive.sdk.player.exoplayer2.source.t;
import com.fyber.inneractive.sdk.player.exoplayer2.source.u;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
/* loaded from: classes2.dex */
public final class g implements o, j.b, e.b {
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e a;
public final d b;
public final int c;
public final f.a d;
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.b e;
public final IdentityHashMap<q, Integer> f = new IdentityHashMap<>();
public final k g = new k();
public final Handler h = new Handler();
public final long i;
public o.a j;
public int k;
public boolean l;
public u m;
public j[] n;
public j[] o;
public com.fyber.inneractive.sdk.player.exoplayer2.source.h p;
public g(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e eVar, d dVar, int i, f.a aVar, com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar, long j) {
this.a = eVar;
this.b = dVar;
this.c = i;
this.d = aVar;
this.e = jVar;
this.i = j;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final long c() {
return C.TIME_UNSET;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final u d() {
return this.m;
}
/* JADX ERROR: NullPointerException in pass: LoopRegionVisitor
java.lang.NullPointerException
*/
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final long e() {
/*
r16 = this;
r1 = r16
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.j[] r0 = r1.o
int r2 = r0.length
r6 = 0
r7 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
Lb:
if (r6 >= r2) goto L88
r11 = r0[r6]
boolean r12 = r11.y
if (r12 == 0) goto L18
r3 = -9223372036854775808
r12 = -9223372036854775808
goto L7d
L18:
long r12 = r11.x
r14 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
int r14 = (r12 > r14 ? 1 : (r12 == r14 ? 0 : -1))
if (r14 == 0) goto L24
goto L7b
L24:
long r12 = r11.w
java.util.LinkedList<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f> r14 = r11.k
java.lang.Object r14 = r14.getLast()
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f r14 = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f) r14
boolean r15 = r14.F
if (r15 == 0) goto L33
goto L4c
L33:
java.util.LinkedList<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f> r14 = r11.k
int r14 = r14.size()
r15 = 1
if (r14 <= r15) goto L4b
java.util.LinkedList<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f> r14 = r11.k
int r15 = r14.size()
int r15 = r15 + (-2)
java.lang.Object r14 = r14.get(r15)
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f r14 = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f) r14
goto L4c
L4b:
r14 = 0
L4c:
if (r14 == 0) goto L54
long r14 = r14.g
long r12 = java.lang.Math.max(r12, r14)
L54:
android.util.SparseArray<com.fyber.inneractive.sdk.player.exoplayer2.extractor.d> r14 = r11.j
int r14 = r14.size()
r15 = 0
L5b:
if (r15 >= r14) goto L7b
android.util.SparseArray<com.fyber.inneractive.sdk.player.exoplayer2.extractor.d> r5 = r11.j
java.lang.Object r5 = r5.valueAt(r15)
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d r5 = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.d) r5
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d$b r5 = r5.c
monitor-enter(r5)
long r3 = r5.m // Catch: java.lang.Throwable -> L78
long r9 = r5.n // Catch: java.lang.Throwable -> L78
long r3 = java.lang.Math.max(r3, r9) // Catch: java.lang.Throwable -> L78
monitor-exit(r5)
long r12 = java.lang.Math.max(r12, r3)
int r15 = r15 + 1
goto L5b
L78:
r0 = move-exception
monitor-exit(r5)
throw r0
L7b:
r3 = -9223372036854775808
L7d:
int r3 = (r12 > r3 ? 1 : (r12 == r3 ? 0 : -1))
if (r3 == 0) goto L85
long r7 = java.lang.Math.min(r7, r12)
L85:
int r6 = r6 + 1
goto Lb
L88:
r3 = -9223372036854775808
r5 = 9223372036854775807(0x7fffffffffffffff, double:NaN)
int r0 = (r7 > r5 ? 1 : (r7 == r5 ? 0 : -1))
if (r0 != 0) goto L94
r7 = r3
L94:
return r7
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.g.e():long");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final void h() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final void a(o.a aVar) {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d dVar;
this.a.g.add(this);
this.j = aVar;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a aVar2 = this.a.j;
ArrayList arrayList = new ArrayList(aVar2.b);
ArrayList arrayList2 = new ArrayList();
ArrayList arrayList3 = new ArrayList();
for (int i = 0; i < arrayList.size(); i++) {
a.C0088a c0088a = (a.C0088a) arrayList.get(i);
com.fyber.inneractive.sdk.player.exoplayer2.j jVar = c0088a.b;
if (jVar.k <= 0) {
String str = jVar.c;
if (!TextUtils.isEmpty(str)) {
for (String str2 : str.split("(\\s*,\\s*)|(\\s*$)")) {
if (!str2.startsWith("avc")) {
}
}
}
String str3 = c0088a.b.c;
if (!TextUtils.isEmpty(str3)) {
String[] split = str3.split("(\\s*,\\s*)|(\\s*$)");
int length = split.length;
int i2 = 0;
while (true) {
if (i2 >= length) {
break;
}
if (split[i2].startsWith("mp4a")) {
arrayList3.add(c0088a);
break;
}
i2++;
}
}
}
arrayList2.add(c0088a);
}
if (!arrayList2.isEmpty()) {
arrayList = arrayList2;
} else if (arrayList3.size() < arrayList.size()) {
arrayList.removeAll(arrayList3);
}
List<a.C0088a> list = aVar2.c;
List<a.C0088a> list2 = aVar2.d;
int size = list2.size() + list.size() + 1;
this.n = new j[size];
this.k = size;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(!arrayList.isEmpty());
a.C0088a[] c0088aArr = new a.C0088a[arrayList.size()];
arrayList.toArray(c0088aArr);
com.fyber.inneractive.sdk.player.exoplayer2.j jVar2 = aVar2.e;
c cVar = new c(this.a, c0088aArr, this.b, this.g, aVar2.f);
j jVar3 = new j(0, this, cVar, this.e, this.i, jVar2, this.c, this.d);
this.n[0] = jVar3;
cVar.h = true;
if (!jVar3.o) {
jVar3.a(jVar3.w);
}
int i3 = 0;
int i4 = 1;
while (i3 < list.size()) {
j jVar4 = new j(1, this, new c(this.a, new a.C0088a[]{list.get(i3)}, this.b, this.g, Collections.emptyList()), this.e, this.i, null, this.c, this.d);
int i5 = i4 + 1;
this.n[i4] = jVar4;
if (!jVar4.o) {
jVar4.a(jVar4.w);
}
i3++;
i4 = i5;
}
int i6 = 0;
while (i6 < list2.size()) {
a.C0088a c0088a2 = list2.get(i6);
c cVar2 = new c(this.a, new a.C0088a[]{c0088a2}, this.b, this.g, Collections.emptyList());
com.fyber.inneractive.sdk.player.exoplayer2.upstream.b bVar = this.e;
List<a.C0088a> list3 = list2;
j jVar5 = new j(3, this, cVar2, bVar, this.i, null, this.c, this.d);
com.fyber.inneractive.sdk.player.exoplayer2.j jVar6 = c0088a2.b;
if (jVar5.j.indexOfKey(0) >= 0) {
dVar = jVar5.j.get(0);
} else {
dVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.d(bVar);
dVar.n = jVar5;
dVar.c.r = jVar5.r;
jVar5.j.put(0, dVar);
}
dVar.a(jVar6);
jVar5.n = true;
jVar5.i();
this.n[i4] = jVar5;
i6++;
i4++;
list2 = list3;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final long b(long j) {
this.g.a.clear();
for (j jVar : this.o) {
jVar.w = j;
jVar.x = j;
jVar.y = false;
jVar.k.clear();
if (jVar.g.a()) {
v.b<? extends v.c> bVar = jVar.g.b;
bVar.h = false;
bVar.e = null;
if (bVar.hasMessages(0)) {
bVar.removeMessages(0);
bVar.sendEmptyMessage(1);
} else {
bVar.a.b();
if (bVar.g != null) {
bVar.g.interrupt();
}
}
} else {
int size = jVar.j.size();
for (int i = 0; i < size; i++) {
jVar.j.valueAt(i).a(jVar.v[i]);
}
}
}
return j;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final void f() throws IOException {
j[] jVarArr = this.n;
if (jVarArr != null) {
for (j jVar : jVarArr) {
jVar.g.b();
c cVar = jVar.c;
com.fyber.inneractive.sdk.player.exoplayer2.source.g gVar = cVar.j;
if (gVar != null) {
throw gVar;
}
a.C0088a c0088a = cVar.k;
if (c0088a != null) {
e.a aVar = cVar.e.d.get(c0088a);
aVar.b.b();
IOException iOException = aVar.j;
if (iOException != null) {
throw iOException;
}
}
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e.b
public final void b() {
if (this.m != null) {
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = (com.fyber.inneractive.sdk.player.exoplayer2.h) this.j;
hVar.getClass();
hVar.f.obtainMessage(9, this).sendToTarget();
return;
}
for (j jVar : this.n) {
if (!jVar.o) {
jVar.a(jVar.w);
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o
public final long a(com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] eVarArr, boolean[] zArr, q[] qVarArr, boolean[] zArr2, long j) {
long j2;
int[] iArr = new int[eVarArr.length];
int[] iArr2 = new int[eVarArr.length];
for (int i = 0; i < eVarArr.length; i++) {
q qVar = qVarArr[i];
iArr[i] = qVar == null ? -1 : this.f.get(qVar).intValue();
iArr2[i] = -1;
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar = eVarArr[i];
if (eVar != null) {
t c = eVar.c();
int i2 = 0;
while (true) {
j[] jVarArr = this.n;
if (i2 < jVarArr.length) {
u uVar = jVarArr[i2].t;
int i3 = 0;
while (true) {
if (i3 >= uVar.a) {
break;
}
if (uVar.b[i3] == c) {
if (i3 != -1) {
iArr2[i] = i2;
break;
}
} else {
i3++;
}
}
i2++;
}
}
}
}
this.f.clear();
int length = eVarArr.length;
q[] qVarArr2 = new q[length];
q[] qVarArr3 = new q[eVarArr.length];
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] eVarArr2 = new com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[eVarArr.length];
ArrayList arrayList = new ArrayList(this.n.length);
int i4 = 0;
boolean z = false;
while (i4 < this.n.length) {
for (int i5 = 0; i5 < eVarArr.length; i5++) {
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar2 = null;
qVarArr3[i5] = iArr[i5] == i4 ? qVarArr[i5] : null;
if (iArr2[i5] == i4) {
eVar2 = eVarArr[i5];
}
eVarArr2[i5] = eVar2;
}
int i6 = i4;
ArrayList arrayList2 = arrayList;
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] eVarArr3 = eVarArr2;
z |= this.n[i4].a(eVarArr2, zArr, qVarArr3, zArr2, !this.l);
boolean z2 = false;
for (int i7 = 0; i7 < eVarArr.length; i7++) {
if (iArr2[i7] == i6) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(qVarArr3[i7] != null);
qVarArr2[i7] = qVarArr3[i7];
this.f.put(qVarArr3[i7], Integer.valueOf(i6));
z2 = true;
} else if (iArr[i7] == i6) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(qVarArr3[i7] == null);
}
}
if (z2) {
arrayList2.add(this.n[i6]);
}
i4 = i6 + 1;
arrayList = arrayList2;
eVarArr2 = eVarArr3;
}
ArrayList arrayList3 = arrayList;
System.arraycopy(qVarArr2, 0, qVarArr, 0, length);
j[] jVarArr2 = new j[arrayList3.size()];
this.o = jVarArr2;
arrayList3.toArray(jVarArr2);
j[] jVarArr3 = this.o;
if (jVarArr3.length > 0) {
jVarArr3[0].c.h = true;
int i8 = 1;
while (true) {
j[] jVarArr4 = this.o;
if (i8 >= jVarArr4.length) {
break;
}
jVarArr4[i8].c.h = false;
i8++;
}
}
this.p = new com.fyber.inneractive.sdk.player.exoplayer2.source.h(this.o);
if (this.l && z) {
j2 = j;
b(j2);
for (int i9 = 0; i9 < eVarArr.length; i9++) {
if (qVarArr[i9] != null) {
zArr2[i9] = true;
}
}
} else {
j2 = j;
}
this.l = true;
return j2;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o, com.fyber.inneractive.sdk.player.exoplayer2.source.r
public final boolean a(long j) {
return this.p.a(j);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.o, com.fyber.inneractive.sdk.player.exoplayer2.source.r
public final long a() {
return this.p.a();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e.b
public final void a(a.C0088a c0088a) {
int d;
for (j jVar : this.n) {
c cVar = jVar.c;
int a = cVar.f.a(c0088a.b);
if (a != -1 && (d = cVar.p.d(a)) != -1) {
cVar.p.c(d);
}
}
if (this.m != null) {
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = (com.fyber.inneractive.sdk.player.exoplayer2.h) this.j;
hVar.getClass();
hVar.f.obtainMessage(9, this).sendToTarget();
return;
}
for (j jVar2 : this.n) {
if (!jVar2.o) {
jVar2.a(jVar2.w);
}
}
}
}

View File

@@ -0,0 +1,163 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import com.fyber.inneractive.sdk.player.controller.w;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e;
import com.fyber.inneractive.sdk.player.exoplayer2.source.f;
import com.fyber.inneractive.sdk.player.exoplayer2.source.o;
import com.fyber.inneractive.sdk.player.exoplayer2.source.p;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.f;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.b;
import java.io.IOException;
import java.util.Iterator;
/* loaded from: classes2.dex */
public final class h implements p, e.InterfaceC0089e {
public final Uri a;
public final d b;
public final f.a c;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e d;
public p.a e;
public h(Uri uri, f.a aVar, Handler handler, w wVar) {
this(uri, new b(aVar), handler, wVar);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p
public final void a(p.a aVar) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.d == null);
Uri uri = this.a;
d dVar = this.b;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e eVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e(uri, dVar, this.c, 3, this);
this.d = eVar;
this.e = aVar;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.w wVar = new com.fyber.inneractive.sdk.player.exoplayer2.upstream.w(((b) dVar).a.a(), uri, eVar.b);
v vVar = eVar.h;
vVar.getClass();
Looper myLooper = Looper.myLooper();
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(myLooper != null);
v.b<? extends v.c> bVar = vVar.new b<>(myLooper, wVar, eVar, 3, SystemClock.elapsedRealtime());
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(vVar.b == null);
vVar.b = bVar;
bVar.e = null;
vVar.a.execute(bVar);
}
public h(Uri uri, b bVar, Handler handler, w wVar) {
this.a = uri;
this.b = bVar;
this.c = new f.a(handler, wVar);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p
public final void b() {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e eVar = this.d;
if (eVar != null) {
v vVar = eVar.h;
v.b<? extends v.c> bVar = vVar.b;
if (bVar != null) {
bVar.h = true;
bVar.e = null;
if (bVar.hasMessages(0)) {
bVar.removeMessages(0);
} else {
bVar.a.b();
if (bVar.g != null) {
bVar.g.interrupt();
}
}
v.this.b = null;
long elapsedRealtime = SystemClock.elapsedRealtime();
bVar.b.a((v.a<? extends v.c>) bVar.a, elapsedRealtime, elapsedRealtime - bVar.d, true);
}
vVar.a.shutdown();
Iterator<e.a> it = eVar.d.values().iterator();
while (it.hasNext()) {
v vVar2 = it.next().b;
v.b<? extends v.c> bVar2 = vVar2.b;
if (bVar2 != null) {
bVar2.h = true;
bVar2.e = null;
if (bVar2.hasMessages(0)) {
bVar2.removeMessages(0);
} else {
bVar2.a.b();
if (bVar2.g != null) {
bVar2.g.interrupt();
}
}
v.this.b = null;
long elapsedRealtime2 = SystemClock.elapsedRealtime();
bVar2.b.a((v.a<? extends v.c>) bVar2.a, elapsedRealtime2, elapsedRealtime2 - bVar2.d, true);
}
vVar2.a.shutdown();
}
eVar.e.removeCallbacksAndMessages(null);
eVar.d.clear();
this.d = null;
}
this.e = null;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p
public final void a() throws IOException {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e eVar = this.d;
eVar.h.b();
a.C0088a c0088a = eVar.k;
if (c0088a != null) {
e.a aVar = eVar.d.get(c0088a);
aVar.b.b();
IOException iOException = aVar.j;
if (iOException != null) {
throw iOException;
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p
public final o a(int i, com.fyber.inneractive.sdk.player.exoplayer2.upstream.j jVar, long j) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(i == 0);
return new g(this.d, this.b, 3, this.c, jVar, j);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.p
public final void a(o oVar) {
g gVar = (g) oVar;
gVar.a.g.remove(gVar);
gVar.h.removeCallbacksAndMessages(null);
j[] jVarArr = gVar.n;
if (jVarArr != null) {
for (j jVar : jVarArr) {
int size = jVar.j.size();
for (int i = 0; i < size; i++) {
jVar.j.valueAt(i).b();
}
v vVar = jVar.g;
v.b<? extends v.c> bVar = vVar.b;
if (bVar != null) {
bVar.h = true;
bVar.e = null;
if (bVar.hasMessages(0)) {
bVar.removeMessages(0);
} else {
bVar.a.b();
if (bVar.g != null) {
bVar.g.interrupt();
}
}
v.this.b = null;
long elapsedRealtime = SystemClock.elapsedRealtime();
bVar.b.a((v.a<? extends v.c>) bVar.a, elapsedRealtime, elapsedRealtime - bVar.d, true);
}
vVar.a.shutdown();
jVar.m.removeCallbacksAndMessages(null);
jVar.s = true;
}
}
}
}

View File

@@ -0,0 +1,113 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.d;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e;
import com.fyber.inneractive.sdk.player.exoplayer2.source.f;
import com.fyber.inneractive.sdk.player.exoplayer2.source.q;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.IOException;
/* loaded from: classes2.dex */
public final class i implements q {
public final int a;
public final j b;
public i(j jVar, int i) {
this.b = jVar;
this.a = i;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.q
public final void a() throws IOException {
j jVar = this.b;
jVar.g.b();
c cVar = jVar.c;
com.fyber.inneractive.sdk.player.exoplayer2.source.g gVar = cVar.j;
if (gVar != null) {
throw gVar;
}
a.C0088a c0088a = cVar.k;
if (c0088a != null) {
e.a aVar = cVar.e.d.get(c0088a);
aVar.b.b();
IOException iOException = aVar.j;
if (iOException != null) {
throw iOException;
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.q
public final boolean isReady() {
boolean z;
j jVar = this.b;
int i = this.a;
if (jVar.y) {
return true;
}
if (jVar.x == C.TIME_UNSET) {
d.b bVar = jVar.j.valueAt(i).c;
synchronized (bVar) {
z = bVar.i == 0;
}
if (!z) {
return true;
}
}
return false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.q
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.k kVar, com.fyber.inneractive.sdk.player.exoplayer2.decoder.b bVar, boolean z) {
j jVar = this.b;
int i = this.a;
if (jVar.x != C.TIME_UNSET) {
return -3;
}
loop0: while (jVar.k.size() > 1) {
int i2 = jVar.k.getFirst().j;
for (int i3 = 0; i3 < jVar.j.size(); i3++) {
if (jVar.v[i3]) {
d.b bVar2 = jVar.j.valueAt(i3).c;
if ((bVar2.i == 0 ? bVar2.r : bVar2.b[bVar2.k]) == i2) {
break loop0;
}
}
}
jVar.k.removeFirst();
}
f first = jVar.k.getFirst();
com.fyber.inneractive.sdk.player.exoplayer2.j jVar2 = first.c;
if (!jVar2.equals(jVar.q)) {
f.a aVar = jVar.h;
int i4 = jVar.a;
int i5 = first.d;
Object obj = first.e;
long j = first.f;
if (aVar.b != null) {
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.e(aVar, i4, jVar2, i5, obj, j));
}
}
jVar.q = jVar2;
return jVar.j.valueAt(i).a(kVar, bVar, z, jVar.y, jVar.w);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.q
public final void a(long j) {
long max;
j jVar = this.b;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d valueAt = jVar.j.valueAt(this.a);
if (jVar.y) {
d.b bVar = valueAt.c;
synchronized (bVar) {
max = Math.max(bVar.m, bVar.n);
}
if (j > max) {
valueAt.f();
return;
}
}
valueAt.a(true, j);
}
}

View File

@@ -0,0 +1,556 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.os.Handler;
import android.text.TextUtils;
import android.util.SparseArray;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.d;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.c;
import com.fyber.inneractive.sdk.player.exoplayer2.source.f;
import com.fyber.inneractive.sdk.player.exoplayer2.source.q;
import com.fyber.inneractive.sdk.player.exoplayer2.source.r;
import com.fyber.inneractive.sdk.player.exoplayer2.source.t;
import com.fyber.inneractive.sdk.player.exoplayer2.source.u;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.util.LinkedList;
/* loaded from: classes2.dex */
public final class j implements v.a<com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a>, r, com.fyber.inneractive.sdk.player.exoplayer2.extractor.g, d.c {
public final int a;
public final b b;
public final c c;
public final com.fyber.inneractive.sdk.player.exoplayer2.upstream.b d;
public final com.fyber.inneractive.sdk.player.exoplayer2.j e;
public final int f;
public final f.a h;
public boolean n;
public boolean o;
public int p;
public com.fyber.inneractive.sdk.player.exoplayer2.j q;
public int r;
public boolean s;
public u t;
public int u;
public boolean[] v;
public long w;
public long x;
public boolean y;
public final v g = new v("Loader:HlsSampleStreamWrapper");
public final c.b i = new c.b();
public final SparseArray<com.fyber.inneractive.sdk.player.exoplayer2.extractor.d> j = new SparseArray<>();
public final LinkedList<f> k = new LinkedList<>();
public final a l = new a();
public final Handler m = new Handler();
public class a implements Runnable {
public a() {
}
@Override // java.lang.Runnable
public final void run() {
j.this.i();
}
}
public interface b {
}
public j(int i, b bVar, c cVar, com.fyber.inneractive.sdk.player.exoplayer2.upstream.b bVar2, long j, com.fyber.inneractive.sdk.player.exoplayer2.j jVar, int i2, f.a aVar) {
this.a = i;
this.b = bVar;
this.c = cVar;
this.d = bVar2;
this.e = jVar;
this.f = i2;
this.h = aVar;
this.w = j;
this.x = j;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.g
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.l lVar) {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a aVar, long j, long j2, boolean z) {
com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a aVar2 = aVar;
f.a aVar3 = this.h;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar = aVar2.a;
int i = aVar2.b;
int i2 = this.a;
com.fyber.inneractive.sdk.player.exoplayer2.j jVar = aVar2.c;
int i3 = aVar2.d;
Object obj = aVar2.e;
long j3 = aVar2.f;
long j4 = aVar2.g;
long c = aVar2.c();
if (aVar3.b != null) {
aVar3.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.c(aVar3, iVar, i, i2, jVar, i3, obj, j3, j4, j, j2, c));
}
if (z) {
return;
}
int size = this.j.size();
for (int i4 = 0; i4 < size; i4++) {
this.j.valueAt(i4).a(this.v[i4]);
}
g gVar = (g) this.b;
gVar.getClass();
if (gVar.m == null) {
return;
}
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = (com.fyber.inneractive.sdk.player.exoplayer2.h) gVar.j;
hVar.getClass();
hVar.f.obtainMessage(9, gVar).sendToTarget();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.d.c
public final void g() {
this.m.post(this.l);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.g
public final void b() {
this.n = true;
this.m.post(this.l);
}
public final void i() {
if (this.s || this.o || !this.n) {
return;
}
int size = this.j.size();
for (int i = 0; i < size; i++) {
if (this.j.valueAt(i).e() == null) {
return;
}
}
int size2 = this.j.size();
int i2 = 0;
char c = 0;
int i3 = -1;
while (true) {
String str = null;
char c2 = 3;
if (i2 < size2) {
String str2 = this.j.valueAt(i2).e().f;
if (!com.fyber.inneractive.sdk.player.exoplayer2.util.h.d(str2)) {
if (com.fyber.inneractive.sdk.player.exoplayer2.util.h.c(str2)) {
c2 = 2;
} else {
if (str2 != null) {
int indexOf = str2.indexOf(47);
if (indexOf != -1) {
str = str2.substring(0, indexOf);
} else {
throw new IllegalArgumentException("Invalid mime type: ".concat(str2));
}
}
c2 = "text".equals(str) ? (char) 1 : (char) 0;
}
}
if (c2 > c) {
i3 = i2;
c = c2;
} else if (c2 == c && i3 != -1) {
i3 = -1;
}
i2++;
} else {
t tVar = this.c.f;
int i4 = tVar.a;
this.u = -1;
this.v = new boolean[size2];
t[] tVarArr = new t[size2];
for (int i5 = 0; i5 < size2; i5++) {
com.fyber.inneractive.sdk.player.exoplayer2.j e = this.j.valueAt(i5).e();
if (i5 == i3) {
com.fyber.inneractive.sdk.player.exoplayer2.j[] jVarArr = new com.fyber.inneractive.sdk.player.exoplayer2.j[i4];
for (int i6 = 0; i6 < i4; i6++) {
jVarArr[i6] = a(tVar.b[i6], e);
}
tVarArr[i5] = new t(jVarArr);
this.u = i5;
} else {
tVarArr[i5] = new t(a((c == 3 && com.fyber.inneractive.sdk.player.exoplayer2.util.h.c(e.f)) ? this.e : null, e));
}
}
this.t = new u(tVarArr);
this.o = true;
g gVar = (g) this.b;
int i7 = gVar.k - 1;
gVar.k = i7;
if (i7 > 0) {
return;
}
int i8 = 0;
for (j jVar : gVar.n) {
i8 += jVar.t.a;
}
t[] tVarArr2 = new t[i8];
int i9 = 0;
for (j jVar2 : gVar.n) {
int i10 = jVar2.t.a;
int i11 = 0;
while (i11 < i10) {
tVarArr2[i9] = jVar2.t.b[i11];
i11++;
i9++;
}
}
gVar.m = new u(tVarArr2);
((com.fyber.inneractive.sdk.player.exoplayer2.h) gVar.j).f.obtainMessage(8, gVar).sendToTarget();
return;
}
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a aVar, long j, long j2) {
com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a aVar2 = aVar;
c cVar = this.c;
cVar.getClass();
if (aVar2 instanceof c.a) {
c.a aVar3 = (c.a) aVar2;
cVar.i = aVar3.i;
cVar.a(aVar3.a.a, aVar3.l, aVar3.m);
}
f.a aVar4 = this.h;
com.fyber.inneractive.sdk.player.exoplayer2.upstream.i iVar = aVar2.a;
int i = aVar2.b;
int i2 = this.a;
com.fyber.inneractive.sdk.player.exoplayer2.j jVar = aVar2.c;
int i3 = aVar2.d;
Object obj = aVar2.e;
long j3 = aVar2.f;
long j4 = aVar2.g;
long c = aVar2.c();
if (aVar4.b != null) {
aVar4.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.b(aVar4, iVar, i, i2, jVar, i3, obj, j3, j4, j, j2, c));
}
if (!this.o) {
a(this.w);
return;
}
g gVar = (g) this.b;
gVar.getClass();
if (gVar.m == null) {
return;
}
com.fyber.inneractive.sdk.player.exoplayer2.h hVar = (com.fyber.inneractive.sdk.player.exoplayer2.h) gVar.j;
hVar.getClass();
hVar.f.obtainMessage(9, gVar).sendToTarget();
}
/* JADX WARN: Removed duplicated region for block: B:20:0x0072 */
/* JADX WARN: Removed duplicated region for block: B:22:0x008a */
/* JADX WARN: Removed duplicated region for block: B:30:0x00b4 A[ORIG_RETURN, RETURN] */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a r28, long r29, long r31, java.io.IOException r33) {
/*
r27 = this;
r0 = r27
r1 = r28
com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a r1 = (com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.a) r1
long r2 = r1.c()
boolean r4 = r1 instanceof com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f
r5 = 1
if (r4 == 0) goto L18
r7 = 0
int r2 = (r2 > r7 ? 1 : (r2 == r7 ? 0 : -1))
if (r2 != 0) goto L16
goto L18
L16:
r2 = 0
goto L19
L18:
r2 = r5
L19:
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.c r3 = r0.c
if (r2 == 0) goto L52
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e r2 = r3.p
com.fyber.inneractive.sdk.player.exoplayer2.source.t r3 = r3.f
com.fyber.inneractive.sdk.player.exoplayer2.j r7 = r1.c
int r3 = r3.a(r7)
int r3 = r2.d(r3)
r15 = r33
boolean r2 = com.fyber.inneractive.sdk.player.exoplayer2.source.chunk.b.a(r2, r3, r15)
if (r2 == 0) goto L57
if (r4 == 0) goto L58
java.util.LinkedList<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f> r2 = r0.k
java.lang.Object r2 = r2.removeLast()
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f r2 = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f) r2
if (r2 != r1) goto L41
r2 = r5
goto L42
L41:
r2 = 0
L42:
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(r2)
java.util.LinkedList<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.f> r2 = r0.k
boolean r2 = r2.isEmpty()
if (r2 == 0) goto L58
long r2 = r0.w
r0.x = r2
goto L58
L52:
r15 = r33
r3.getClass()
L57:
r5 = 0
L58:
com.fyber.inneractive.sdk.player.exoplayer2.source.f$a r8 = r0.h
com.fyber.inneractive.sdk.player.exoplayer2.upstream.i r9 = r1.a
int r10 = r1.b
int r11 = r0.a
com.fyber.inneractive.sdk.player.exoplayer2.j r12 = r1.c
int r13 = r1.d
java.lang.Object r14 = r1.e
long r2 = r1.f
long r6 = r1.g
long r23 = r1.c()
com.fyber.inneractive.sdk.player.exoplayer2.source.f r1 = r8.b
if (r1 == 0) goto L88
android.os.Handler r1 = r8.a
com.fyber.inneractive.sdk.player.exoplayer2.source.d r4 = new com.fyber.inneractive.sdk.player.exoplayer2.source.d
r17 = r6
r7 = r4
r15 = r2
r19 = r29
r21 = r31
r25 = r33
r26 = r5
r7.<init>(r8, r9, r10, r11, r12, r13, r14, r15, r17, r19, r21, r23, r25, r26)
r1.post(r4)
L88:
if (r5 == 0) goto Lb4
boolean r1 = r0.o
if (r1 != 0) goto L94
long r1 = r0.w
r0.a(r1)
goto Lb2
L94:
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.j$b r1 = r0.b
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.g r1 = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.g) r1
r1.getClass()
com.fyber.inneractive.sdk.player.exoplayer2.source.u r2 = r1.m
if (r2 != 0) goto La0
goto Lb2
La0:
com.fyber.inneractive.sdk.player.exoplayer2.source.o$a r2 = r1.j
com.fyber.inneractive.sdk.player.exoplayer2.h r2 = (com.fyber.inneractive.sdk.player.exoplayer2.h) r2
r2.getClass()
android.os.Handler r2 = r2.f
r3 = 9
android.os.Message r1 = r2.obtainMessage(r3, r1)
r1.sendToTarget()
Lb2:
r6 = 2
goto Lb5
Lb4:
r6 = 0
Lb5:
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.j.a(com.fyber.inneractive.sdk.player.exoplayer2.upstream.v$c, long, long, java.io.IOException):int");
}
public final boolean a(com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e[] eVarArr, boolean[] zArr, q[] qVarArr, boolean[] zArr2, boolean z) {
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.o);
for (int i = 0; i < eVarArr.length; i++) {
q qVar = qVarArr[i];
if (qVar != null && (eVarArr[i] == null || !zArr[i])) {
int i2 = ((i) qVar).a;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.v[i2]);
this.v[i2] = false;
this.p--;
this.j.valueAt(i2).b();
qVarArr[i] = null;
}
}
boolean z2 = false;
com.fyber.inneractive.sdk.player.exoplayer2.trackselection.e eVar2 = null;
for (int i3 = 0; i3 < eVarArr.length; i3++) {
if (qVarArr[i3] == null && (eVar = eVarArr[i3]) != null) {
u uVar = this.t;
t c = eVar.c();
int i4 = 0;
while (true) {
if (i4 >= uVar.a) {
i4 = -1;
break;
}
if (uVar.b[i4] == c) {
break;
}
i4++;
}
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(!this.v[i4]);
this.v[i4] = true;
this.p++;
if (i4 == this.u) {
this.c.p = eVar;
eVar2 = eVar;
}
qVarArr[i3] = new i(this, i4);
zArr2[i3] = true;
z2 = true;
}
}
if (z) {
int size = this.j.size();
for (int i5 = 0; i5 < size; i5++) {
if (!this.v[i5]) {
this.j.valueAt(i5).b();
}
}
if (eVar2 != null && !this.k.isEmpty()) {
eVar2.a();
if (eVar2.b() != this.c.f.a(this.k.getLast().c)) {
long j = this.w;
this.w = j;
this.x = j;
this.y = false;
this.k.clear();
if (this.g.a()) {
v.b<? extends v.c> bVar = this.g.b;
bVar.h = false;
bVar.e = null;
if (bVar.hasMessages(0)) {
bVar.removeMessages(0);
bVar.sendEmptyMessage(1);
} else {
bVar.a.b();
if (bVar.g != null) {
bVar.g.interrupt();
}
}
} else {
int size2 = this.j.size();
for (int i6 = 0; i6 < size2; i6++) {
this.j.valueAt(i6).a(this.v[i6]);
}
}
}
}
}
if (this.p == 0) {
this.c.j = null;
this.q = null;
this.k.clear();
if (this.g.a()) {
v.b<? extends v.c> bVar2 = this.g.b;
bVar2.h = false;
bVar2.e = null;
if (bVar2.hasMessages(0)) {
bVar2.removeMessages(0);
bVar2.sendEmptyMessage(1);
} else {
bVar2.a.b();
if (bVar2.g != null) {
bVar2.g.interrupt();
}
}
}
}
return z2;
}
/* JADX WARN: Removed duplicated region for block: B:23:0x0241 */
/* JADX WARN: Removed duplicated region for block: B:26:0x0244 */
/* JADX WARN: Removed duplicated region for block: B:64:0x00f5 */
/* JADX WARN: Removed duplicated region for block: B:65:0x00fe */
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.r
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final boolean a(long r43) {
/*
Method dump skipped, instructions count: 789
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.j.a(long):boolean");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.g
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.d a(int i, int i2) {
if (this.j.indexOfKey(i) >= 0) {
return this.j.get(i);
}
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d dVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.d(this.d);
dVar.n = this;
dVar.c.r = this.r;
this.j.put(i, dVar);
return dVar;
}
public static com.fyber.inneractive.sdk.player.exoplayer2.j a(com.fyber.inneractive.sdk.player.exoplayer2.j jVar, com.fyber.inneractive.sdk.player.exoplayer2.j jVar2) {
if (jVar == null) {
return jVar2;
}
int b2 = com.fyber.inneractive.sdk.player.exoplayer2.util.h.b(jVar2.f);
int i = 0;
String str = null;
if (b2 == 1) {
String str2 = jVar.c;
if (!TextUtils.isEmpty(str2)) {
String[] split = str2.split("(\\s*,\\s*)|(\\s*$)");
StringBuilder sb = new StringBuilder();
int length = split.length;
while (i < length) {
String str3 = split[i];
if (1 == com.fyber.inneractive.sdk.player.exoplayer2.util.h.b(com.fyber.inneractive.sdk.player.exoplayer2.util.h.a(str3))) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append(str3);
}
i++;
}
if (sb.length() > 0) {
str = sb.toString();
}
}
} else if (b2 == 2) {
String str4 = jVar.c;
if (!TextUtils.isEmpty(str4)) {
String[] split2 = str4.split("(\\s*,\\s*)|(\\s*$)");
StringBuilder sb2 = new StringBuilder();
int length2 = split2.length;
while (i < length2) {
String str5 = split2[i];
if (2 == com.fyber.inneractive.sdk.player.exoplayer2.util.h.b(com.fyber.inneractive.sdk.player.exoplayer2.util.h.a(str5))) {
if (sb2.length() > 0) {
sb2.append(",");
}
sb2.append(str5);
}
i++;
}
if (sb2.length() > 0) {
str = sb2.toString();
}
}
}
String str6 = str;
return new com.fyber.inneractive.sdk.player.exoplayer2.j(jVar.a, jVar2.e, jVar2.f, str6, jVar.b, jVar2.g, jVar.j, jVar.k, jVar2.l, jVar2.m, jVar2.n, jVar2.p, jVar2.o, jVar2.q, jVar2.r, jVar2.s, jVar2.t, jVar2.u, jVar2.v, jVar.x, jVar.y, jVar2.z, jVar2.w, jVar2.h, jVar2.i, jVar2.d);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.source.r
public final long a() {
long j = this.x;
if (j != C.TIME_UNSET) {
return j;
}
if (this.y) {
return Long.MIN_VALUE;
}
return this.k.getLast().g;
}
}

View File

@@ -0,0 +1,9 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.util.SparseArray;
import com.fyber.inneractive.sdk.player.exoplayer2.util.p;
/* loaded from: classes2.dex */
public final class k {
public final SparseArray<p> a = new SparseArray<>();
}

View File

@@ -0,0 +1,150 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls;
import android.text.TextUtils;
import com.facebook.internal.security.CertificateUtil;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.l;
import com.fyber.inneractive.sdk.player.exoplayer2.m;
import com.fyber.inneractive.sdk.player.exoplayer2.util.p;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public final class l implements com.fyber.inneractive.sdk.player.exoplayer2.extractor.f {
public static final Pattern g = Pattern.compile("LOCAL:([^,]+)");
public static final Pattern h = Pattern.compile("MPEGTS:(\\d+)");
public final String a;
public final p b;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.g d;
public int f;
public final com.fyber.inneractive.sdk.player.exoplayer2.util.k c = new com.fyber.inneractive.sdk.player.exoplayer2.util.k();
public byte[] e = new byte[1024];
public l(String str, p pVar) {
this.a = str;
this.b = pVar;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a() {
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final boolean a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar) throws IOException, InterruptedException {
throw new IllegalStateException();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.g gVar) {
this.d = gVar;
gVar.a(new l.a(C.TIME_UNSET));
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final void a(long j, long j2) {
throw new IllegalStateException();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.extractor.f
public final int a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.b bVar, com.fyber.inneractive.sdk.player.exoplayer2.extractor.k kVar) throws IOException, InterruptedException {
int min;
int i = (int) bVar.b;
int i2 = this.f;
byte[] bArr = this.e;
if (i2 == bArr.length) {
this.e = Arrays.copyOf(bArr, ((i != -1 ? i : bArr.length) * 3) / 2);
}
byte[] bArr2 = this.e;
int i3 = this.f;
int length = bArr2.length - i3;
int i4 = bVar.f;
if (i4 == 0) {
min = 0;
} else {
min = Math.min(i4, length);
System.arraycopy(bVar.d, 0, bArr2, i3, min);
int i5 = bVar.f - min;
bVar.f = i5;
bVar.e = 0;
byte[] bArr3 = bVar.d;
byte[] bArr4 = i5 < bArr3.length - 524288 ? new byte[65536 + i5] : bArr3;
System.arraycopy(bArr3, min, bArr4, 0, i5);
bVar.d = bArr4;
}
if (min == 0) {
min = bVar.a(bArr2, i3, length, 0, true);
}
if (min != -1) {
bVar.c += min;
}
if (min != -1) {
int i6 = this.f + min;
this.f = i6;
if (i == -1 || i6 != i) {
return 0;
}
}
com.fyber.inneractive.sdk.player.exoplayer2.util.k kVar2 = new com.fyber.inneractive.sdk.player.exoplayer2.util.k(this.e);
try {
Pattern pattern = com.fyber.inneractive.sdk.player.exoplayer2.text.webvtt.b.a;
String d = kVar2.d();
if (d == null || !com.fyber.inneractive.sdk.player.exoplayer2.text.webvtt.b.b.matcher(d).matches()) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.text.a("Expected WEBVTT. Got " + d);
}
long j = 0;
long j2 = 0;
while (true) {
String d2 = kVar2.d();
if (!TextUtils.isEmpty(d2)) {
if (d2.startsWith("X-TIMESTAMP-MAP")) {
Matcher matcher = g.matcher(d2);
if (matcher.find()) {
Matcher matcher2 = h.matcher(d2);
if (matcher2.find()) {
String[] split = matcher.group(1).split("\\.", 2);
long j3 = 0;
for (String str : split[0].split(CertificateUtil.DELIMITER)) {
j3 = Long.parseLong(str) + (j3 * 60);
}
long parseLong = Long.parseLong(split[1]);
j2 = (Long.parseLong(matcher2.group(1)) * 1000000) / 90000;
j = (parseLong + (j3 * 1000)) * 1000;
} else {
throw new m("X-TIMESTAMP-MAP doesn't contain media timestamp: ".concat(d2));
}
} else {
throw new m("X-TIMESTAMP-MAP doesn't contain local timestamp: ".concat(d2));
}
}
} else {
Matcher a = com.fyber.inneractive.sdk.player.exoplayer2.text.webvtt.b.a(kVar2);
if (a == null) {
this.d.a(0, 3).a(com.fyber.inneractive.sdk.player.exoplayer2.j.a(null, MimeTypes.TEXT_VTT, 0, this.a, -1, null, 0L, Collections.emptyList()));
this.d.b();
return -1;
}
String[] split2 = a.group(1).split("\\.", 2);
long j4 = 0;
for (String str2 : split2[0].split(CertificateUtil.DELIMITER)) {
j4 = Long.parseLong(str2) + (j4 * 60);
}
long parseLong2 = (Long.parseLong(split2[1]) + (j4 * 1000)) * 1000;
long a2 = this.b.a((j2 + parseLong2) - j);
com.fyber.inneractive.sdk.player.exoplayer2.extractor.d a3 = this.d.a(0, 3);
a3.a(com.fyber.inneractive.sdk.player.exoplayer2.j.a(null, MimeTypes.TEXT_VTT, 0, this.a, -1, null, a2 - parseLong2, Collections.emptyList()));
this.d.b();
this.c.a(this.e, this.f);
a3.a(this.f, this.c);
a3.a(a2, 1, this.f, 0, (byte[]) null);
return -1;
}
}
} catch (com.fyber.inneractive.sdk.player.exoplayer2.text.a e) {
throw new m(e);
}
}
}

View File

@@ -0,0 +1,34 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import java.util.Collections;
import java.util.List;
/* loaded from: classes2.dex */
public final class a extends c {
public final List<C0088a> b;
public final List<C0088a> c;
public final List<C0088a> d;
public final j e;
public final List<j> f;
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a$a, reason: collision with other inner class name */
public static final class C0088a {
public final String a;
public final j b;
public C0088a(j jVar, String str) {
this.a = str;
this.b = jVar;
}
}
public a(String str, List<C0088a> list, List<C0088a> list2, List<C0088a> list3, j jVar, List<j> list4) {
super(str);
this.b = Collections.unmodifiableList(list);
this.c = Collections.unmodifiableList(list2);
this.d = Collections.unmodifiableList(list3);
this.e = jVar;
this.f = list4 != null ? Collections.unmodifiableList(list4) : null;
}
}

View File

@@ -0,0 +1,79 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.util.Collections;
import java.util.List;
/* loaded from: classes2.dex */
public final class b extends c {
public final int b;
public final long c;
public final long d;
public final boolean e;
public final int f;
public final int g;
public final int h;
public final long i;
public final boolean j;
public final boolean k;
public final a l;
public final List<a> m;
public final List<String> n;
public final long o;
public static final class a implements Comparable<Long> {
public final String a;
public final long b;
public final int c;
public final long d;
public final boolean e;
public final String f;
public final String g;
public final long h;
public final long i;
public a(String str, long j, int i, long j2, boolean z, String str2, String str3, long j3, long j4) {
this.a = str;
this.b = j;
this.c = i;
this.d = j2;
this.e = z;
this.f = str2;
this.g = str3;
this.h = j3;
this.i = j4;
}
@Override // java.lang.Comparable
public final int compareTo(Long l) {
Long l2 = l;
if (this.d > l2.longValue()) {
return 1;
}
return this.d < l2.longValue() ? -1 : 0;
}
}
public b(int i, String str, long j, long j2, boolean z, int i2, int i3, int i4, long j3, boolean z2, boolean z3, a aVar, List<a> list, List<String> list2) {
super(str);
this.b = i;
this.d = j2;
this.e = z;
this.f = i2;
this.g = i3;
this.h = i4;
this.i = j3;
this.j = z2;
this.k = z3;
this.l = aVar;
this.m = Collections.unmodifiableList(list);
if (list.isEmpty()) {
this.o = 0L;
} else {
a aVar2 = list.get(list.size() - 1);
this.o = aVar2.d + aVar2.b;
}
this.c = j == C.TIME_UNSET ? -9223372036854775807L : j >= 0 ? j : this.o + j;
this.n = Collections.unmodifiableList(list2);
}
}

View File

@@ -0,0 +1,10 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist;
/* loaded from: classes2.dex */
public abstract class c {
public final String a;
public c(String str) {
this.a = str;
}
}

View File

@@ -0,0 +1,375 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist;
import android.text.TextUtils;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b;
import com.fyber.inneractive.sdk.player.exoplayer2.m;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.w;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.mbridge.msdk.newreward.function.common.MBridgeCommon;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.io.BufferedReader;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.Queue;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public final class d implements w.a<c> {
public static final Pattern a = Pattern.compile("AVERAGE-BANDWIDTH=(\\d+)\\b");
public static final Pattern b = Pattern.compile("[^-]BANDWIDTH=(\\d+)\\b");
public static final Pattern c = Pattern.compile("CODECS=\"(.+?)\"");
public static final Pattern d = Pattern.compile("RESOLUTION=(\\d+x\\d+)");
public static final Pattern e = Pattern.compile("#EXT-X-TARGETDURATION:(\\d+)\\b");
public static final Pattern f = Pattern.compile("#EXT-X-VERSION:(\\d+)\\b");
public static final Pattern g = Pattern.compile("#EXT-X-PLAYLIST-TYPE:(.+)\\b");
public static final Pattern h = Pattern.compile("#EXT-X-MEDIA-SEQUENCE:(\\d+)\\b");
public static final Pattern i = Pattern.compile("#EXTINF:([\\d\\.]+)\\b");
public static final Pattern j = Pattern.compile("TIME-OFFSET=(-?[\\d\\.]+)\\b");
public static final Pattern k = Pattern.compile("#EXT-X-BYTERANGE:(\\d+(?:@\\d+)?)\\b");
public static final Pattern l = Pattern.compile("BYTERANGE=\"(\\d+(?:@\\d+)?)\\b\"");
public static final Pattern m = Pattern.compile("METHOD=(NONE|AES-128)");
public static final Pattern n = Pattern.compile("URI=\"(.+?)\"");
public static final Pattern o = Pattern.compile("IV=([^,.*]+)");
public static final Pattern p = Pattern.compile("TYPE=(AUDIO|VIDEO|SUBTITLES|CLOSED-CAPTIONS)");
public static final Pattern q = Pattern.compile("LANGUAGE=\"(.+?)\"");
public static final Pattern r = Pattern.compile("NAME=\"(.+?)\"");
public static final Pattern s = Pattern.compile("INSTREAM-ID=\"((?:CC|SERVICE)\\d+)\"");
public static final Pattern t = Pattern.compile("AUTOSELECT".concat("=(NO|YES)"));
public static final Pattern u = Pattern.compile("DEFAULT".concat("=(NO|YES)"));
public static final Pattern v = Pattern.compile("FORCED".concat("=(NO|YES)"));
/* JADX WARN: Multi-variable type inference failed */
public static b b(a aVar, String str) throws IOException {
String str2;
int i2;
ArrayList arrayList = new ArrayList();
ArrayList arrayList2 = new ArrayList();
int i3 = 0;
int i4 = 1;
String str3 = null;
long j2 = 0;
int i5 = 0;
int i6 = 0;
int i7 = 0;
int i8 = 0;
boolean z = false;
int i9 = 0;
int i10 = 0;
boolean z2 = false;
int i11 = 1;
b.a aVar2 = null;
String str4 = null;
String str5 = null;
long j3 = 0;
long j4 = 0;
long j5 = 0;
long j6 = 0;
long j7 = C.TIME_UNSET;
long j8 = C.TIME_UNSET;
while (true) {
long j9 = -1;
while (aVar.a()) {
if (aVar.a()) {
str2 = aVar.c;
aVar.c = str3;
} else {
str2 = str3;
}
if (str2.startsWith("#EXT-X-PLAYLIST-TYPE")) {
String c2 = c(str2, g);
if ("VOD".equals(c2)) {
i5 = i4;
} else if ("EVENT".equals(c2)) {
i5 = 2;
}
str3 = null;
} else {
if (str2.startsWith("#EXT-X-START")) {
j7 = (long) (Double.parseDouble(c(str2, j)) * 1000000.0d);
} else if (str2.startsWith("#EXT-X-MAP")) {
String c3 = c(str2, n);
String b2 = b(str2, l);
if (b2 != null) {
String[] split = b2.split("@");
j9 = Long.parseLong(split[i3]);
if (split.length > i4) {
j4 = Long.parseLong(split[i4]);
}
}
aVar2 = new b.a(c3, 0L, -1, C.TIME_UNSET, false, null, null, j4, j9);
j4 = j2;
str3 = null;
} else if (str2.startsWith("#EXT-X-TARGETDURATION")) {
j8 = Integer.parseInt(c(str2, e)) * 1000000;
} else if (str2.startsWith("#EXT-X-MEDIA-SEQUENCE")) {
i9 = Integer.parseInt(c(str2, h));
i8 = i9;
} else if (str2.startsWith("#EXT-X-VERSION")) {
i11 = Integer.parseInt(c(str2, f));
} else if (str2.startsWith("#EXTINF")) {
j6 = (long) (Double.parseDouble(c(str2, i)) * 1000000.0d);
} else if (str2.startsWith("#EXT-X-KEY")) {
z2 = "AES-128".equals(c(str2, m));
if (z2) {
str5 = c(str2, n);
str4 = b(str2, o);
} else {
str3 = null;
str4 = null;
str5 = null;
}
} else if (str2.startsWith("#EXT-X-BYTERANGE")) {
String[] split2 = c(str2, k).split("@");
j9 = Long.parseLong(split2[i3]);
if (split2.length > i4) {
j4 = Long.parseLong(split2[i4]);
}
} else if (str2.startsWith("#EXT-X-DISCONTINUITY-SEQUENCE")) {
i7 = Integer.parseInt(str2.substring(str2.indexOf(58) + i4));
i6 = i4;
} else if (str2.equals("#EXT-X-DISCONTINUITY")) {
i10++;
} else if (str2.startsWith("#EXT-X-PROGRAM-DATE-TIME")) {
if (j3 == j2) {
String substring = str2.substring(str2.indexOf(58) + i4);
Matcher matcher = s.f.matcher(substring);
if (!matcher.matches()) {
throw new m("Invalid date/time format: " + substring);
}
if (matcher.group(9) == null || matcher.group(9).equalsIgnoreCase("Z")) {
i2 = i3;
} else {
i2 = Integer.parseInt(matcher.group(13)) + (Integer.parseInt(matcher.group(12)) * 60);
if (matcher.group(11).equals("-")) {
i2 *= -1;
}
}
GregorianCalendar gregorianCalendar = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
gregorianCalendar.clear();
gregorianCalendar.set(Integer.parseInt(matcher.group(i4)), Integer.parseInt(matcher.group(2)) - 1, Integer.parseInt(matcher.group(3)), Integer.parseInt(matcher.group(4)), Integer.parseInt(matcher.group(5)), Integer.parseInt(matcher.group(6)));
if (!TextUtils.isEmpty(matcher.group(8))) {
gregorianCalendar.set(14, new BigDecimal("0." + matcher.group(8)).movePointRight(3).intValue());
}
long timeInMillis = gregorianCalendar.getTimeInMillis();
if (i2 != 0) {
timeInMillis -= i2 * MBridgeCommon.DEFAULT_LOAD_TIMEOUT;
}
int i12 = com.fyber.inneractive.sdk.player.exoplayer2.b.a;
j3 = (timeInMillis == C.TIME_UNSET ? -9223372036854775807L : timeInMillis * 1000) - j5;
}
} else if (str2.startsWith("#EXT-X-DATERANGE")) {
arrayList2.add(str2);
} else if (!str2.startsWith("#")) {
String hexString = !z2 ? null : str4 != null ? str4 : Integer.toHexString(i9);
int i13 = i9 + 1;
if (j9 == -1) {
j4 = 0;
}
arrayList.add(new b.a(str2, j6, i10, j5, z2, str5, hexString, j4, j9));
j5 += j6;
if (j9 != -1) {
j4 += j9;
}
i9 = i13;
j9 = -1;
i3 = 0;
i4 = 1;
str3 = null;
j2 = 0;
j6 = 0;
} else if (str2.equals("#EXT-X-ENDLIST")) {
i3 = 0;
i4 = 1;
str3 = null;
j2 = 0;
z = true;
}
str3 = null;
}
i3 = 0;
i4 = 1;
str3 = null;
j2 = 0;
}
return new b(i5, str, j7, j3, i6, i7, i8, i11, j8, z, j3 != 0, aVar2, arrayList, arrayList2);
}
}
public static String c(String str, Pattern pattern) throws m {
Matcher matcher = pattern.matcher(str);
if (matcher.find() && matcher.groupCount() == 1) {
return matcher.group(1);
}
throw new m("Couldn't match " + pattern.pattern() + " in " + str);
}
/* JADX WARN: Code restructure failed: missing block: B:12:0x0074, code lost:
r1 = r0.readLine();
*/
/* JADX WARN: Code restructure failed: missing block: B:13:0x0078, code lost:
if (r1 == null) goto L76;
*/
/* JADX WARN: Code restructure failed: missing block: B:14:0x007a, code lost:
r1 = r1.trim();
*/
/* JADX WARN: Code restructure failed: missing block: B:15:0x0082, code lost:
if (r1.isEmpty() == false) goto L75;
*/
/* JADX WARN: Code restructure failed: missing block: B:18:0x008b, code lost:
if (r1.startsWith("#EXT-X-STREAM-INF") == false) goto L47;
*/
/* JADX WARN: Code restructure failed: missing block: B:20:0x00a4, code lost:
if (r1.startsWith("#EXT-X-TARGETDURATION") != false) goto L79;
*/
/* JADX WARN: Code restructure failed: missing block: B:22:0x00ac, code lost:
if (r1.startsWith("#EXT-X-MEDIA-SEQUENCE") != false) goto L82;
*/
/* JADX WARN: Code restructure failed: missing block: B:24:0x00b4, code lost:
if (r1.startsWith("#EXTINF") != false) goto L84;
*/
/* JADX WARN: Code restructure failed: missing block: B:26:0x00bc, code lost:
if (r1.startsWith("#EXT-X-KEY") != false) goto L86;
*/
/* JADX WARN: Code restructure failed: missing block: B:28:0x00c4, code lost:
if (r1.startsWith("#EXT-X-BYTERANGE") != false) goto L78;
*/
/* JADX WARN: Code restructure failed: missing block: B:30:0x00cc, code lost:
if (r1.equals("#EXT-X-DISCONTINUITY") != false) goto L81;
*/
/* JADX WARN: Code restructure failed: missing block: B:32:0x00d4, code lost:
if (r1.equals("#EXT-X-DISCONTINUITY-SEQUENCE") != false) goto L83;
*/
/* JADX WARN: Code restructure failed: missing block: B:34:0x00dc, code lost:
if (r1.equals("#EXT-X-ENDLIST") == false) goto L64;
*/
/* JADX WARN: Code restructure failed: missing block: B:35:0x00df, code lost:
r9.add(r1);
*/
/* JADX WARN: Code restructure failed: missing block: B:40:0x00e3, code lost:
r9.add(r1);
r8 = b(new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d.a(r9, r0), r8.toString());
*/
/* JADX WARN: Code restructure failed: missing block: B:41:0x00f3, code lost:
com.fyber.inneractive.sdk.player.exoplayer2.util.s.a(r0);
*/
/* JADX WARN: Code restructure failed: missing block: B:42:0x00f6, code lost:
return r8;
*/
/* JADX WARN: Code restructure failed: missing block: B:52:0x008d, code lost:
r9.add(r1);
r8 = a(new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d.a(r9, r0), r8.toString());
*/
/* JADX WARN: Code restructure failed: missing block: B:57:0x00f7, code lost:
com.fyber.inneractive.sdk.player.exoplayer2.util.s.a(r0);
*/
/* JADX WARN: Code restructure failed: missing block: B:58:0x0101, code lost:
throw new com.fyber.inneractive.sdk.player.exoplayer2.m("Failed to parse the playlist, could not identify any tags.");
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c a(android.net.Uri r8, com.fyber.inneractive.sdk.player.exoplayer2.upstream.h r9) throws java.io.IOException {
/*
Method dump skipped, instructions count: 270
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d.a(android.net.Uri, com.fyber.inneractive.sdk.player.exoplayer2.upstream.h):com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c");
}
public static class a {
public final BufferedReader a;
public final Queue<String> b;
public String c;
public a(LinkedList linkedList, BufferedReader bufferedReader) {
this.b = linkedList;
this.a = bufferedReader;
}
public final boolean a() throws IOException {
String trim;
if (this.c != null) {
return true;
}
if (!this.b.isEmpty()) {
this.c = this.b.poll();
return true;
}
do {
String readLine = this.a.readLine();
this.c = readLine;
if (readLine == null) {
return false;
}
trim = readLine.trim();
this.c = trim;
} while (trim.isEmpty());
return true;
}
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARN: Code restructure failed: missing block: B:73:0x008b, code lost:
if (r14.equals("CLOSED-CAPTIONS") == false) goto L21;
*/
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:24:0x01ea */
/* JADX WARN: Removed duplicated region for block: B:27:0x01f6 A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:31:0x001b A[SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:32:0x01ef */
/* JADX WARN: Type inference failed for: r0v2, types: [java.util.List] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d.a r45, java.lang.String r46) throws java.io.IOException {
/*
Method dump skipped, instructions count: 614
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d.a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d$a, java.lang.String):com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a");
}
public static String b(String str, Pattern pattern) {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
return matcher.group(1);
}
return null;
}
public static boolean a(String str, Pattern pattern) {
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
return matcher.group(1).equals("YES");
}
return false;
}
}

View File

@@ -0,0 +1,342 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import androidx.work.WorkRequest;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.h;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a;
import com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import com.fyber.inneractive.sdk.player.exoplayer2.m;
import com.fyber.inneractive.sdk.player.exoplayer2.source.f;
import com.fyber.inneractive.sdk.player.exoplayer2.source.p;
import com.fyber.inneractive.sdk.player.exoplayer2.source.s;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.i;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.t;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.b;
import com.fyber.inneractive.sdk.player.exoplayer2.upstream.w;
import com.fyber.inneractive.sdk.player.exoplayer2.util.r;
import com.mbridge.msdk.interstitial.view.MBInterstitialActivity;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import com.mbridge.msdk.playercommon.exoplayer2.source.chunk.ChunkedTrackBlacklistUtil;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
/* loaded from: classes2.dex */
public final class e implements v.a<w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c>> {
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.d a;
public final int c;
public final InterfaceC0089e f;
public final f.a i;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a j;
public a.C0088a k;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b l;
public boolean m;
public final ArrayList g = new ArrayList();
public final v h = new v("HlsPlaylistTracker:MasterPlaylist");
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d b = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.d();
public final IdentityHashMap<a.C0088a, a> d = new IdentityHashMap<>();
public final Handler e = new Handler();
public final class a implements v.a<w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c>>, Runnable {
public final a.C0088a a;
public final v b = new v("HlsPlaylistTracker:MediaPlaylist");
public final w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> c;
public com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b d;
public long e;
public long f;
public long g;
public long h;
public boolean i;
public IOException j;
public a(a.C0088a c0088a, long j) {
this.a = c0088a;
this.g = j;
this.c = new w<>(((com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.b) e.this.a).a(), r.a(e.this.j.a, c0088a.a), e.this.b);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2, boolean z) {
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
f.a aVar = e.this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar.b != null) {
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.c(aVar, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3));
}
}
@Override // java.lang.Runnable
public final void run() {
this.i = false;
a();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2) {
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c cVar = wVar2.d;
if (cVar instanceof com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b) {
a((com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b) cVar);
f.a aVar = e.this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar.b != null) {
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.b(aVar, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3));
return;
}
return;
}
this.j = new m("Loaded playlist has unexpected type.");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final int a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2, IOException iOException) {
boolean z;
int i;
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
boolean z2 = iOException instanceof m;
f.a aVar = e.this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar.b != null) {
z = z2;
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.d(aVar, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3, iOException, z));
} else {
z = z2;
}
if (z) {
return 3;
}
if ((iOException instanceof t) && ((i = ((t) iOException).a) == 404 || i == 410)) {
this.h = SystemClock.elapsedRealtime() + ChunkedTrackBlacklistUtil.DEFAULT_TRACK_BLACKLIST_MS;
e eVar = e.this;
a.C0088a c0088a = this.a;
int size = eVar.g.size();
for (int i2 = 0; i2 < size; i2++) {
((b) eVar.g.get(i2)).a(c0088a);
}
e eVar2 = e.this;
if (eVar2.k != this.a || e.a(eVar2)) {
return 2;
}
}
return 0;
}
public final void a() {
this.h = 0L;
if (this.i || this.b.a()) {
return;
}
v vVar = this.b;
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar = this.c;
int i = e.this.c;
vVar.getClass();
Looper myLooper = Looper.myLooper();
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(myLooper != null);
v.b<? extends v.c> bVar = vVar.new b<>(myLooper, wVar, this, i, SystemClock.elapsedRealtime());
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(vVar.b == null);
vVar.b = bVar;
bVar.e = null;
vVar.a.execute(bVar);
}
/* JADX WARN: Removed duplicated region for block: B:20:0x0134 */
/* JADX WARN: Removed duplicated region for block: B:25:0x01b5 */
/* JADX WARN: Removed duplicated region for block: B:28:? A[RETURN, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:30:0x0148 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b r27) {
/*
Method dump skipped, instructions count: 452
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e.a.a(com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b):void");
}
}
public interface b {
void a(a.C0088a c0088a);
void b();
}
public static final class c extends IOException {
}
public static final class d extends IOException {
}
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.e$e, reason: collision with other inner class name */
public interface InterfaceC0089e {
}
public e(Uri uri, com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.d dVar, f.a aVar, int i, InterfaceC0089e interfaceC0089e) {
this.a = dVar;
this.i = aVar;
this.c = i;
this.f = interfaceC0089e;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2, boolean z) {
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
f.a aVar = this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar.b != null) {
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.c(aVar, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3));
}
}
public final boolean b(a.C0088a c0088a) {
int i;
a aVar = this.d.get(c0088a);
if (aVar.d != null) {
long elapsedRealtime = SystemClock.elapsedRealtime();
long max = Math.max(WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS, com.fyber.inneractive.sdk.player.exoplayer2.b.a(aVar.d.o));
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b bVar = aVar.d;
if (bVar.j || (i = bVar.b) == 2 || i == 1 || aVar.e + max > elapsedRealtime) {
return true;
}
}
return false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final void a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2) {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a aVar;
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c cVar = wVar2.d;
boolean z = cVar instanceof com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b;
if (z) {
List singletonList = Collections.singletonList(new a.C0088a(new j("0", MimeTypes.APPLICATION_M3U8, null, null, -1, -1, -1, -1, -1.0f, -1, -1.0f, null, -1, null, -1, -1, -1, -1, -1, 0, null, -1, Long.MAX_VALUE, null, null, null), cVar.a));
List emptyList = Collections.emptyList();
aVar = new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a(null, singletonList, emptyList, emptyList, null, null);
} else {
aVar = (com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a) cVar;
}
this.j = aVar;
this.k = aVar.b.get(0);
ArrayList arrayList = new ArrayList();
arrayList.addAll(aVar.b);
arrayList.addAll(aVar.c);
arrayList.addAll(aVar.d);
int size = arrayList.size();
long elapsedRealtime = SystemClock.elapsedRealtime();
for (int i = 0; i < size; i++) {
a.C0088a c0088a = (a.C0088a) arrayList.get(i);
this.d.put(c0088a, new a(c0088a, elapsedRealtime));
}
a aVar2 = this.d.get(this.k);
if (z) {
aVar2.a((com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b) cVar);
} else {
aVar2.a();
}
f.a aVar3 = this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar3.b != null) {
aVar3.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.b(aVar3, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3));
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.upstream.v.a
public final int a(w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar, long j, long j2, IOException iOException) {
boolean z;
w<com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.c> wVar2 = wVar;
boolean z2 = iOException instanceof m;
f.a aVar = this.i;
i iVar = wVar2.a;
long j3 = wVar2.f;
if (aVar.b != null) {
z = z2;
aVar.a.post(new com.fyber.inneractive.sdk.player.exoplayer2.source.d(aVar, iVar, 4, -1, null, 0, null, C.TIME_UNSET, C.TIME_UNSET, j, j2, j3, iOException, z));
} else {
z = z2;
}
return z ? 3 : 0;
}
public final com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b a(a.C0088a c0088a) {
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b bVar;
a aVar = this.d.get(c0088a);
aVar.getClass();
aVar.g = SystemClock.elapsedRealtime();
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b bVar2 = aVar.d;
if (bVar2 != null && this.j.b.contains(c0088a) && (((bVar = this.l) == null || !bVar.j) && this.d.get(this.k).g - SystemClock.elapsedRealtime() > MBInterstitialActivity.WEB_LOAD_TIME)) {
this.k = c0088a;
this.d.get(c0088a).a();
}
return bVar2;
}
public static boolean a(e eVar) {
List<a.C0088a> list = eVar.j.b;
int size = list.size();
long elapsedRealtime = SystemClock.elapsedRealtime();
for (int i = 0; i < size; i++) {
a aVar = eVar.d.get(list.get(i));
if (elapsedRealtime > aVar.h) {
eVar.k = aVar.a;
aVar.a();
return true;
}
}
return false;
}
public static boolean a(e eVar, a.C0088a c0088a, com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.b bVar) {
s sVar;
long j;
if (c0088a == eVar.k) {
if (eVar.l == null) {
eVar.m = !bVar.j;
}
eVar.l = bVar;
h hVar = (h) eVar.f;
hVar.getClass();
long j2 = bVar.c;
if (hVar.d.m) {
long j3 = bVar.j ? bVar.d + bVar.o : -9223372036854775807L;
List<b.a> list = bVar.m;
if (j2 == C.TIME_UNSET) {
if (!list.isEmpty()) {
j2 = list.get(Math.max(0, list.size() - 3)).d;
} else {
j = 0;
sVar = new s(j3, bVar.o, bVar.d, j, true, !bVar.j);
}
}
j = j2;
sVar = new s(j3, bVar.o, bVar.d, j, true, !bVar.j);
} else {
long j4 = j2 == C.TIME_UNSET ? 0L : j2;
long j5 = bVar.d;
long j6 = bVar.o;
sVar = new s(j5 + j6, j6, j5, j4, true, false);
}
p.a aVar = hVar.e;
com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.playlist.a aVar2 = hVar.d.j;
aVar.a(sVar, new com.fyber.inneractive.sdk.player.exoplayer2.extractor.hls.e());
}
int size = eVar.g.size();
for (int i = 0; i < size; i++) {
((b) eVar.g.get(i)).b();
}
return c0088a == eVar.k && !bVar.j;
}
}

View File

@@ -0,0 +1,58 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.fyber.inneractive.sdk.player.exoplayer2.metadata.a;
import com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.g;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/* loaded from: classes2.dex */
public final class i {
public static final Pattern c;
public int a = -1;
public int b = -1;
public class a implements g.a {
}
static {
new a();
c = Pattern.compile("^ [0-9a-fA-F]{8} ([0-9a-fA-F]{8}) ([0-9a-fA-F]{8})");
}
public final void a(com.fyber.inneractive.sdk.player.exoplayer2.metadata.a aVar) {
int i = 0;
while (true) {
a.b[] bVarArr = aVar.a;
if (i >= bVarArr.length) {
return;
}
a.b bVar = bVarArr[i];
if (bVar instanceof com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.e) {
com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.e eVar = (com.fyber.inneractive.sdk.player.exoplayer2.metadata.id3.e) bVar;
String str = eVar.c;
String str2 = eVar.d;
if ("iTunSMPB".equals(str)) {
Matcher matcher = c.matcher(str2);
if (matcher.find()) {
try {
int parseInt = Integer.parseInt(matcher.group(1), 16);
int parseInt2 = Integer.parseInt(matcher.group(2), 16);
if (parseInt > 0 || parseInt2 > 0) {
this.a = parseInt;
this.b = parseInt2;
return;
}
} catch (NumberFormatException unused) {
continue;
}
} else {
continue;
}
} else {
continue;
}
}
i++;
}
}
}

View File

@@ -0,0 +1,97 @@
package com.fyber.inneractive.sdk.player.exoplayer2.extractor;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ogg.DefaultOggSeeker;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import com.vungle.ads.internal.protos.Sdk;
import org.apache.http.HttpStatus;
/* loaded from: classes2.dex */
public final class j {
public static final String[] h = {MimeTypes.AUDIO_MPEG_L1, MimeTypes.AUDIO_MPEG_L2, MimeTypes.AUDIO_MPEG};
public static final int[] i = {44100, 48000, 32000};
public static final int[] j = {32, 64, 96, 128, 160, PsExtractor.AUDIO_STREAM, 224, 256, 288, Sdk.SDKError.Reason.WEBVIEW_ERROR_VALUE, 352, 384, HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE, 448};
public static final int[] k = {32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, PsExtractor.AUDIO_STREAM, 224, 256};
public static final int[] l = {32, 48, 56, 64, 80, 96, 112, 128, 160, PsExtractor.AUDIO_STREAM, 224, 256, Sdk.SDKError.Reason.WEBVIEW_ERROR_VALUE, 384};
public static final int[] m = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, PsExtractor.AUDIO_STREAM, 224, 256, Sdk.SDKError.Reason.WEBVIEW_ERROR_VALUE};
public static final int[] n = {8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160};
public int a;
public String b;
public int c;
public int d;
public int e;
public int f;
public int g;
public static int a(int i2) {
int i3;
int i4;
int i5;
int i6;
if ((i2 & (-2097152)) != -2097152 || (i3 = (i2 >>> 19) & 3) == 1 || (i4 = (i2 >>> 17) & 3) == 0 || (i5 = (i2 >>> 12) & 15) == 0 || i5 == 15 || (i6 = (i2 >>> 10) & 3) == 3) {
return -1;
}
int i7 = i[i6];
if (i3 == 2) {
i7 /= 2;
} else if (i3 == 0) {
i7 /= 4;
}
int i8 = (i2 >>> 9) & 1;
if (i4 == 3) {
return ((((i3 == 3 ? j[i5 - 1] : k[i5 - 1]) * 12000) / i7) + i8) * 4;
}
int i9 = i3 == 3 ? i4 == 2 ? l[i5 - 1] : m[i5 - 1] : n[i5 - 1];
if (i3 == 3) {
return ((i9 * 144000) / i7) + i8;
}
return (((i4 == 1 ? DefaultOggSeeker.MATCH_RANGE : 144000) * i9) / i7) + i8;
}
public static boolean a(int i2, j jVar) {
int i3;
int i4;
int i5;
int i6;
int i7;
int i8;
int i9;
int i10;
if ((i2 & (-2097152)) != -2097152 || (i3 = (i2 >>> 19) & 3) == 1 || (i4 = (i2 >>> 17) & 3) == 0 || (i5 = (i2 >>> 12) & 15) == 0 || i5 == 15 || (i6 = (i2 >>> 10) & 3) == 3) {
return false;
}
int i11 = i[i6];
if (i3 == 2) {
i11 /= 2;
} else if (i3 == 0) {
i11 /= 4;
}
int i12 = (i2 >>> 9) & 1;
if (i4 == 3) {
i7 = i3 == 3 ? j[i5 - 1] : k[i5 - 1];
i9 = (((i7 * 12000) / i11) + i12) * 4;
i10 = 384;
} else {
if (i3 == 3) {
i7 = i4 == 2 ? l[i5 - 1] : m[i5 - 1];
i8 = (144000 * i7) / i11;
} else {
i7 = n[i5 - 1];
r9 = i4 == 1 ? 576 : 1152;
i8 = ((i4 == 1 ? DefaultOggSeeker.MATCH_RANGE : 144000) * i7) / i11;
}
i9 = i8 + i12;
i10 = r9;
}
String str = h[3 - i4];
int i13 = ((i2 >> 6) & 3) == 3 ? 1 : 2;
jVar.a = i3;
jVar.b = str;
jVar.c = i9;
jVar.d = i11;
jVar.e = i13;
jVar.f = i7 * 1000;
jVar.g = i10;
return true;
}
}

Some files were not shown because too many files have changed in this diff Show More