package c.i.a.c.j2; import androidx.annotation.Nullable; import c.i.a.c.i2.h; import c.i.a.c.i2.u; import c.i.a.c.i2.w; import com.google.android.exoplayer2.ParserException; import java.util.ArrayList; import java.util.List; /* compiled from: AvcConfig */ public final class j { public final List a; public final int b; /* renamed from: c reason: collision with root package name */ public final int f918c; public final int d; public final float e; @Nullable public final String f; public j(List list, int i, int i2, int i3, float f, @Nullable String str) { this.a = list; this.b = i; this.f918c = i2; this.d = i3; this.e = f; this.f = str; } public static byte[] a(w wVar) { int x2 = wVar.x(); int i = wVar.b; wVar.E(x2); byte[] bArr = wVar.a; byte[] bArr2 = h.a; byte[] bArr3 = new byte[(bArr2.length + x2)]; System.arraycopy(bArr2, 0, bArr3, 0, bArr2.length); System.arraycopy(bArr, i, bArr3, bArr2.length, x2); return bArr3; } public static j b(w wVar) throws ParserException { String str; float f; int i; int i2; try { wVar.E(4); int s2 = (wVar.s() & 3) + 1; if (s2 != 3) { ArrayList arrayList = new ArrayList(); int s3 = wVar.s() & 31; for (int i3 = 0; i3 < s3; i3++) { arrayList.add(a(wVar)); } int s4 = wVar.s(); for (int i4 = 0; i4 < s4; i4++) { arrayList.add(a(wVar)); } if (s3 > 0) { u.b d = u.d((byte[]) arrayList.get(0), s2, ((byte[]) arrayList.get(0)).length); int i5 = d.e; int i6 = d.f; float f2 = d.g; str = h.a(d.a, d.b, d.f911c); i2 = i5; i = i6; f = f2; } else { str = null; i2 = -1; i = -1; f = 1.0f; } return new j(arrayList, s2, i2, i, f, str); } throw new IllegalStateException(); } catch (ArrayIndexOutOfBoundsException e) { throw new ParserException("Error parsing AVC config", e); } } }