package Y;

import I.g;
import I.h;
import Y.a;
import android.graphics.Bitmap;
import b0.AbstractC0399d;
import b0.D;
import b0.o;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class b implements g {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final long f1828a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final long[] f1829b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final long[] f1830c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final a.C0045a f1831d;

    public b(a.C0045a c0045a) {
        this.f1828a = c0045a.f1822c;
        long[] jArr = {c0045a.f1820a, c0045a.f1821b};
        this.f1829b = jArr;
        long[] jArrCopyOf = Arrays.copyOf(jArr, 2);
        this.f1830c = jArrCopyOf;
        this.f1831d = c0045a;
        Arrays.sort(jArrCopyOf);
    }

    @Override // I.g
    public int a(long j2) {
        AbstractC0399d.a(j2 >= 0);
        int iB = D.b(this.f1830c, j2, false, false);
        if (iB < this.f1830c.length) {
            return iB;
        }
        return -1;
    }

    @Override // I.g
    public long b(int i2) {
        AbstractC0399d.a(i2 >= 0);
        AbstractC0399d.a(i2 < this.f1830c.length);
        return this.f1830c[i2];
    }

    @Override // I.g
    public List c(long j2) {
        long[] jArr = this.f1829b;
        Bitmap bitmapA = (jArr[0] > j2 || j2 >= jArr[1]) ? null : this.f1831d.a();
        o.d("InternalVobSubSubtitle", "getData timeUs = " + j2 + " data = " + bitmapA, 16);
        if (bitmapA == null) {
            return Collections.emptyList();
        }
        h.a(bitmapA, j2, 0);
        return Collections.singletonList(new I.c(bitmapA));
    }

    @Override // I.g
    public int d() {
        return this.f1830c.length;
    }
}
