discord-jadx/app/src/main/java/c/i/a/c/a2/d0/c.java

201 lines
5.9 KiB
Java

package c.i.a.c.a2.d0;
import c.i.a.c.a2.h;
import c.i.a.c.a2.i;
import c.i.a.c.a2.j;
import c.i.a.c.a2.r;
import c.i.a.c.a2.s;
import c.i.a.c.a2.t;
import c.i.a.c.i2.w;
import com.airbnb.lottie.parser.AnimatableValueParser;
import java.io.IOException;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/* compiled from: FlvExtractor */
public final class c implements h {
public final w a = new w(4);
public final w b = new w(9);
/* renamed from: c reason: collision with root package name */
public final w f648c = new w(11);
public final w d = new w();
public final d e = new d();
public j f;
public int g = 1;
public boolean h;
public long i;
public int j;
public int k;
public int l;
public long m;
public boolean n;
public b o;
public e p;
static {
a aVar = a.a;
}
@RequiresNonNull({"extractorOutput"})
public final void a() {
if (!this.n) {
this.f.a(new t.b(-9223372036854775807L, 0));
this.n = true;
}
}
@Override // c.i.a.c.a2.h
public boolean b(i iVar) throws IOException {
iVar.n(this.a.a, 0, 3);
this.a.D(0);
if (this.a.u() != 4607062) {
return false;
}
iVar.n(this.a.a, 0, 2);
this.a.D(0);
if ((this.a.x() & 250) != 0) {
return false;
}
iVar.n(this.a.a, 0, 4);
this.a.D(0);
int f = this.a.f();
iVar.k();
iVar.g(f);
iVar.n(this.a.a, 0, 4);
this.a.D(0);
return this.a.f() == 0;
}
public final w c(i iVar) throws IOException {
int i = this.l;
w wVar = this.d;
byte[] bArr = wVar.a;
if (i > bArr.length) {
wVar.a = new byte[Math.max(bArr.length * 2, i)];
wVar.f908c = 0;
wVar.b = 0;
} else {
wVar.D(0);
}
this.d.C(this.l);
iVar.readFully(this.d.a, 0, this.l);
return this.d;
}
/* JADX WARNING: Removed duplicated region for block: B:37:0x00a6 */
/* JADX WARNING: Removed duplicated region for block: B:38:0x00aa */
/* JADX WARNING: Removed duplicated region for block: B:75:0x00b4 A[SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:82:0x0009 A[SYNTHETIC] */
@Override // c.i.a.c.a2.h
public int e(i iVar, s sVar) throws IOException {
boolean z2;
boolean z3;
AnimatableValueParser.H(this.f);
while (true) {
int i = this.g;
boolean z4 = false;
if (i == 1) {
if (iVar.c(this.b.a, 0, 9, true)) {
this.b.D(0);
this.b.E(4);
int s2 = this.b.s();
boolean z5 = (s2 & 4) != 0;
if ((s2 & 1) != 0) {
z4 = true;
}
if (z5 && this.o == null) {
this.o = new b(this.f.p(8, 1));
}
if (z4 && this.p == null) {
this.p = new e(this.f.p(9, 2));
}
this.f.j();
this.j = (this.b.f() - 9) + 4;
this.g = 2;
z4 = true;
}
if (!z4) {
return -1;
}
} else if (i == 2) {
iVar.l(this.j);
this.j = 0;
this.g = 3;
} else if (i == 3) {
if (iVar.c(this.f648c.a, 0, 11, true)) {
this.f648c.D(0);
this.k = this.f648c.s();
this.l = this.f648c.u();
this.m = (long) this.f648c.u();
this.m = (((long) (this.f648c.s() << 24)) | this.m) * 1000;
this.f648c.E(3);
this.g = 4;
z4 = true;
}
if (!z4) {
return -1;
}
} else if (i == 4) {
long j = this.h ? this.i + this.m : this.e.b == -9223372036854775807L ? 0 : this.m;
int i2 = this.k;
if (i2 == 8 && this.o != null) {
a();
z3 = this.o.a(c(iVar), j);
} else if (i2 == 9 && this.p != null) {
a();
z3 = this.p.a(c(iVar), j);
} else if (i2 != 18 || this.n) {
iVar.l(this.l);
z3 = false;
z2 = false;
if (!this.h && z3) {
this.h = true;
this.i = this.e.b != -9223372036854775807L ? -this.m : 0;
}
this.j = 4;
this.g = 2;
if (!z2) {
return 0;
}
} else {
z3 = this.e.a(c(iVar), j);
d dVar = this.e;
long j2 = dVar.b;
if (j2 != -9223372036854775807L) {
this.f.a(new r(dVar.d, dVar.f649c, j2));
this.n = true;
}
}
z2 = true;
this.h = true;
this.i = this.e.b != -9223372036854775807L ? -this.m : 0;
this.j = 4;
this.g = 2;
if (!z2) {
}
} else {
throw new IllegalStateException();
}
}
}
@Override // c.i.a.c.a2.h
public void f(j jVar) {
this.f = jVar;
}
@Override // c.i.a.c.a2.h
public void g(long j, long j2) {
if (j == 0) {
this.g = 1;
this.h = false;
} else {
this.g = 3;
}
this.j = 0;
}
@Override // c.i.a.c.a2.h
public void release() {
}
}