package com.google.android.exoplayer2.source.hls;

import android.net.Uri;
import android.os.Handler;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistTracker;
import com.google.android.exoplayer2.upstream.Loader;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.C3430;
import p138.p176.p177.p190.p194.C3531;
import p138.p176.p177.p190.p194.InterfaceC3532;
import p138.p176.p177.p190.p216.C3777;
import p138.p176.p177.p190.p217.AbstractC3790;
import p138.p176.p177.p190.p217.C3794;
import p138.p176.p177.p190.p217.InterfaceC3798;
import p138.p176.p177.p190.p217.InterfaceC3800;
import p138.p176.p177.p190.p217.InterfaceC3803;
import p138.p176.p177.p190.p217.InterfaceC3808;
import p138.p176.p177.p190.p217.p222.C3895;
import p138.p176.p177.p190.p217.p222.C3909;
import p138.p176.p177.p190.p217.p222.C3911;
import p138.p176.p177.p190.p217.p222.InterfaceC3904;
import p138.p176.p177.p190.p217.p222.InterfaceC3905;
import p138.p176.p177.p190.p217.p222.p223.C3922;
import p138.p176.p177.p190.p217.p222.p223.C3923;
import p138.p176.p177.p190.p217.p222.p223.C3925;
import p138.p176.p177.p190.p217.p222.p223.InterfaceC3934;
import p138.p176.p177.p190.p238.C4108;
import p138.p176.p177.p190.p238.C4112;
import p138.p176.p177.p190.p238.InterfaceC4089;
import p138.p176.p177.p190.p238.InterfaceC4095;
import p138.p176.p177.p190.p238.InterfaceC4109;
import p138.p176.p177.p190.p238.InterfaceC4115;

/* JADX INFO: loaded from: classes.dex */
public final class HlsMediaSource extends AbstractC3790 implements HlsPlaylistTracker.InterfaceC0303 {

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final InterfaceC3905 f1807;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final Uri f1808;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final InterfaceC3904 f1809;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final C3794 f1810;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final InterfaceC3532<?> f1811;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final InterfaceC4109 f1812;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final boolean f1813;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public final int f1814;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public final boolean f1815;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public final HlsPlaylistTracker f1816;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public final Object f1817;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public InterfaceC4115 f1818;

    public static final class Factory implements InterfaceC3808 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final InterfaceC3904 f1819;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public InterfaceC3905 f1820;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public InterfaceC3934 f1821;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public List<C3777> f1822;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public HlsPlaylistTracker.InterfaceC0301 f1823;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public C3794 f1824;

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public InterfaceC3532<?> f1825;

        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public InterfaceC4109 f1826;

        /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
        public int f1827;

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public boolean f1828;

        public Factory(InterfaceC3904 interfaceC3904) {
            if (interfaceC3904 == null) {
                throw null;
            }
            this.f1819 = interfaceC3904;
            this.f1821 = new C3922();
            this.f1823 = C3923.f12201;
            this.f1820 = InterfaceC3905.f12071;
            this.f1825 = C3531.m5830();
            this.f1826 = new C4108();
            this.f1824 = new C3794();
            this.f1827 = 1;
        }

        public Factory(InterfaceC4095.InterfaceC4096 interfaceC4096) {
            this(new C3895(interfaceC4096));
        }

        public HlsMediaSource createMediaSource(Uri uri) {
            this.f1828 = true;
            List<C3777> list = this.f1822;
            if (list != null) {
                this.f1821 = new C3925(this.f1821, list);
            }
            InterfaceC3904 interfaceC3904 = this.f1819;
            InterfaceC3905 interfaceC3905 = this.f1820;
            C3794 c3794 = this.f1824;
            InterfaceC3532<?> interfaceC3532 = this.f1825;
            InterfaceC4109 interfaceC4109 = this.f1826;
            return new HlsMediaSource(uri, interfaceC3904, interfaceC3905, c3794, interfaceC3532, interfaceC4109, this.f1823.mo1236(interfaceC3904, interfaceC4109, this.f1821), false, this.f1827, false, null, null);
        }

        public Factory setStreamKeys(List<C3777> list) {
            C0567.m1932(!this.f1828);
            this.f1822 = list;
            return this;
        }

