discord-jadx/app/src/main/java/c/i/a/c/e2/m/e.java
2021-07-28 09:39:21 +02:00

178 lines
4.5 KiB
Java

package c.i.a.c.e2.m;
import androidx.annotation.Nullable;
import c.i.a.c.e2.g;
import c.i.a.c.e2.i;
import c.i.a.c.e2.j;
import c.i.a.c.i2.f0;
import c.i.a.c.x1.f;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.google.android.exoplayer2.decoder.DecoderException;
import com.google.android.exoplayer2.text.SubtitleDecoderException;
import java.util.ArrayDeque;
import java.util.PriorityQueue;
/* compiled from: CeaDecoder */
public abstract class e implements g {
public final ArrayDeque<b> a = new ArrayDeque<>();
public final ArrayDeque<j> b;
/* renamed from: c reason: collision with root package name */
public final PriorityQueue<b> f831c;
@Nullable
public b d;
public long e;
public long f;
/* compiled from: CeaDecoder */
public static final class b extends i implements Comparable<b> {
public long r;
public b() {
}
public b(a aVar) {
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // java.lang.Comparable
public int compareTo(b bVar) {
b bVar2 = bVar;
if (n() == bVar2.n()) {
long j = this.m - bVar2.m;
if (j == 0) {
j = this.r - bVar2.r;
if (j == 0) {
return 0;
}
}
if (j > 0) {
return 1;
}
} else if (n()) {
return 1;
}
return -1;
}
}
/* compiled from: CeaDecoder */
public static final class c extends j {
public f.a<c> m;
public c(f.a<c> aVar) {
this.m = aVar;
}
@Override // c.i.a.c.x1.f
public final void p() {
this.m.a(this);
}
}
public e() {
for (int i = 0; i < 10; i++) {
this.a.add(new b(null));
}
this.b = new ArrayDeque<>();
for (int i2 = 0; i2 < 2; i2++) {
this.b.add(new c(new b(this)));
}
this.f831c = new PriorityQueue<>();
}
@Override // c.i.a.c.e2.g
public void a(long j) {
this.e = j;
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // c.i.a.c.x1.c
@Nullable
public i c() throws DecoderException {
AnimatableValueParser.D(this.d == null);
if (this.a.isEmpty()) {
return null;
}
b pollFirst = this.a.pollFirst();
this.d = pollFirst;
return pollFirst;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // c.i.a.c.x1.c
public void d(i iVar) throws DecoderException {
i iVar2 = iVar;
AnimatableValueParser.k(iVar2 == this.d);
b bVar = (b) iVar2;
if (bVar.m()) {
i(bVar);
} else {
long j = this.f;
this.f = 1 + j;
bVar.r = j;
this.f831c.add(bVar);
}
this.d = null;
}
public abstract c.i.a.c.e2.f e();
public abstract void f(i iVar);
@Override // c.i.a.c.x1.c
public void flush() {
this.f = 0;
this.e = 0;
while (!this.f831c.isEmpty()) {
int i = f0.a;
i(this.f831c.poll());
}
b bVar = this.d;
if (bVar != null) {
i(bVar);
this.d = null;
}
}
@Nullable
/* renamed from: g */
public j b() throws SubtitleDecoderException {
if (this.b.isEmpty()) {
return null;
}
while (!this.f831c.isEmpty()) {
int i = f0.a;
if (this.f831c.peek().m > this.e) {
break;
}
b poll = this.f831c.poll();
if (poll.n()) {
j pollFirst = this.b.pollFirst();
pollFirst.j(4);
i(poll);
return pollFirst;
}
f(poll);
if (h()) {
c.i.a.c.e2.f e = e();
j pollFirst2 = this.b.pollFirst();
pollFirst2.r(poll.m, e, Long.MAX_VALUE);
i(poll);
return pollFirst2;
}
i(poll);
}
return null;
}
public abstract boolean h();
public final void i(b bVar) {
bVar.p();
this.a.add(bVar);
}
@Override // c.i.a.c.x1.c
public void release() {
}
}