105 lines
3.8 KiB
Java
105 lines
3.8 KiB
Java
package c.i.a.c.a2.j0;
|
|
|
|
import c.i.a.c.a2.a;
|
|
import c.i.a.c.a2.i;
|
|
import c.i.a.c.i2.e0;
|
|
import c.i.a.c.i2.f0;
|
|
import c.i.a.c.i2.w;
|
|
import java.io.IOException;
|
|
/* compiled from: PsBinarySearchSeeker */
|
|
public final class z extends c.i.a.c.a2.a {
|
|
|
|
/* compiled from: PsBinarySearchSeeker */
|
|
public static final class b implements a.f {
|
|
public final e0 a;
|
|
public final w b = new w();
|
|
|
|
public b(e0 e0Var, a aVar) {
|
|
this.a = e0Var;
|
|
}
|
|
|
|
@Override // c.i.a.c.a2.a.f
|
|
public void a() {
|
|
this.b.A(f0.f);
|
|
}
|
|
|
|
@Override // c.i.a.c.a2.a.f
|
|
public a.e b(i iVar, long j) throws IOException {
|
|
int g;
|
|
long position = iVar.getPosition();
|
|
int min = (int) Math.min(20000L, iVar.b() - position);
|
|
this.b.z(min);
|
|
iVar.n(this.b.a, 0, min);
|
|
w wVar = this.b;
|
|
int i = -1;
|
|
long j2 = -9223372036854775807L;
|
|
int i2 = -1;
|
|
while (wVar.a() >= 4) {
|
|
if (z.g(wVar.a, wVar.b) != 442) {
|
|
wVar.E(1);
|
|
} else {
|
|
wVar.E(4);
|
|
long c2 = a0.c(wVar);
|
|
if (c2 != -9223372036854775807L) {
|
|
long b = this.a.b(c2);
|
|
if (b > j) {
|
|
return j2 == -9223372036854775807L ? a.e.a(b, position) : a.e.b(position + ((long) i2));
|
|
}
|
|
if (100000 + b > j) {
|
|
return a.e.b(position + ((long) wVar.b));
|
|
}
|
|
i2 = wVar.b;
|
|
j2 = b;
|
|
}
|
|
int i3 = wVar.f913c;
|
|
if (wVar.a() >= 10) {
|
|
wVar.E(9);
|
|
int s2 = wVar.s() & 7;
|
|
if (wVar.a() >= s2) {
|
|
wVar.E(s2);
|
|
if (wVar.a() >= 4) {
|
|
if (z.g(wVar.a, wVar.b) == 443) {
|
|
wVar.E(4);
|
|
int x2 = wVar.x();
|
|
if (wVar.a() < x2) {
|
|
wVar.D(i3);
|
|
} else {
|
|
wVar.E(x2);
|
|
}
|
|
}
|
|
while (true) {
|
|
if (wVar.a() < 4 || (g = z.g(wVar.a, wVar.b)) == 442 || g == 441 || (g >>> 8) != 1) {
|
|
break;
|
|
}
|
|
wVar.E(4);
|
|
if (wVar.a() < 2) {
|
|
wVar.D(i3);
|
|
break;
|
|
}
|
|
wVar.D(Math.min(wVar.f913c, wVar.b + wVar.x()));
|
|
}
|
|
} else {
|
|
wVar.D(i3);
|
|
}
|
|
} else {
|
|
wVar.D(i3);
|
|
}
|
|
} else {
|
|
wVar.D(i3);
|
|
}
|
|
i = wVar.b;
|
|
}
|
|
}
|
|
return j2 != -9223372036854775807L ? a.e.c(j2, position + ((long) i)) : a.e.a;
|
|
}
|
|
}
|
|
|
|
public z(e0 e0Var, long j, long j2) {
|
|
super(new a.b(), new b(e0Var, null), j, 0, j + 1, 0, j2, 188, 1000);
|
|
}
|
|
|
|
public static int g(byte[] bArr, int i) {
|
|
return (bArr[i + 3] & 255) | ((bArr[i] & 255) << 24) | ((bArr[i + 1] & 255) << 16) | ((bArr[i + 2] & 255) << 8);
|
|
}
|
|
}
|