package defpackage;

import android.os.SystemClock;
import android.os.Trace;

/* JADX INFO: renamed from: ᵨᵠـ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3755 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C3560 f14271;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public long f14272;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public long f14275;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public long f14276;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C0767 f14277;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public final C3449 f14278;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public C2763 f14279;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public long f14281;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public final C2608 f14282;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final C3442 f14273 = new C3442();

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C0760 f14280 = new C0760();

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final C0760 f14274 = new C0760();

    public C3755(C0767 c0767, C3560 c3560, C3449 c3449) {
        this.f14277 = c0767;
        this.f14271 = c3560;
        this.f14278 = c3449;
        C2608 c2608 = new C2608();
        int iHighestOneBit = Integer.bitCount(16) != 1 ? Integer.highestOneBit(15) << 1 : 16;
        c2608.f10115 = 0;
        c2608.f10117 = -1;
        c2608.f10116 = 0;
        c2608.f10119 = new long[iHighestOneBit];
        c2608.f10118 = iHighestOneBit - 1;
        this.f14282 = c2608;
        this.f14272 = -9223372036854775807L;
        this.f14279 = C2763.f10620;
        this.f14281 = -9223372036854775807L;
        this.f14276 = -9223372036854775807L;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m8415(long j, long j2) {
        final C0767 c0767 = this.f14277;
        C4178 c4178 = (C4178) c0767.f3432;
        while (true) {
            C2608 c2608 = this.f14282;
            int i = c2608.f10116;
            if (i == 0) {
                return;
            }
            if (i == 0) {
                C4468.m9518();
                return;
            }
            long j3 = ((long[]) c2608.f10119)[c2608.f10115];
            Long l = (Long) this.f14274.m2728(j3);
            C3560 c3560 = this.f14271;
            if (l != null && l.longValue() != this.f14275) {
                this.f14275 = l.longValue();
                c3560.m8074(2);
            }
            long j4 = this.f14275;
            C3560 c35602 = this.f14271;
            C3442 c3442 = this.f14273;
            int iM8075 = c35602.m8075(j3, j, j2, j4, false, false, c3442);
            if (iM8075 != 5 && iM8075 != 4) {
                this.f14278.m7863(j3, c3442.f13274);
            }
            final int i2 = 0;
            if (iM8075 == 0 || iM8075 == 1) {
                this.f14281 = j3;
                boolean z = iM8075 == 0;
                long jM6325 = c2608.m6325();
                C2763 c2763 = (C2763) this.f14280.m2728(jM6325);
                if (c2763 != null && !c2763.equals(C2763.f10620) && !c2763.equals(this.f14279)) {
                    this.f14279 = c2763;
                    C4753 c4753 = new C4753();
                    c4753.f18098 = c2763.f10623;
                    c4753.f18102 = c2763.f10621;
                    c4753.f18101 = AbstractC4208.m9132("video/raw");
                    c0767.f3433 = new C5286(c4753);
                    c4178.f15944.execute(new RunnableC4076(c0767, 23, c2763));
                }
                long jNanoTime = z ? System.nanoTime() : c3442.f13273;
                i = c3560.f13636 == 3 ? 0 : 1;
                c3560.f13636 = 3;
                c3560.f13638.getClass();
                c3560.f13641 = AbstractC0956.m3214(SystemClock.elapsedRealtime());
                if (i != 0 && c4178.f15939 != null) {
                    c4178.f15944.execute(new Runnable() { // from class: ᵜᵾˌᵭ
                        @Override // java.lang.Runnable
                        public final void run() {
                            int i3 = i2;
                            C0767 c07672 = c0767;
                            switch (i3) {
                                case 0:
                                    ((C4178) c07672.f3432).f15937.m6115();
                                    break;
                                default:
                                    ((C4178) c07672.f3432).f15937.m6113();
                                    break;
                            }
                        }
                    });
                }
                C5286 c5286 = (C5286) c0767.f3433;
                c4178.f15940.mo2568(jM6325, jNanoTime, c5286 == null ? new C5286(new C4753()) : c5286, null);
                C4007 c4007 = (C4007) c4178.f15943.remove();
                c4007.f15386.ᵰʜ(c4007.f15387, c4007.f15385, jNanoTime);
            } else if (iM8075 == 2 || iM8075 == 3) {
                this.f14281 = j3;
                c2608.m6325();
                c4178.f15944.execute(new Runnable() { // from class: ᵜᵾˌᵭ
                    @Override // java.lang.Runnable
                    public final void run() {
                        int i3 = i;
                        C0767 c07672 = c0767;
                        switch (i3) {
                            case 0:
                                ((C4178) c07672.f3432).f15937.m6115();
                                break;
                            default:
                                ((C4178) c07672.f3432).f15937.m6113();
                                break;
                        }
                    }
                });
                C4007 c40072 = (C4007) c4178.f15943.remove();
                ᵦʝᵛᵤ r4 = c40072.f15386;
                InterfaceC1595 interfaceC1595 = c40072.f15387;
                int i3 = c40072.f15385;
                Trace.beginSection("dropVideoBuffer");
                interfaceC1595.mo3045(i3);
                Trace.endSection();
                r4.ᵔﹳ(0, 1);
            } else {
                if (iM8075 != 4) {
                    if (iM8075 == 5) {
                        return;
                    }
                    ᵕᵩʽᵲ.ᵪᵹᵥᵻ(String.valueOf(iM8075));
                    return;
                }
                this.f14281 = j3;
            }
        }
    }
}
