package o; import com.google.common.primitives.UnsignedBytes; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; /* renamed from: o.jsx, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C15955jsx extends yXE { private static final Pattern e = Pattern.compile("([+-]\\d+\\.\\d+)([+-]\\d+\\.\\d+)"); public C15955jsx(C16613piz c16613piz) { super(c16613piz); } @Override // o.yXE public final sRW d() { return new sRW(); } @Override // o.yXE public final boolean e(String str) { return str.equals("ftyp") || str.equals("mvhd") || str.equals("hdlr") || str.equals("mdhd") || str.equals("tkhd") || str.equals("udta") || str.equals("uuid"); } @Override // o.yXE public final boolean c(String str) { return str.equals("trak") || str.equals("meta") || str.equals("moov") || str.equals("mdia"); } @Override // o.yXE public final yXE c(String str, byte[] bArr, long j, ExA exA) throws IOException { long f; long f2; long f3; long f4; if (bArr != null) { C0629LEh c0629LEh = new C0629LEh(bArr); if (!str.equals("mvhd")) { if (!str.equals("ftyp")) { if (str.equals("hdlr")) { c0629LEh.b(4L); c0629LEh.b(4L); String str2 = new String(c0629LEh.a(4)); c0629LEh.b(12L); new Gux(c0629LEh.c(((int) j) - 32), Charset.defaultCharset()); if (str2.equals("soun")) { return new HDX(this.a, exA); } if (str2.equals("vide")) { return new lXU(this.a, exA); } if (str2.equals("hint")) { return new ZPW(this.a, exA); } if (str2.equals("text")) { return new UWL(this.a, exA); } return str2.equals("meta") ? new FaI(this.a, exA) : this; } if (!str.equals("mdhd")) { if (!str.equals("tkhd")) { if (str.equals("uuid")) { new TfT(this.a).c(str, bArr, j, exA); } else if (str.equals("udta")) { int length = bArr.length; String str3 = null; while (c0629LEh.c() < length) { long f5 = c0629LEh.f(); if (f5 <= 4) { break; } if (c0629LEh.a() == -1451722374) { int h = c0629LEh.h(); c0629LEh.b(2L); str3 = c0629LEh.a(h, "UTF-8"); } else { if (f5 < 8) { break; } c0629LEh.b(f5 - 8); } } if (str3 != null) { Matcher matcher = e.matcher(str3); if (matcher.find()) { double parseDouble = Double.parseDouble(matcher.group(1)); double parseDouble2 = Double.parseDouble(matcher.group(2)); this.d.c(8193, parseDouble); this.d.c(8194, parseDouble2); } } } } else { short b = (short) (c0629LEh.b() & UnsignedBytes.MAX_VALUE); c0629LEh.b(3L); if (b == 1) { c0629LEh.g(); c0629LEh.g(); c0629LEh.a(); c0629LEh.b(4L); c0629LEh.g(); } else { c0629LEh.f(); c0629LEh.f(); c0629LEh.f(); c0629LEh.b(4L); c0629LEh.f(); } c0629LEh.b(8L); c0629LEh.e(); c0629LEh.e(); c0629LEh.e(); c0629LEh.b(2L); int[] iArr = new int[9]; for (int i = 0; i < 9; i++) { iArr[i] = c0629LEh.a(); } long a = c0629LEh.a(); long a2 = c0629LEh.a(); if (a != 0 && a2 != 0 && this.d.c(512) == null) { this.d.c(512, Math.toDegrees(Math.atan2(iArr[0] + iArr[3], iArr[1] + iArr[4])) - 45.0d); } } } else { short b2 = (short) (c0629LEh.b() & UnsignedBytes.MAX_VALUE); c0629LEh.b(3L); if (b2 == 1) { exA.a = Long.valueOf(c0629LEh.g()); exA.b = Long.valueOf(c0629LEh.g()); exA.e = Long.valueOf(c0629LEh.a()); exA.d = Long.valueOf(c0629LEh.g()); } else { exA.a = Long.valueOf(c0629LEh.f()); exA.b = Long.valueOf(c0629LEh.f()); exA.e = Long.valueOf(c0629LEh.f()); exA.d = Long.valueOf(c0629LEh.f()); } short e2 = c0629LEh.e(); exA.c = new String(new char[]{(char) (((e2 & 31744) >> 10) + 96), (char) (((e2 & 992) >> 5) + 96), (char) ((e2 & 31) + 96)}); } } else { String str4 = new String(c0629LEh.a(4)); long f6 = c0629LEh.f(); ArrayList arrayList = new ArrayList(); for (int i2 = 16; i2 < j; i2 += 4) { arrayList.add(new String(c0629LEh.a(4))); } this.d.e(1, str4); this.d.e(2, f6); this.d.c(3, (String[]) arrayList.toArray(new String[arrayList.size()])); } } else { short b3 = (short) (c0629LEh.b() & UnsignedBytes.MAX_VALUE); c0629LEh.b(3L); if (b3 == 1) { f = c0629LEh.g(); f2 = c0629LEh.g(); f3 = c0629LEh.f(); f4 = c0629LEh.g(); } else { f = c0629LEh.f(); f2 = c0629LEh.f(); f3 = c0629LEh.f(); f4 = c0629LEh.f(); } int a3 = c0629LEh.a(); short e3 = c0629LEh.e(); c0629LEh.b(2L); c0629LEh.b(8L); int[] iArr2 = {c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a(), c0629LEh.a()}; c0629LEh.b(24L); long f7 = c0629LEh.f(); BrP.b(new Object[]{this.d, 256, C11453efd.b(f)}, -1773350281, 1773350288, 256); BrP.b(new Object[]{this.d, 257, C11453efd.b(f2)}, -1773350281, 1773350288, 257); this.d.e(259, f4); this.d.e(258, f3); this.d.d(260, new Axo(f4, f3)); this.d.b(271, iArr2); this.d.c(261, (((-65536) & a3) >> 16) + ((65535 & a3) / Math.pow(2.0d, 4.0d))); this.d.c(262, ((65280 & e3) >> 8) + ((e3 & 255) / Math.pow(2.0d, 2.0d))); this.d.e(270, f7); } } else if (str.equals("cmov")) { T t = this.d; BrP.b(new Object[]{t, "Compressed MP4 movies not supported"}, -1786863991, 1786863992, System.identityHashCode(t)); } return this; } }