package p;

import com.mstar.android.tvapi.common.AudioManager;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public interface k {

    public static final class a implements k {

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private final int f6176b;

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

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

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

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final float f6180f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private boolean f6181g;

        public a(a0.d dVar) {
            this(dVar, AudioManager.E_ATVPLAYER_AUTO_TUNING_RECEIVE_EVENT_INTERVAL, 10000, 25000, 25000, 0.75f);
        }

        private j d(j[] jVarArr, long j2) {
            long j3 = j2 == -1 ? this.f6176b : (long) (j2 * this.f6180f);
            for (j jVar : jVarArr) {
                if (jVar.f6167c <= j3) {
                    return jVar;
                }
            }
            return jVarArr[jVarArr.length - 1];
        }

        private j f(j[] jVarArr, j jVar, j jVar2) {
            int i2 = 0;
            int i3 = 0;
            for (int i4 = 0; i4 < jVarArr.length; i4++) {
                int i5 = jVarArr[i4].f6167c;
                if (i5 == jVar2.f6167c) {
                    i3 = i4;
                }
                if (i5 == jVar.f6167c) {
                    i2 = i4;
                }
            }
            return i2 - i3 >= 2 ? jVarArr[i2 - 2] : jVar2;
        }

        /* JADX WARN: Removed duplicated region for block: B:45:0x0091  */
        @Override // p.k
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public void a(java.util.List r10, long r11, p.j[] r13, p.k.b r14) {
            /*
                r9 = this;
                boolean r0 = r10.isEmpty()
                r1 = 1
                if (r0 == 0) goto La
                r2 = 0
                goto L18
            La:
                int r0 = r10.size()
                int r0 = r0 - r1
                java.lang.Object r0 = r10.get(r0)
                p.n r0 = (p.n) r0
                long r2 = r0.f6194h
                long r2 = r2 - r11
            L18:
                p.j r0 = r14.f6184c
                a0.d r4 = r9.f6175a
                long r4 = r4.d()
                p.j r4 = r9.d(r13, r4)
                r5 = 0
                if (r4 == 0) goto L31
                if (r0 == 0) goto L31
                int r6 = r4.f6167c
                int r7 = r0.f6167c
                if (r6 <= r7) goto L31
                r6 = r1
                goto L32
            L31:
                r6 = r5
            L32:
                if (r4 == 0) goto L3d
                if (r0 == 0) goto L3d
                int r7 = r4.f6167c
                int r8 = r0.f6167c
                if (r7 >= r8) goto L3d
                r5 = r1
            L3d:
                if (r6 == 0) goto L87
                boolean r5 = r9.f6181g
                if (r5 == 0) goto L47
                p.j r4 = r9.f(r13, r0, r4)
            L47:
                long r5 = r9.f6177c
                int r13 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))
                if (r13 >= 0) goto L4e
                goto L91
            L4e:
                long r5 = r9.f6179e
                int r13 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))
                if (r13 < 0) goto L92
            L54:
                int r13 = r10.size()
                if (r1 >= r13) goto L92
                java.lang.Object r13 = r10.get(r1)
                p.n r13 = (p.n) r13
                long r2 = r13.f6193g
                long r2 = r2 - r11
                long r5 = r9.f6179e
                int r2 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1))
                if (r2 < 0) goto L84
                p.j r13 = r13.f6088c
                int r2 = r13.f6167c
                int r3 = r4.f6167c
                if (r2 >= r3) goto L84
                int r2 = r13.f6169e
                int r3 = r4.f6169e
                if (r2 >= r3) goto L84
                r3 = 720(0x2d0, float:1.009E-42)
                if (r2 >= r3) goto L84
                int r13 = r13.f6168d
                r2 = 1280(0x500, float:1.794E-42)
                if (r13 >= r2) goto L84
                r14.f6182a = r1
                goto L92
            L84:
                int r1 = r1 + 1
                goto L54
            L87:
                if (r5 == 0) goto L92
                if (r0 == 0) goto L92
                long r10 = r9.f6178d
                int r10 = (r2 > r10 ? 1 : (r2 == r10 ? 0 : -1))
                if (r10 < 0) goto L92
            L91:
                r4 = r0
            L92:
                if (r0 == 0) goto L99
                if (r4 == r0) goto L99
                r10 = 3
                r14.f6183b = r10
            L99:
                r14.f6184c = r4
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: p.k.a.a(java.util.List, long, p.j[], p.k$b):void");
        }

        @Override // p.k
        public void b() {
        }

        @Override // p.k
        public void c() {
        }

        public void e(boolean z2) {
            this.f6181g = z2;
        }

        public a(a0.d dVar, int i2, int i3, int i4, int i5, float f2) {
            this.f6175a = dVar;
            this.f6176b = i2;
            this.f6177c = ((long) i3) * 1000;
            this.f6178d = ((long) i4) * 1000;
            this.f6179e = ((long) i5) * 1000;
            this.f6180f = f2;
            this.f6181g = false;
        }
    }

    public static final class b {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public int f6182a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public int f6183b = 1;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public j f6184c;
    }

    void a(List list, long j2, j[] jVarArr, b bVar);

    void b();

    void c();
}
