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

92 lines
2.8 KiB
Java

package c.i.a.c.a2.d0;
import c.d.b.a.a;
import c.i.a.c.i2.u;
import c.i.a.c.i2.w;
import c.i.a.c.j2.j;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.flv.TagPayloadReader;
/* compiled from: VideoTagPayloadReader */
public final class e extends TagPayloadReader {
public final w b = new w(u.a);
/* renamed from: c reason: collision with root package name */
public final w f652c = new w(4);
public int d;
public boolean e;
public boolean f;
public int g;
public e(c.i.a.c.a2.w wVar) {
super(wVar);
}
@Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
public boolean b(w wVar) throws TagPayloadReader.UnsupportedFormatException {
int s2 = wVar.s();
int i = (s2 >> 4) & 15;
int i2 = s2 & 15;
if (i2 == 7) {
this.g = i;
return i != 5;
}
throw new TagPayloadReader.UnsupportedFormatException(a.k("Video format not supported: ", i2));
}
@Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
public boolean c(w wVar, long j) throws ParserException {
int s2 = wVar.s();
byte[] bArr = wVar.a;
int i = wVar.b;
int i2 = i + 1;
wVar.b = i2;
int i3 = i2 + 1;
wVar.b = i3;
int i4 = (((bArr[i] & 255) << 24) >> 8) | ((bArr[i2] & 255) << 8);
wVar.b = i3 + 1;
long j2 = (((long) ((bArr[i3] & 255) | i4)) * 1000) + j;
if (s2 == 0 && !this.e) {
w wVar2 = new w(new byte[wVar.a()]);
wVar.e(wVar2.a, 0, wVar.a());
j b = j.b(wVar2);
this.d = b.b;
Format.b bVar = new Format.b();
bVar.k = "video/avc";
bVar.h = b.f;
bVar.p = b.f915c;
bVar.q = b.d;
bVar.t = b.e;
bVar.m = b.a;
this.a.e(bVar.a());
this.e = true;
return false;
} else if (s2 != 1 || !this.e) {
return false;
} else {
int i5 = this.g == 1 ? 1 : 0;
if (!this.f && i5 == 0) {
return false;
}
byte[] bArr2 = this.f652c.a;
bArr2[0] = 0;
bArr2[1] = 0;
bArr2[2] = 0;
int i6 = 4 - this.d;
int i7 = 0;
while (wVar.a() > 0) {
wVar.e(this.f652c.a, i6, this.d);
this.f652c.D(0);
int v = this.f652c.v();
this.b.D(0);
this.a.c(this.b, 4);
this.a.c(wVar, v);
i7 = i7 + 4 + v;
}
this.a.d(j2, i5, i7, 0, null);
this.f = true;
return true;
}
}
}