package defpackage;

import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.SparseArray;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* renamed from: ᵾᵬˋᵠ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5445 extends AbstractC3587 {

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public long f20429;

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public final Uri f20430;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public final RunnableC1048 f20431;

    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    public final long f20432;

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public int f20433;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final RunnableC1048 f20434;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public C3873 f20435;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public C5361 f20436;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final SparseArray f20437;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final InterfaceC4619 f20438;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public long f20439;

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final C4782 f20440;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public IOException f20441;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final Object f20442;

    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    public final InterfaceC1731 f20443;

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final ᵮᵥٴ f20444;

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final InterfaceC4068 f20445;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public final C4288 f20446;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public long f20447;

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final boolean f20448;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final ˊᵘʛ f20449;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public ᵧˉʙ f20450;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public C0112 f20451;

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public long f20452;

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final InterfaceC0687 f20453;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public Handler f20454;

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final ˉːᵡ f20455;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public InterfaceC2569 f20456;

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final long f20457;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public boolean f20458;

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public final C1899 f20459;

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public int f20460;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public Uri f20461;

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public C0346 f20462;

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final C4782 f20463;

    static {
        AbstractC2483.m6325("media3.exoplayer.dash");
    }

    /* JADX WARN: Type inference failed for: r2v10, types: [ˈː] */
    /* JADX WARN: Type inference failed for: r2v11, types: [ˈː] */
    public C5445(C0346 c0346, InterfaceC1731 interfaceC1731, InterfaceC4068 interfaceC4068, C4782 c4782, ˉːᵡ r6, InterfaceC0687 interfaceC0687, C1899 c1899, long j, long j2) {
        this.f20462 = c0346;
        this.f20451 = c0346.f2061;
        C4962 c4962 = c0346.f2063;
        c4962.getClass();
        Uri uri = c4962.f18441;
        this.f20461 = uri;
        this.f20430 = uri;
        this.f20436 = null;
        this.f20443 = interfaceC1731;
        this.f20445 = interfaceC4068;
        this.f20440 = c4782;
        this.f20453 = interfaceC0687;
        this.f20459 = c1899;
        this.f20457 = j;
        this.f20432 = j2;
        this.f20455 = r6;
        this.f20444 = new ᵮᵥٴ(6);
        final int i = 0;
        this.f20448 = false;
        this.f20463 = m8200(null);
        this.f20442 = new Object();
        this.f20437 = new SparseArray();
        this.f20446 = new C4288(this);
        this.f20452 = -9223372036854775807L;
        this.f20429 = -9223372036854775807L;
        this.f20449 = new ˊᵘʛ(18, this);
        this.f20438 = new C2040(this);
        this.f20431 = new Runnable(this) { // from class: ˈː

            /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
            public final /* synthetic */ C5445 f4564;

            {
                this.f4564 = this;
            }

            @Override // java.lang.Runnable
            public final void run() {
                int i2 = i;
                C5445 c5445 = this.f4564;
                switch (i2) {
                    case 0:
                        c5445.m11090();
                        break;
                    default:
                        try {
                            c5445.m11087(false);
                            break;
                        } catch (Exception e) {
                            c5445.f20441 = new IOException(e);
                        }
                }
            }
        };
        final int i2 = 1;
        this.f20434 = new Runnable(this) { // from class: ˈː

            /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
            public final /* synthetic */ C5445 f4564;

            {
                this.f4564 = this;
            }

            @Override // java.lang.Runnable
            public final void run() {
                int i22 = i2;
                C5445 c5445 = this.f4564;
                switch (i22) {
                    case 0:
                        c5445.m11090();
                        break;
                    default:
                        try {
                            c5445.m11087(false);
                            break;
                        } catch (Exception e) {
                            c5445.f20441 = new IOException(e);
                        }
                }
            }
        };
    }

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static boolean m11084(C1689 c1689) {
        List list = c1689.f6729;
        for (int i = 0; i < list.size(); i++) {
            int i2 = ((C1168) list.get(i)).f4964;
            if (i2 == 1 || i2 == 2) {
                return true;
            }
        }
        return false;
    }

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public final void m11085(C3934 c3934, long j, long j2) {
        long j3 = c3934.f14854;
        C4179 c4179 = c3934.f14852;
        C0186 c0186 = c3934.f14855;
        C0417 c0417 = new C0417(c4179, c0186.f1631, c0186.f1630, j, j2, c0186.f1628);
        this.f20459.getClass();
        this.f20463.m10086(c0417, c3934.f14856, -1, null, 0, null, -9223372036854775807L, -9223372036854775807L);
    }

    @Override // defpackage.InterfaceC4865
    /* renamed from: ˎˏʜʾ */
    public final InterfaceC3757 mo2928(C2477 c2477, ᵧˉʙ r24, long j) {
        int iIntValue = ((Integer) c2477.f9683).intValue() - this.f20433;
        C4782 c4782M8200 = m8200(c2477);
        C2221 c2221 = new C2221(this.f13402.f8731, 0, c2477);
        int i = this.f20433 + iIntValue;
        C5361 c5361 = this.f20436;
        C3873 c3873 = this.f20435;
        long j2 = this.f20429;
        C1545 c1545 = this.f13397;
        c1545.getClass();
        C2798 c2798 = new C2798(i, c5361, this.f20444, iIntValue, this.f20440, c3873, this.f20453, c2221, this.f20459, c4782M8200, j2, this.f20438, r24, this.f20455, this.f20446, c1545);
        this.f20437.put(i, c2798);
        return c2798;
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final void m11086(C1646 c1646, InterfaceC4068 interfaceC4068) {
        InterfaceC2569 interfaceC2569 = this.f20456;
        Uri uri = Uri.parse(c1646.f6571);
        Map map = Collections.EMPTY_MAP;
        ᵛᵾˏ.ᵨᵳʝ(uri, "The uri must be set.");
        this.f20450.ᵡᵘˎʽ(new C3934(interfaceC2569, new C4179(uri, 1, null, map, 0L, -1L, null, 1), 5, interfaceC4068), new C4288(this), 1);
    }

    /* JADX WARN: Code restructure failed: missing block: B:72:0x01a0, code lost:
    
        r14 = r14;
     */
    /* JADX WARN: Removed duplicated region for block: B:118:0x028e  */
    /* JADX WARN: Removed duplicated region for block: B:133:0x02d6  */
    /* JADX WARN: Removed duplicated region for block: B:166:0x0340  */
    /* JADX WARN: Removed duplicated region for block: B:203:0x03ec  */
    /* JADX WARN: Removed duplicated region for block: B:205:0x03f3  */
    /* renamed from: ˑᵥˁ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m11087(boolean r43) {
        /*
            Method dump skipped, instructions count: 1299
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C5445.m11087(boolean):void");
    }

    @Override // defpackage.AbstractC3587
    /* renamed from: ˑᵱ */
    public final void mo2929(C3873 c3873) {
        this.f20435 = c3873;
        Looper looperMyLooper = Looper.myLooper();
        C1545 c1545 = this.f13397;
        c1545.getClass();
        InterfaceC0687 interfaceC0687 = this.f20453;
        interfaceC0687.mo2673(looperMyLooper, c1545);
        interfaceC0687.mo2670();
        if (this.f20448) {
            m11087(false);
            return;
        }
        this.f20456 = this.f20443.mo4930();
        this.f20450 = new ᵧˉʙ(2, "DashMediaSource");
        this.f20454 = AbstractC3558.m8130(null);
        m11090();
    }

    /* renamed from: ᵡˎ, reason: contains not printable characters */
    public final void m11088(IOException iOException) {
        ᵳʿˉ.ᵸˑ("Failed to resolve time offset.", iOException);
        this.f20429 = System.currentTimeMillis() - SystemClock.elapsedRealtime();
        m11087(true);
    }

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public final void m11089() {
        boolean z;
        ᵧˉʙ r0 = this.f20450;
        C2040 c2040 = new C2040(this);
        synchronized (ʼٴ.ᵻᵢﹳᵰ) {
            z = ʼٴ.ˇʼʤˎ;
        }
        if (z) {
            c2040.m5626();
            return;
        }
        if (r0 == null) {
            r0 = new ᵧˉʙ(2, "SntpClient");
        }
        r0.ᵡᵘˎʽ(new ᵺᐧʝ(8), new ˊʘ(22, c2040), 1);
    }

    @Override // defpackage.AbstractC3587
    /* renamed from: ᵢˇᵭ */
    public final void mo2930() {
        this.f20458 = false;
        this.f20456 = null;
        ᵧˉʙ r2 = this.f20450;
        if (r2 != null) {
            r2.ˁˑᵰ((InterfaceC2428) null);
            this.f20450 = null;
        }
        C0112 c0112 = mo2934().f2061;
        synchronized (this) {
            this.f20451 = c0112;
        }
        this.f20439 = 0L;
        this.f20447 = 0L;
        this.f20461 = this.f20430;
        this.f20441 = null;
        Handler handler = this.f20454;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
            this.f20454 = null;
        }
        this.f20429 = -9223372036854775807L;
        this.f20460 = 0;
        this.f20452 = -9223372036854775807L;
        this.f20437.clear();
        ᵮᵥٴ r0 = this.f20444;
        ((HashMap) r0.ᵢˇᵭ).clear();
        ((HashMap) r0.ᵿʗᵝʽ).clear();
        ((HashMap) r0.ᵾᵬ).clear();
        this.f20453.mo2672();
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public final void m11090() {
        Uri uri;
        this.f20454.removeCallbacks(this.f20431);
        if (this.f20450.ˎˑː()) {
            return;
        }
        if (this.f20450.ᵧـˌᵎ()) {
            this.f20458 = true;
            return;
        }
        synchronized (this.f20442) {
            uri = this.f20461;
        }
        this.f20458 = false;
        Map map = Collections.EMPTY_MAP;
        ᵛᵾˏ.ᵨᵳʝ(uri, "The uri must be set.");
        C3934 c3934 = new C3934(this.f20456, new C4179(uri, 1, null, map, 0L, -1L, null, 1), 4, this.f20445);
        ˊᵘʛ r1 = this.f20449;
        this.f20459.getClass();
        this.f20450.ᵡᵘˎʽ(c3934, r1, 3);
    }

    @Override // defpackage.InterfaceC4865
    /* renamed from: ᵪʩ */
    public final synchronized void mo2931(C0346 c0346) {
        this.f20462 = c0346;
        this.f20451 = c0346.f2061;
    }

    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    public final synchronized void m11091(C0112 c0112) {
        this.f20451 = c0112;
    }

    @Override // defpackage.InterfaceC4865
    /* renamed from: ᵳٴᵶ */
    public final void mo2932(InterfaceC3757 interfaceC3757) {
        C2798 c2798 = (C2798) interfaceC3757;
        C0831 c0831 = c2798.f10797;
        c0831.f3827 = true;
        c0831.f3833.removeCallbacksAndMessages(null);
        for (C3341 c3341 : c2798.f10784) {
            c3341.m7734(c2798);
        }
        c2798.f10800 = null;
        this.f20437.remove(c2798.f10793);
    }

    @Override // defpackage.InterfaceC4865
    /* renamed from: ᵸˑ */
    public final void mo2933() {
        this.f20438.mo5627();
    }

    @Override // defpackage.InterfaceC4865
    /* renamed from: ᵹᵝᵶ */
    public final synchronized C0346 mo2934() {
        return this.f20462;
    }

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final synchronized C0112 m11092() {
        return this.f20451;
    }
}
