package s1; import com.bumptech.glide.load.data.d; import java.io.File; import java.util.List; import s1.f; import w1.m; /* loaded from: classes.dex */ class c implements f, d.a { /* renamed from: a, reason: collision with root package name */ private final List f13781a; /* renamed from: b, reason: collision with root package name */ private final g f13782b; /* renamed from: c, reason: collision with root package name */ private final f.a f13783c; /* renamed from: d, reason: collision with root package name */ private int f13784d; /* renamed from: e, reason: collision with root package name */ private q1.f f13785e; /* renamed from: f, reason: collision with root package name */ private List f13786f; /* renamed from: g, reason: collision with root package name */ private int f13787g; /* renamed from: h, reason: collision with root package name */ private volatile m.a f13788h; /* renamed from: i, reason: collision with root package name */ private File f13789i; c(g gVar, f.a aVar) { this(gVar.c(), gVar, aVar); } private boolean a() { return this.f13787g < this.f13786f.size(); } @Override // com.bumptech.glide.load.data.d.a public void c(Exception exc) { this.f13783c.e(this.f13785e, exc, this.f13788h.f15058c, q1.a.DATA_DISK_CACHE); } @Override // s1.f public void cancel() { m.a aVar = this.f13788h; if (aVar != null) { aVar.f15058c.cancel(); } } @Override // s1.f public boolean d() { while (true) { boolean z10 = false; if (this.f13786f != null && a()) { this.f13788h = null; while (!z10 && a()) { List list = this.f13786f; int i10 = this.f13787g; this.f13787g = i10 + 1; this.f13788h = ((w1.m) list.get(i10)).b(this.f13789i, this.f13782b.s(), this.f13782b.f(), this.f13782b.k()); if (this.f13788h != null && this.f13782b.t(this.f13788h.f15058c.a())) { this.f13788h.f15058c.f(this.f13782b.l(), this); z10 = true; } } return z10; } int i11 = this.f13784d + 1; this.f13784d = i11; if (i11 >= this.f13781a.size()) { return false; } q1.f fVar = (q1.f) this.f13781a.get(this.f13784d); File b10 = this.f13782b.d().b(new d(fVar, this.f13782b.o())); this.f13789i = b10; if (b10 != null) { this.f13785e = fVar; this.f13786f = this.f13782b.j(b10); this.f13787g = 0; } } } @Override // com.bumptech.glide.load.data.d.a public void e(Object obj) { this.f13783c.a(this.f13785e, obj, this.f13788h.f15058c, q1.a.DATA_DISK_CACHE, this.f13785e); } c(List list, g gVar, f.a aVar) { this.f13784d = -1; this.f13781a = list; this.f13782b = gVar; this.f13783c = aVar; } }