68 lines
1.6 KiB
Java
68 lines
1.6 KiB
Java
package c.i.a.c.a2;
|
|
|
|
import c.i.a.c.a2.t;
|
|
import c.i.a.c.i2.f0;
|
|
/* compiled from: ConstantBitrateSeekMap */
|
|
public class d implements t {
|
|
public final long a;
|
|
public final long b;
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public final int f651c;
|
|
public final long d;
|
|
public final int e;
|
|
public final long f;
|
|
|
|
public d(long j, long j2, int i, int i2) {
|
|
this.a = j;
|
|
this.b = j2;
|
|
this.f651c = i2 == -1 ? 1 : i2;
|
|
this.e = i;
|
|
if (j == -1) {
|
|
this.d = -1;
|
|
this.f = -9223372036854775807L;
|
|
return;
|
|
}
|
|
this.d = j - j2;
|
|
this.f = e(j, j2, i);
|
|
}
|
|
|
|
public static long e(long j, long j2, int i) {
|
|
return ((Math.max(0L, j - j2) * 8) * 1000000) / ((long) i);
|
|
}
|
|
|
|
public long b(long j) {
|
|
return e(j, this.b, this.e);
|
|
}
|
|
|
|
@Override // c.i.a.c.a2.t
|
|
public boolean c() {
|
|
return this.d != -1;
|
|
}
|
|
|
|
@Override // c.i.a.c.a2.t
|
|
public t.a h(long j) {
|
|
long j2 = this.d;
|
|
if (j2 == -1) {
|
|
return new t.a(new u(0, this.b));
|
|
}
|
|
long j3 = (long) this.f651c;
|
|
long i = this.b + f0.i((((((long) this.e) * j) / 8000000) / j3) * j3, 0, j2 - j3);
|
|
long b = b(i);
|
|
u uVar = new u(b, i);
|
|
if (b < j) {
|
|
int i2 = this.f651c;
|
|
if (((long) i2) + i < this.a) {
|
|
long j4 = i + ((long) i2);
|
|
return new t.a(uVar, new u(b(j4), j4));
|
|
}
|
|
}
|
|
return new t.a(uVar);
|
|
}
|
|
|
|
@Override // c.i.a.c.a2.t
|
|
public long i() {
|
|
return this.f;
|
|
}
|
|
}
|