package p6; import java.util.List; /* compiled from: MotionPhotoDescription.java */ /* loaded from: classes4.dex */ final class b { /* renamed from: a reason: collision with root package name */ public final long f19982a; /* renamed from: b reason: collision with root package name */ public final List f19983b; /* compiled from: MotionPhotoDescription.java */ /* loaded from: classes4.dex */ public static final class a { /* renamed from: a reason: collision with root package name */ public final String f19984a; /* renamed from: b reason: collision with root package name */ public final String f19985b; /* renamed from: c reason: collision with root package name */ public final long f19986c; /* renamed from: d reason: collision with root package name */ public final long f19987d; public a(String str, String str2, long j10, long j11) { this.f19984a = str; this.f19985b = str2; this.f19986c = j10; this.f19987d = j11; } } public b(long j10, List list) { this.f19982a = j10; this.f19983b = list; } public e7.b a(long j10) { long j11; if (this.f19983b.size() < 2) { return null; } long j12 = j10; long j13 = -1; long j14 = -1; long j15 = -1; long j16 = -1; boolean z10 = false; for (int size = this.f19983b.size() - 1; size >= 0; size--) { a aVar = this.f19983b.get(size); boolean equals = "video/mp4".equals(aVar.f19984a) | z10; if (size == 0) { j12 = 0; j11 = j12 - aVar.f19987d; } else { j12 -= aVar.f19986c; j11 = j12; } if (!equals || j12 == j11) { z10 = equals; } else { j16 = j11 - j12; j15 = j12; z10 = false; } if (size == 0) { j13 = j12; j14 = j11; } } if (j15 == -1 || j16 == -1 || j13 == -1 || j14 == -1) { return null; } return new e7.b(j13, j14, this.f19982a, j15, j16); } }