discord-jadx/app/src/main/java/c/i/a/c/e2/u/d.java

78 lines
2.7 KiB
Java

package c.i.a.c.e2.u;
import c.i.a.c.e2.c;
import c.i.a.c.e2.f;
import c.i.a.c.e2.u.h;
import c.i.a.c.i2.f0;
import c.i.a.c.i2.w;
import com.google.android.exoplayer2.text.SubtitleDecoderException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Pattern;
/* compiled from: Mp4WebvttDecoder */
public final class d extends c.i.a.c.e2.d {
public final w n = new w();
public d() {
super("Mp4WebvttDecoder");
}
@Override // c.i.a.c.e2.d
public f j(byte[] bArr, int i, boolean z2) throws SubtitleDecoderException {
c cVar;
w wVar = this.n;
wVar.a = bArr;
wVar.f913c = i;
wVar.b = 0;
ArrayList arrayList = new ArrayList();
while (this.n.a() > 0) {
if (this.n.a() >= 8) {
int f = this.n.f();
if (this.n.f() == 1987343459) {
w wVar2 = this.n;
int i2 = f - 8;
CharSequence charSequence = null;
c.b bVar = null;
while (i2 > 0) {
if (i2 >= 8) {
int f2 = wVar2.f();
int f3 = wVar2.f();
int i3 = f2 - 8;
String m = f0.m(wVar2.a, wVar2.b, i3);
wVar2.E(i3);
i2 = (i2 - 8) - i3;
if (f3 == 1937011815) {
h.e eVar = new h.e();
h.e(m, eVar);
bVar = eVar.a();
} else if (f3 == 1885436268) {
charSequence = h.f(null, m.trim(), Collections.emptyList());
}
} else {
throw new SubtitleDecoderException("Incomplete vtt cue box header found.");
}
}
if (charSequence == null) {
charSequence = "";
}
if (bVar != null) {
bVar.a = charSequence;
cVar = bVar.a();
} else {
Pattern pattern = h.a;
h.e eVar2 = new h.e();
eVar2.f859c = charSequence;
cVar = eVar2.a().a();
}
arrayList.add(cVar);
} else {
this.n.E(f - 8);
}
} else {
throw new SubtitleDecoderException("Incomplete Mp4Webvtt Top Level box header found.");
}
}
return new e(arrayList);
}
}