92 lines
3.0 KiB
Java
92 lines
3.0 KiB
Java
package c.i.a.c.a2.d0;
|
|
|
|
import c.d.b.a.a;
|
|
import c.i.a.c.a2.w;
|
|
import c.i.a.c.i2.v;
|
|
import c.i.a.c.v1.k;
|
|
import com.google.android.exoplayer2.Format;
|
|
import com.google.android.exoplayer2.ParserException;
|
|
import com.google.android.exoplayer2.extractor.flv.TagPayloadReader;
|
|
import java.util.Collections;
|
|
/* compiled from: AudioTagPayloadReader */
|
|
public final class b extends TagPayloadReader {
|
|
public static final int[] b = {5512, 11025, 22050, 44100};
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public boolean f692c;
|
|
public boolean d;
|
|
public int e;
|
|
|
|
public b(w wVar) {
|
|
super(wVar);
|
|
}
|
|
|
|
@Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
|
|
public boolean b(c.i.a.c.i2.w wVar) throws TagPayloadReader.UnsupportedFormatException {
|
|
if (!this.f692c) {
|
|
int s = wVar.s();
|
|
int i = (s >> 4) & 15;
|
|
this.e = i;
|
|
if (i == 2) {
|
|
int i2 = b[(s >> 2) & 3];
|
|
Format.b bVar = new Format.b();
|
|
bVar.k = "audio/mpeg";
|
|
bVar.f2701x = 1;
|
|
bVar.f2702y = i2;
|
|
this.a.e(bVar.a());
|
|
this.d = true;
|
|
} else if (i == 7 || i == 8) {
|
|
String str = i == 7 ? "audio/g711-alaw" : "audio/g711-mlaw";
|
|
Format.b bVar2 = new Format.b();
|
|
bVar2.k = str;
|
|
bVar2.f2701x = 1;
|
|
bVar2.f2702y = 8000;
|
|
this.a.e(bVar2.a());
|
|
this.d = true;
|
|
} else if (i != 10) {
|
|
StringBuilder O = a.O("Audio format not supported: ");
|
|
O.append(this.e);
|
|
throw new TagPayloadReader.UnsupportedFormatException(O.toString());
|
|
}
|
|
this.f692c = true;
|
|
} else {
|
|
wVar.E(1);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
|
|
public boolean c(c.i.a.c.i2.w wVar, long j) throws ParserException {
|
|
if (this.e == 2) {
|
|
int a = wVar.a();
|
|
this.a.c(wVar, a);
|
|
this.a.d(j, 1, a, 0, null);
|
|
return true;
|
|
}
|
|
int s = wVar.s();
|
|
if (s == 0 && !this.d) {
|
|
int a2 = wVar.a();
|
|
byte[] bArr = new byte[a2];
|
|
System.arraycopy(wVar.a, wVar.b, bArr, 0, a2);
|
|
wVar.b += a2;
|
|
k.b c2 = k.c(new v(bArr), false);
|
|
Format.b bVar = new Format.b();
|
|
bVar.k = "audio/mp4a-latm";
|
|
bVar.h = c2.f1055c;
|
|
bVar.f2701x = c2.b;
|
|
bVar.f2702y = c2.a;
|
|
bVar.m = Collections.singletonList(bArr);
|
|
this.a.e(bVar.a());
|
|
this.d = true;
|
|
return false;
|
|
} else if (this.e == 10 && s != 1) {
|
|
return false;
|
|
} else {
|
|
int a3 = wVar.a();
|
|
this.a.c(wVar, a3);
|
|
this.a.d(j, 1, a3, 0, null);
|
|
return true;
|
|
}
|
|
}
|
|
}
|