package defpackage;

import androidx.media3.common.ParserException;
import androidx.media3.exoplayer.smoothstreaming.manifest.SsManifestParser$MissingFieldException;
import java.math.RoundingMode;
import java.util.LinkedList;
import org.xmlpull.v1.XmlPullParser;

/* renamed from: ᵥˑᵮ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3510 extends AbstractC1663 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final LinkedList f13160;

    /* renamed from: ˌᵜᵹᵩ, reason: contains not printable characters */
    public boolean f13161;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public int f13162;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public int f13163;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public long f13164;

    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public C4190 f13165;

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public long f13166;

    /* renamed from: ᵸˑ, reason: contains not printable characters */
    public int f13167;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public long f13168;

    public C3510(String str) {
        super(null, str, "SmoothStreamingMedia");
        this.f13167 = -1;
        this.f13165 = null;
        this.f13160 = new LinkedList();
    }

    @Override // defpackage.AbstractC1663
    /* renamed from: ᵥᵯˎ */
    public final void mo2323(Object obj) {
        if (obj instanceof C5300) {
            this.f13160.add((C5300) obj);
        } else if (obj instanceof C4190) {
            ᵛᵾˏ.ᵿʗᵝʽ(this.f13165 == null);
            this.f13165 = (C4190) obj;
        }
    }

    @Override // defpackage.AbstractC1663
    /* renamed from: ᵴᵳ */
    public final Object mo2324() {
        long jM8115;
        LinkedList linkedList = this.f13160;
        int size = linkedList.size();
        C5300[] c5300Arr = new C5300[size];
        linkedList.toArray(c5300Arr);
        C4190 c4190 = this.f13165;
        if (c4190 != null) {
            C2119 c2119 = new C2119(new C1542(c4190.f15664, null, "video/mp4", c4190.f15665));
            for (int i = 0; i < size; i++) {
                C5300 c5300 = c5300Arr[i];
                int i2 = c5300.f19830;
                if (i2 == 2 || i2 == 1) {
                    C3446[] c3446Arr = c5300.f19835;
                    for (int i3 = 0; i3 < c3446Arr.length; i3++) {
                        C2153 c2153M7829 = c3446Arr[i3].m7829();
                        c2153M7829.f8523 = c2119;
                        c3446Arr[i3] = new C3446(c2153M7829);
                    }
                }
            }
        }
        int i4 = this.f13163;
        int i5 = this.f13162;
        long j = this.f13168;
        long j2 = this.f13164;
        long j3 = this.f13166;
        int i6 = this.f13167;
        boolean z = this.f13161;
        C4190 c41902 = this.f13165;
        long jM81152 = -9223372036854775807L;
        if (j2 == 0) {
            jM8115 = -9223372036854775807L;
        } else {
            String str = AbstractC3558.f13329;
            jM8115 = AbstractC3558.m8115(j2, 1000000L, j, RoundingMode.DOWN);
        }
        if (j3 != 0) {
            String str2 = AbstractC3558.f13329;
            jM81152 = AbstractC3558.m8115(j3, 1000000L, j, RoundingMode.DOWN);
        }
        return new C1374(i4, i5, jM8115, jM81152, i6, z, c41902, c5300Arr);
    }

    @Override // defpackage.AbstractC1663
    /* renamed from: ᵶᵷᵕ */
    public final void mo2325(XmlPullParser xmlPullParser) throws ParserException {
        this.f13163 = AbstractC1663.m4749(xmlPullParser, "MajorVersion");
        this.f13162 = AbstractC1663.m4749(xmlPullParser, "MinorVersion");
        this.f13168 = AbstractC1663.m4750(xmlPullParser, "TimeScale", 10000000L);
        String attributeValue = xmlPullParser.getAttributeValue(null, "Duration");
        if (attributeValue == null) {
            throw new SsManifestParser$MissingFieldException("Duration");
        }
        try {
            this.f13164 = Long.parseLong(attributeValue);
            this.f13166 = AbstractC1663.m4750(xmlPullParser, "DVRWindowLength", 0L);
            this.f13167 = AbstractC1663.m4748(xmlPullParser, "LookaheadCount");
            String attributeValue2 = xmlPullParser.getAttributeValue(null, "IsLive");
            this.f13161 = attributeValue2 != null ? Boolean.parseBoolean(attributeValue2) : false;
            m4752(Long.valueOf(this.f13168), "TimeScale");
        } catch (NumberFormatException e) {
            throw ParserException.m357(null, e);
        }
    }
}