        /* JADX INFO: renamed from: setStreamKeys, reason: collision with other method in class */
        public /* bridge */ /* synthetic */ InterfaceC3808 m1235setStreamKeys(List list) {
            return setStreamKeys((List<C3777>) list);
        }
    }

    static {
        C3430.m5578("goog.exo.hls");
    }

    public /* synthetic */ HlsMediaSource(Uri uri, InterfaceC3904 interfaceC3904, InterfaceC3905 interfaceC3905, C3794 c3794, InterfaceC3532 interfaceC3532, InterfaceC4109 interfaceC4109, HlsPlaylistTracker hlsPlaylistTracker, boolean z, int i, boolean z2, Object obj, C0300 c0300) {
        this.f1808 = uri;
        this.f1809 = interfaceC3904;
        this.f1807 = interfaceC3905;
        this.f1810 = c3794;
        this.f1811 = interfaceC3532;
        this.f1812 = interfaceC4109;
        this.f1816 = hlsPlaylistTracker;
        this.f1813 = z;
        this.f1814 = i;
        this.f1815 = z2;
        this.f1817 = obj;
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3800
    /* JADX INFO: renamed from: ֏ */
    public InterfaceC3798 mo1209(InterfaceC3800.C3801 c3801, InterfaceC4089 interfaceC4089, long j) {
        return new C3909(this.f1807, this.f1816, this.f1809, this.f1818, this.f1811, this.f1812, m6096(c3801), interfaceC4089, this.f1810, this.f1813, this.f1814, this.f1815);
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3800
    /* JADX INFO: renamed from: ֏ */
    public void mo1210() throws IOException {
        C3923 c3923 = (C3923) this.f1816;
        Loader loader = c3923.f12210;
        if (loader != null) {
            loader.m1291(Integer.MIN_VALUE);
        }
        Uri uri = c3923.f12214;
        if (uri != null) {
            c3923.m6343(uri);
        }
    }

    @Override // p138.p176.p177.p190.p217.InterfaceC3800
    /* JADX INFO: renamed from: ֏ */
    public void mo1212(InterfaceC3798 interfaceC3798) {
        C3909 c3909 = (C3909) interfaceC3798;
        ((C3923) c3909.f12102).f12206.remove(c3909);
        for (C3911 c3911 : c3909.f12118) {
            if (c3911.f12152) {
                for (C3911.C3914 c3914 : c3911.f12144) {
                    c3914.m6205();
                }
            }
            c3911.f12133.m1292(c3911);
            c3911.f12141.removeCallbacksAndMessages(null);
            c3911.f12156 = true;
            c3911.f12142.clear();
        }
        c3909.f12115 = null;
        c3909.f12107.m6138();
    }

    @Override // p138.p176.p177.p190.p217.AbstractC3790
    /* JADX INFO: renamed from: ֏ */
    public void mo1215(InterfaceC4115 interfaceC4115) {
        this.f1818 = interfaceC4115;
        this.f1811.mo1129();
        InterfaceC3803.C3804 c3804M6096 = m6096((InterfaceC3800.C3801) null);
        HlsPlaylistTracker hlsPlaylistTracker = this.f1816;
        Uri uri = this.f1808;
        C3923 c3923 = (C3923) hlsPlaylistTracker;
        if (c3923 == null) {
            throw null;
        }
        c3923.f12211 = new Handler();
        c3923.f12209 = c3804M6096;
        c3923.f12212 = this;
        C4112 c4112 = new C4112(c3923.f12202.mo6300(4), uri, 4, c3923.f12203.mo6336());
        C0567.m1932(c3923.f12210 == null);
        Loader loader = new Loader("DefaultHlsPlaylistTracker:MasterPlaylist");
        c3923.f12210 = loader;
        c3804M6096.m6133(c4112.f13153, c4112.f13154, loader.m1290(c4112, c3923, c3923.f12204.mo6614(c4112.f13154)));
    }

    @Override // p138.p176.p177.p190.p217.AbstractC3790
    /* JADX INFO: renamed from: ؠ */
    public void mo1217() {
        C3923 c3923 = (C3923) this.f1816;
        c3923.f12214 = null;
        c3923.f12215 = null;
        c3923.f12213 = null;
        c3923.f12217 = -9223372036854775807L;
        c3923.f12210.m1292((Loader.InterfaceC0323) null);
        c3923.f12210 = null;
        Iterator<C3923.RunnableC3924> it = c3923.f12205.values().iterator();
        while (it.hasNext()) {
            it.next().f12219.m1292((Loader.InterfaceC0323) null);
        }
        c3923.f12211.removeCallbacksAndMessages(null);
        c3923.f12211 = null;
        c3923.f12205.clear();
        this.f1811.mo1126();
    }
}
