91暗网 v2.032版本的 MD5 值为:84da7129e49fe272376e741e6f3c5975

以下内容为反编译后的 c.java 源代码,内容仅作参考


package g.h.a.a.k1.l0.k;

import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Pair;
import android.util.Xml;
import androidx.annotation.Nullable;
import androidx.exifinterface.media.ExifInterface;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.metadata.emsg.EventMessage;
import com.google.android.material.shadow.ShadowDrawableWrapper;
import g.h.a.a.k1.l0.k.i;
import g.h.a.a.k1.l0.k.j;
import g.h.a.a.l0;
import g.h.a.a.o1.c0;
import g.h.a.a.p1.d0;
import g.h.a.a.p1.q;
import g.h.a.a.v;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.xml.sax.helpers.DefaultHandler;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
public class c extends DefaultHandler implements c0.a<b> {
    public static final Pattern b = Pattern.compile("(\\d+)(?:/(\\d+))?");
    public static final Pattern c = Pattern.compile("CC([1-4])=.*");
    public static final Pattern f3495d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
    public final XmlPullParserFactory a;

    public static final class a {
        public final Format a;
        public final String b;
        public final j c;
        @Nullable
        public final String f3496d;
        public final ArrayList<DrmInitData.SchemeData> f3497e;
        public final ArrayList<d> f3498f;
        public final long f3499g;

        public a(Format format, String str, j jVar, @Nullable String str2, ArrayList<DrmInitData.SchemeData> arrayList, ArrayList<d> arrayList2, long j2) {
            this.a = format;
            this.b = str;
            this.c = jVar;
            this.f3496d = str2;
            this.f3497e = arrayList;
            this.f3498f = arrayList2;
            this.f3499g = j2;
        }
    }

    public c() {
        try {
            this.a = XmlPullParserFactory.newInstance();
        } catch (XmlPullParserException e2) {
            throw new RuntimeException("Couldn't create XmlPullParserFactory instance", e2);
        }
    }

    public static int c(int i2, int i3) {
        if (i2 == -1) {
            return i3;
        }
        if (i3 == -1) {
            return i2;
        }
        g.h.a.a.p1.e.w(i2 == i3);
        return i2;
    }

    public static void d(XmlPullParser xmlPullParser) {
        if (g.h.a.a.p1.e.v0(xmlPullParser)) {
            int i2 = 1;
            while (i2 != 0) {
                xmlPullParser.next();
                if (g.h.a.a.p1.e.v0(xmlPullParser)) {
                    i2++;
                } else {
                    if (xmlPullParser.getEventType() == 3) {
                        i2--;
                    }
                }
            }
        }
    }

    public static boolean e(@Nullable String str) {
        return q.i(str) || "application/ttml+xml".equals(str) || "application/x-mp4-vtt".equals(str) || "application/cea-708".equals(str) || "application/cea-608".equals(str);
    }

    public static d k(XmlPullParser xmlPullParser, String str) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
        if (attributeValue == null) {
            attributeValue = "";
        }
        String attributeValue2 = xmlPullParser.getAttributeValue(null, "value");
        if (attributeValue2 == null) {
            attributeValue2 = null;
        }
        String attributeValue3 = xmlPullParser.getAttributeValue(null, "id");
        String str2 = attributeValue3 != null ? attributeValue3 : null;
        do {
            xmlPullParser.next();
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, str));
        return new d(attributeValue, attributeValue2, str2);
    }

    public static long l(XmlPullParser xmlPullParser, String str, long j2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        if (attributeValue == null) {
            return j2;
        }
        Matcher matcher = d0.f4128h.matcher(attributeValue);
        if (matcher.matches()) {
            boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1));
            String group = matcher.group(3);
            double d2 = ShadowDrawableWrapper.COS_45;
            double parseDouble = group != null ? Double.parseDouble(group) * 3.1556908E7d : 0.0d;
            String group2 = matcher.group(5);
            double parseDouble2 = parseDouble + (group2 != null ? Double.parseDouble(group2) * 2629739.0d : 0.0d);
            String group3 = matcher.group(7);
            double parseDouble3 = parseDouble2 + (group3 != null ? Double.parseDouble(group3) * 86400.0d : 0.0d);
            String group4 = matcher.group(10);
            double parseDouble4 = parseDouble3 + (group4 != null ? Double.parseDouble(group4) * 3600.0d : 0.0d);
            String group5 = matcher.group(12);
            double parseDouble5 = parseDouble4 + (group5 != null ? Double.parseDouble(group5) * 60.0d : 0.0d);
            String group6 = matcher.group(14);
            if (group6 != null) {
                d2 = Double.parseDouble(group6);
            }
            long j3 = (long) ((parseDouble5 + d2) * 1000.0d);
            return isEmpty ? -j3 : j3;
        }
        return (long) (Double.parseDouble(attributeValue) * 3600.0d * 1000.0d);
    }

    public static float m(XmlPullParser xmlPullParser, float f2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "frameRate");
        if (attributeValue != null) {
            Matcher matcher = b.matcher(attributeValue);
            if (matcher.matches()) {
                int parseInt = Integer.parseInt(matcher.group(1));
                String group = matcher.group(2);
                return !TextUtils.isEmpty(group) ? parseInt / Integer.parseInt(group) : parseInt;
            }
            return f2;
        }
        return f2;
    }

    public static int n(XmlPullParser xmlPullParser, String str, int i2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? i2 : Integer.parseInt(attributeValue);
    }

    public static long o(XmlPullParser xmlPullParser, String str, long j2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j2 : Long.parseLong(attributeValue);
    }

    public static String v(XmlPullParser xmlPullParser, String str) {
        String str2 = "";
        do {
            xmlPullParser.next();
            if (xmlPullParser.getEventType() == 4) {
                str2 = xmlPullParser.getText();
            } else {
                d(xmlPullParser);
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, str));
        return str2;
    }

    @Override
    public b a(Uri uri, InputStream inputStream) {
        try {
            XmlPullParser newPullParser = this.a.newPullParser();
            newPullParser.setInput(inputStream, null);
            if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
                return p(newPullParser, uri.toString());
            }
            throw new l0("inputStream does not contain a valid media presentation description");
        } catch (XmlPullParserException e2) {
            throw new l0(e2);
        }
    }

    public final long b(List<j.d> list, long j2, long j3, int i2, long j4) {
        int i3;
        if (i2 >= 0) {
            i3 = i2 + 1;
        } else {
            int i4 = d0.a;
            i3 = (int) ((((j4 - j2) + j3) - 1) / j3);
        }
        for (int i5 = 0; i5 < i3; i5++) {
            list.add(new j.d(j2, j3));
            j2 += j3;
        }
        return j2;
    }

    public int f(XmlPullParser xmlPullParser) {
        String L;
        char c2;
        String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
        if (attributeValue == null) {
            attributeValue = null;
        }
        int i2 = -1;
        if ("urn:mpeg:dash:23003:3:audio_channel_configuration:2011".equals(attributeValue)) {
            i2 = n(xmlPullParser, "value", -1);
        } else if (("tag:dolby.com,2014:dash:audio_channel_configuration:2011".equals(attributeValue) || "urn:dolby:dash:audio_channel_configuration:2011".equals(attributeValue)) && (L = d0.L(xmlPullParser.getAttributeValue(null, "value"))) != null) {
            switch (L.hashCode()) {
                case 1596796:
                    if (L.equals("4000")) {
                        c2 = 0;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 2937391:
                    if (L.equals("a000")) {
                        c2 = 1;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 3094035:
                    if (L.equals("f801")) {
                        c2 = 2;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 3133436:
                    if (L.equals("fa01")) {
                        c2 = 3;
                        break;
                    }
                    c2 = 65535;
                    break;
                default:
                    c2 = 65535;
                    break;
            }
            if (c2 == 0) {
                i2 = 1;
            } else if (c2 == 1) {
                i2 = 2;
            } else if (c2 == 2) {
                i2 = 6;
            } else if (c2 == 3) {
                i2 = 8;
            }
        }
        do {
            xmlPullParser.next();
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "AudioChannelConfiguration"));
        return i2;
    }

    public String g(XmlPullParser xmlPullParser, String str) {
        return g.h.a.a.p1.e.O0(str, v(xmlPullParser, "BaseURL"));
    }

    public Pair<String, DrmInitData.SchemeData> h(XmlPullParser xmlPullParser) {
        String str;
        UUID uuid;
        byte[] bArr;
        String str2;
        boolean z;
        UUID V;
        char c2;
        UUID uuid2;
        String str3;
        String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
        if (attributeValue != null) {
            String L = d0.L(attributeValue);
            L.hashCode();
            int hashCode = L.hashCode();
            if (hashCode == 489446379) {
                if (L.equals("urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95")) {
                    c2 = 0;
                    if (c2 != 0) {
                    }
                    uuid = uuid2;
                    str = null;
                }
                c2 = 65535;
                if (c2 != 0) {
                }
                uuid = uuid2;
                str = null;
            } else if (hashCode != 755418770) {
                if (hashCode == 1812765994 && L.equals("urn:mpeg:dash:mp4protection:2011")) {
                    c2 = 2;
                    if (c2 != 0) {
                        uuid2 = v.f4243e;
                    } else if (c2 == 1) {
                        uuid2 = v.f4242d;
                    } else if (c2 == 2) {
                        str = xmlPullParser.getAttributeValue(null, "value");
                        int attributeCount = xmlPullParser.getAttributeCount();
                        int i2 = 0;
                        while (true) {
                            if (i2 >= attributeCount) {
                                str3 = null;
                                break;
                            }
                            String attributeName = xmlPullParser.getAttributeName(i2);
                            int indexOf = attributeName.indexOf(58);
                            if (indexOf != -1) {
                                attributeName = attributeName.substring(indexOf + 1);
                            }
                            if (attributeName.equals("default_KID")) {
                                str3 = xmlPullParser.getAttributeValue(i2);
                                break;
                            }
                            i2++;
                        }
                        if (!TextUtils.isEmpty(str3) && !"00000000-0000-0000-0000-000000000000".equals(str3)) {
                            String[] split = str3.split("\\s+");
                            UUID[] uuidArr = new UUID[split.length];
                            for (int i3 = 0; i3 < split.length; i3++) {
                                uuidArr[i3] = UUID.fromString(split[i3]);
                            }
                            uuid = v.b;
                            bArr = e.a.a.b.a.z(uuid, uuidArr, null);
                            str2 = null;
                            do {
                                xmlPullParser.next();
                                if (g.h.a.a.p1.e.w0(xmlPullParser, "ms:laurl")) {
                                    str2 = xmlPullParser.getAttributeValue(null, "licenseUrl");
                                } else {
                                    if (bArr == null) {
                                        if (g.h.a.a.p1.e.v0(xmlPullParser)) {
                                            String name = xmlPullParser.getName();
                                            int indexOf2 = name.indexOf(58);
                                            if (indexOf2 != -1) {
                                                name = name.substring(indexOf2 + 1);
                                            }
                                            if (name.equals("pssh")) {
                                                z = true;
                                                if (z && xmlPullParser.next() == 4) {
                                                    byte[] decode = Base64.decode(xmlPullParser.getText(), 0);
                                                    V = e.a.a.b.a.V(decode);
                                                    if (V != null) {
                                                        uuid = V;
                                                        bArr = null;
                                                    } else {
                                                        bArr = decode;
                                                        uuid = V;
                                                    }
                                                }
                                            }
                                        }
                                        z = false;
                                        if (z) {
                                            byte[] decode2 = Base64.decode(xmlPullParser.getText(), 0);
                                            V = e.a.a.b.a.V(decode2);
                                            if (V != null) {
                                            }
                                        }
                                    }
                                    if (bArr == null) {
                                        UUID uuid3 = v.f4243e;
                                        if (uuid3.equals(uuid) && g.h.a.a.p1.e.w0(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
                                            bArr = e.a.a.b.a.y(uuid3, Base64.decode(xmlPullParser.getText(), 0));
                                        }
                                    }
                                    d(xmlPullParser);
                                }
                            } while (!g.h.a.a.p1.e.s0(xmlPullParser, "ContentProtection"));
                            return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
                        }
                        uuid = null;
                    }
                    uuid = uuid2;
                    str = null;
                }
                c2 = 65535;
                if (c2 != 0) {
                }
                uuid = uuid2;
                str = null;
            } else {
                if (L.equals("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed")) {
                    c2 = 1;
                    if (c2 != 0) {
                    }
                    uuid = uuid2;
                    str = null;
                }
                c2 = 65535;
                if (c2 != 0) {
                }
                uuid = uuid2;
                str = null;
            }
            bArr = null;
            str2 = null;
            do {
                xmlPullParser.next();
                if (g.h.a.a.p1.e.w0(xmlPullParser, "ms:laurl")) {
                }
            } while (!g.h.a.a.p1.e.s0(xmlPullParser, "ContentProtection"));
            return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
        }
        str = null;
        uuid = null;
        bArr = null;
        str2 = null;
        do {
            xmlPullParser.next();
            if (g.h.a.a.p1.e.w0(xmlPullParser, "ms:laurl")) {
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "ContentProtection"));
        return Pair.create(str, uuid != null ? new DrmInitData.SchemeData(uuid, str2, "video/mp4", bArr) : null);
    }

    public int i(XmlPullParser xmlPullParser) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "contentType");
        if (TextUtils.isEmpty(attributeValue)) {
            return -1;
        }
        if ("audio".equals(attributeValue)) {
            return 1;
        }
        if ("video".equals(attributeValue)) {
            return 2;
        }
        return "text".equals(attributeValue) ? 3 : -1;
    }

    public int j(@Nullable String str) {
        if (str == null) {
            return 0;
        }
        char c2 = 65535;
        switch (str.hashCode()) {
            case -2060497896:
                if (str.equals("subtitle")) {
                    c2 = 0;
                    break;
                }
                break;
            case -1724546052:
                if (str.equals("description")) {
                    c2 = 1;
                    break;
                }
                break;
            case -1580883024:
                if (str.equals("enhanced-audio-intelligibility")) {
                    c2 = 2;
                    break;
                }
                break;
            case -1408024454:
                if (str.equals("alternate")) {
                    c2 = 3;
                    break;
                }
                break;
            case 99825:
                if (str.equals("dub")) {
                    c2 = 4;
                    break;
                }
                break;
            case 3343801:
                if (str.equals("main")) {
                    c2 = 5;
                    break;
                }
                break;
            case 3530173:
                if (str.equals("sign")) {
                    c2 = 6;
                    break;
                }
                break;
            case 552573414:
                if (str.equals("caption")) {
                    c2 = 7;
                    break;
                }
                break;
            case 899152809:
                if (str.equals("commentary")) {
                    c2 = '\b';
                    break;
                }
                break;
            case 1629013393:
                if (str.equals("emergency")) {
                    c2 = '\t';
                    break;
                }
                break;
            case 1855372047:
                if (str.equals("supplementary")) {
                    c2 = '\n';
                    break;
                }
                break;
        }
        switch (c2) {
            case 0:
                return 128;
            case 1:
                return 512;
            case 2:
                return 2048;
            case 3:
                return 2;
            case 4:
                return 16;
            case 5:
                return 1;
            case 6:
                return 256;
            case 7:
                return 64;
            case '\b':
                return 8;
            case '\t':
                return 32;
            case '\n':
                return 4;
            default:
                return 0;
        }
    }

    public b p(XmlPullParser xmlPullParser, String str) {
        ArrayList arrayList;
        long j2;
        String str2;
        long j3;
        long j4;
        long j5;
        long j6;
        boolean z;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        String str9;
        String str10;
        ArrayList arrayList2;
        long j7;
        ArrayList arrayList3;
        ArrayList arrayList4;
        c cVar;
        long j8;
        XmlPullParser xmlPullParser2;
        long j9;
        c cVar2;
        String str11;
        long j10;
        String str12;
        ArrayList arrayList5;
        String str13;
        ArrayList arrayList6;
        String str14;
        String str15;
        ArrayList arrayList7;
        long j11;
        int i2;
        String str16;
        String str17;
        ArrayList arrayList8;
        String str18;
        int i3;
        int i4;
        String str19;
        String str20;
        ArrayList arrayList9;
        String str21;
        XmlPullParser xmlPullParser3;
        String str22;
        String str23;
        long j12;
        String str24;
        ArrayList arrayList10;
        XmlPullParser xmlPullParser4;
        XmlPullParser xmlPullParser5;
        String str25;
        String str26;
        c cVar3;
        String str27;
        String str28;
        String str29;
        String str30;
        ArrayList arrayList11;
        String str31;
        String str32;
        int i5;
        String str33;
        String str34;
        ArrayList arrayList12;
        String str35;
        int i6;
        long j13;
        String str36;
        String str37;
        String str38;
        String str39;
        String str40;
        int i7;
        String str41;
        ArrayList arrayList13;
        int i8;
        int i9;
        int i10;
        Format B;
        String str42;
        int i11;
        String str43;
        int parseInt;
        String str44;
        String str45;
        int i12;
        char c2;
        ArrayList arrayList14;
        i bVar;
        ArrayList arrayList15;
        ArrayList arrayList16;
        String str46;
        Uri uri;
        long j14;
        c cVar4 = this;
        String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityStartTime");
        long C = attributeValue == null ? -9223372036854775807L : d0.C(attributeValue);
        long l2 = l(xmlPullParser, "mediaPresentationDuration", -9223372036854775807L);
        long l3 = l(xmlPullParser, "minBufferTime", -9223372036854775807L);
        boolean equals = "dynamic".equals(xmlPullParser.getAttributeValue(null, "type"));
        long l4 = equals ? l(xmlPullParser, "minimumUpdatePeriod", -9223372036854775807L) : -9223372036854775807L;
        long l5 = equals ? l(xmlPullParser, "timeShiftBufferDepth", -9223372036854775807L) : -9223372036854775807L;
        long l6 = equals ? l(xmlPullParser, "suggestedPresentationDelay", -9223372036854775807L) : -9223372036854775807L;
        String attributeValue2 = xmlPullParser.getAttributeValue(null, "publishTime");
        long C2 = attributeValue2 == null ? -9223372036854775807L : d0.C(attributeValue2);
        ArrayList arrayList17 = new ArrayList();
        long j15 = equals ? -9223372036854775807L : 0L;
        String str47 = str;
        Uri uri2 = null;
        g gVar = null;
        m mVar = null;
        XmlPullParser xmlPullParser6 = xmlPullParser;
        boolean z2 = false;
        boolean z3 = false;
        while (true) {
            xmlPullParser.next();
            String str48 = "BaseURL";
            if (!g.h.a.a.p1.e.w0(xmlPullParser6, "BaseURL")) {
                arrayList = arrayList17;
                j2 = l4;
                String str49 = "lang";
                if (g.h.a.a.p1.e.w0(xmlPullParser6, "ProgramInformation")) {
                    str2 = str47;
                    String attributeValue3 = xmlPullParser6.getAttributeValue(null, "moreInformationURL");
                    String str50 = attributeValue3 == null ? null : attributeValue3;
                    String attributeValue4 = xmlPullParser6.getAttributeValue(null, "lang");
                    if (attributeValue4 == null) {
                        attributeValue4 = null;
                    }
                    String str51 = attributeValue4;
                    String str52 = null;
                    String str53 = null;
                    String str54 = null;
                    do {
                        xmlPullParser.next();
                        String str55 = str52;
                        if (g.h.a.a.p1.e.w0(xmlPullParser6, "Title")) {
                            str52 = xmlPullParser.nextText();
                        } else {
                            if (g.h.a.a.p1.e.w0(xmlPullParser6, "Source")) {
                                str53 = xmlPullParser.nextText();
                            } else if (g.h.a.a.p1.e.w0(xmlPullParser6, ExifInterface.TAG_COPYRIGHT)) {
                                str54 = xmlPullParser.nextText();
                            } else {
                                d(xmlPullParser);
                            }
                            str52 = str55;
                        }
                    } while (!g.h.a.a.p1.e.s0(xmlPullParser6, "ProgramInformation"));
                    gVar = new g(str52, str53, str54, str50, str51);
                    j3 = l3;
                } else {
                    str2 = str47;
                    j3 = l3;
                    String str56 = "schemeIdUri";
                    if (g.h.a.a.p1.e.w0(xmlPullParser6, "UTCTiming")) {
                        mVar = new m(xmlPullParser6.getAttributeValue(null, "schemeIdUri"), xmlPullParser6.getAttributeValue(null, "value"));
                    } else if (g.h.a.a.p1.e.w0(xmlPullParser6, "Location")) {
                        uri2 = Uri.parse(xmlPullParser.nextText());
                    } else {
                        String str57 = "Period";
                        if (g.h.a.a.p1.e.w0(xmlPullParser6, "Period") && !z3) {
                            String str58 = "id";
                            String str59 = "value";
                            String attributeValue5 = xmlPullParser6.getAttributeValue(null, "id");
                            long l7 = l(xmlPullParser6, "start", j15);
                            String str60 = "duration";
                            long j16 = j15;
                            long l8 = l(xmlPullParser6, "duration", -9223372036854775807L);
                            j5 = C;
                            ArrayList arrayList18 = new ArrayList();
                            ArrayList arrayList19 = new ArrayList();
                            j6 = l2;
                            String str61 = str2;
                            j jVar = null;
                            boolean z4 = false;
                            XmlPullParser xmlPullParser7 = xmlPullParser6;
                            c cVar5 = cVar4;
                            while (true) {
                                xmlPullParser.next();
                                if (!g.h.a.a.p1.e.w0(xmlPullParser6, str48)) {
                                    str3 = str61;
                                    z = equals;
                                    str4 = str57;
                                    c cVar6 = cVar5;
                                    if (g.h.a.a.p1.e.w0(xmlPullParser6, "AdaptationSet")) {
                                        String str62 = str60;
                                        int n2 = n(xmlPullParser6, str58, -1);
                                        int i13 = i(xmlPullParser);
                                        ArrayList arrayList20 = arrayList19;
                                        String str63 = "mimeType";
                                        String attributeValue6 = xmlPullParser6.getAttributeValue(null, "mimeType");
                                        str9 = str56;
                                        String str64 = "codecs";
                                        String attributeValue7 = xmlPullParser6.getAttributeValue(null, "codecs");
                                        String str65 = "width";
                                        arrayList3 = arrayList18;
                                        String str66 = "AdaptationSet";
                                        int n3 = n(xmlPullParser6, "width", -1);
                                        int n4 = n(xmlPullParser6, "height", -1);
                                        String str67 = "SegmentTemplate";
                                        float m2 = m(xmlPullParser6, -1.0f);
                                        long j17 = l8;
                                        int n5 = n(xmlPullParser6, "audioSamplingRate", -1);
                                        String str68 = "SegmentList";
                                        String attributeValue8 = xmlPullParser6.getAttributeValue(null, str49);
                                        String str69 = "SegmentBase";
                                        String attributeValue9 = xmlPullParser6.getAttributeValue(null, "label");
                                        ArrayList arrayList21 = new ArrayList();
                                        ArrayList arrayList22 = new ArrayList();
                                        ArrayList arrayList23 = new ArrayList();
                                        String str70 = attributeValue9;
                                        ArrayList arrayList24 = new ArrayList();
                                        ArrayList arrayList25 = new ArrayList();
                                        String str71 = "audioSamplingRate";
                                        String str72 = "height";
                                        int i14 = n4;
                                        String str73 = str3;
                                        j jVar2 = jVar;
                                        String str74 = attributeValue8;
                                        String str75 = null;
                                        boolean z5 = false;
                                        XmlPullParser xmlPullParser8 = xmlPullParser;
                                        int i15 = n5;
                                        c cVar7 = cVar6;
                                        int i16 = -1;
                                        ArrayList arrayList26 = new ArrayList();
                                        int i17 = i13;
                                        while (true) {
                                            xmlPullParser.next();
                                            if (!g.h.a.a.p1.e.w0(xmlPullParser8, str48)) {
                                                if (g.h.a.a.p1.e.w0(xmlPullParser8, "ContentProtection")) {
                                                    Pair<String, DrmInitData.SchemeData> h2 = h(xmlPullParser);
                                                    str12 = str73;
                                                    Object obj = h2.first;
                                                    if (obj != null) {
                                                        str75 = (String) obj;
                                                    }
                                                    Object obj2 = h2.second;
                                                    if (obj2 != null) {
                                                        arrayList21.add(obj2);
                                                    }
                                                } else {
                                                    str12 = str73;
                                                    if (g.h.a.a.p1.e.w0(xmlPullParser8, "ContentComponent")) {
                                                        String attributeValue10 = xmlPullParser8.getAttributeValue(null, str49);
                                                        if (str74 == null) {
                                                            str74 = attributeValue10;
                                                        } else if (attributeValue10 != null) {
                                                            g.h.a.a.p1.e.w(str74.equals(attributeValue10));
                                                        }
                                                        i17 = c(i17, i(xmlPullParser));
                                                        str5 = str59;
                                                        str6 = str48;
                                                        str7 = str58;
                                                        arrayList8 = arrayList25;
                                                        str13 = str63;
                                                        arrayList6 = arrayList21;
                                                        str14 = str64;
                                                        str15 = str74;
                                                        str10 = str49;
                                                        j7 = j16;
                                                        str8 = str62;
                                                        arrayList7 = arrayList26;
                                                        str25 = str66;
                                                        str22 = str68;
                                                        i2 = i15;
                                                        str24 = str69;
                                                        arrayList10 = arrayList22;
                                                        str17 = str71;
                                                        str18 = str72;
                                                        i3 = i14;
                                                        arrayList9 = arrayList24;
                                                        xmlPullParser5 = xmlPullParser8;
                                                        i4 = n3;
                                                        arrayList2 = arrayList;
                                                        str23 = str67;
                                                        j12 = j17;
                                                        str21 = str65;
                                                    } else if (g.h.a.a.p1.e.w0(xmlPullParser8, "Role")) {
                                                        arrayList24.add(k(xmlPullParser8, "Role"));
                                                        arrayList5 = arrayList24;
                                                        str5 = str59;
                                                        str6 = str48;
                                                        str7 = str58;
                                                        arrayList8 = arrayList25;
                                                        xmlPullParser4 = xmlPullParser8;
                                                        str13 = str63;
                                                        arrayList6 = arrayList21;
                                                        str14 = str64;
                                                        str15 = str74;
                                                        str10 = str49;
                                                        j7 = j16;
                                                        str8 = str62;
                                                        arrayList7 = arrayList26;
                                                        j12 = j17;
                                                        str22 = str68;
                                                        i2 = i15;
                                                        str24 = str69;
                                                        arrayList10 = arrayList22;
                                                        str17 = str71;
                                                        arrayList9 = arrayList5;
                                                        str18 = str72;
                                                        i3 = i14;
                                                        i4 = n3;
                                                        arrayList2 = arrayList;
                                                        str23 = str67;
                                                        str21 = str65;
                                                    } else {
                                                        String str76 = "AudioChannelConfiguration";
                                                        if (g.h.a.a.p1.e.w0(xmlPullParser8, "AudioChannelConfiguration")) {
                                                            i16 = f(xmlPullParser);
                                                        } else {
                                                            arrayList5 = arrayList24;
                                                            if (g.h.a.a.p1.e.w0(xmlPullParser8, "Accessibility")) {
                                                                arrayList23.add(k(xmlPullParser8, "Accessibility"));
                                                            } else if (g.h.a.a.p1.e.w0(xmlPullParser8, "SupplementalProperty")) {
                                                                arrayList25.add(k(xmlPullParser8, "SupplementalProperty"));
                                                            } else {
                                                                ArrayList arrayList27 = arrayList25;
                                                                str10 = str49;
                                                                if (g.h.a.a.p1.e.w0(xmlPullParser8, "Representation")) {
                                                                    String str77 = "SupplementalProperty";
                                                                    String attributeValue11 = xmlPullParser8.getAttributeValue(null, str58);
                                                                    int i18 = i17;
                                                                    int n6 = n(xmlPullParser8, "bandwidth", -1);
                                                                    String attributeValue12 = xmlPullParser8.getAttributeValue(null, str63);
                                                                    if (attributeValue12 == null) {
                                                                        attributeValue12 = attributeValue6;
                                                                    }
                                                                    String attributeValue13 = xmlPullParser8.getAttributeValue(null, str64);
                                                                    if (attributeValue13 == null) {
                                                                        attributeValue13 = attributeValue7;
                                                                    }
                                                                    int n7 = n(xmlPullParser8, str65, n3);
                                                                    str13 = str63;
                                                                    String str78 = str72;
                                                                    i4 = n3;
                                                                    int i19 = i14;
                                                                    int n8 = n(xmlPullParser8, str78, i19);
                                                                    float m3 = m(xmlPullParser8, m2);
                                                                    String str79 = attributeValue12;
                                                                    String str80 = str71;
                                                                    int i20 = i15;
                                                                    String str81 = "ContentProtection";
                                                                    int i21 = i20;
                                                                    int n9 = n(xmlPullParser8, str80, i21);
                                                                    XmlPullParser xmlPullParser9 = xmlPullParser8;
                                                                    ArrayList arrayList28 = new ArrayList();
                                                                    ArrayList arrayList29 = new ArrayList();
                                                                    i3 = i19;
                                                                    ArrayList arrayList30 = new ArrayList();
                                                                    boolean z6 = false;
                                                                    String str82 = null;
                                                                    arrayList6 = arrayList21;
                                                                    str14 = str64;
                                                                    int i22 = i16;
                                                                    XmlPullParser xmlPullParser10 = xmlPullParser9;
                                                                    j jVar3 = jVar2;
                                                                    String str83 = str12;
                                                                    while (true) {
                                                                        xmlPullParser.next();
                                                                        if (g.h.a.a.p1.e.w0(xmlPullParser10, str48)) {
                                                                            if (z6) {
                                                                                str15 = str74;
                                                                                arrayList8 = arrayList27;
                                                                                cVar3 = this;
                                                                            } else {
                                                                                str15 = str74;
                                                                                arrayList8 = arrayList27;
                                                                                cVar3 = this;
                                                                                str83 = cVar3.g(xmlPullParser10, str83);
                                                                                z6 = true;
                                                                            }
                                                                            str27 = str76;
                                                                            str28 = str69;
                                                                            str29 = attributeValue13;
                                                                        } else {
                                                                            str15 = str74;
                                                                            arrayList8 = arrayList27;
                                                                            cVar3 = this;
                                                                            if (g.h.a.a.p1.e.w0(xmlPullParser10, str76)) {
                                                                                str5 = str59;
                                                                                str31 = attributeValue13;
                                                                                str6 = str48;
                                                                                str7 = str58;
                                                                                str27 = str76;
                                                                                j7 = j16;
                                                                                str8 = str62;
                                                                                j11 = j17;
                                                                                str34 = str81;
                                                                                str33 = str69;
                                                                                i22 = f(xmlPullParser);
                                                                                i5 = i18;
                                                                                str36 = str82;
                                                                                str17 = str80;
                                                                                str30 = str83;
                                                                                arrayList2 = arrayList;
                                                                                str19 = str67;
                                                                                str20 = str68;
                                                                                arrayList12 = arrayList5;
                                                                                str32 = str77;
                                                                                str21 = str65;
                                                                                arrayList11 = arrayList26;
                                                                                i2 = i21;
                                                                                if (g.h.a.a.p1.e.s0(xmlPullParser10, "Representation")) {
                                                                                    xmlPullParser10 = xmlPullParser;
                                                                                    str82 = str36;
                                                                                    str77 = str32;
                                                                                    str65 = str21;
                                                                                    str80 = str17;
                                                                                    i21 = i2;
                                                                                    arrayList26 = arrayList11;
                                                                                    str83 = str30;
                                                                                    str67 = str19;
                                                                                    arrayList5 = arrayList12;
                                                                                    arrayList = arrayList2;
                                                                                    str68 = str20;
                                                                                    attributeValue13 = str31;
                                                                                    str74 = str15;
                                                                                    arrayList27 = arrayList8;
                                                                                    str48 = str6;
                                                                                    j17 = j11;
                                                                                    i18 = i5;
                                                                                    str59 = str5;
                                                                                    str58 = str7;
                                                                                    str62 = str8;
                                                                                    str81 = str34;
                                                                                    str69 = str33;
                                                                                    str76 = str27;
                                                                                    j16 = j7;
                                                                                } else {
                                                                                    if (q.h(str79)) {
                                                                                        str40 = q.a(str31);
                                                                                    } else if (q.j(str79)) {
                                                                                        str40 = q.g(str31);
                                                                                    } else if (e(str79)) {
                                                                                        str40 = str79;
                                                                                    } else {
                                                                                        str37 = str79;
                                                                                        if (!"application/mp4".equals(str37)) {
                                                                                            str38 = str31;
                                                                                            if ("application/x-rawcc".equals(str37) && str38 != null) {
                                                                                                if (str38.contains("cea708")) {
                                                                                                    str39 = "application/cea-708";
                                                                                                } else if (str38.contains("eia608") || str38.contains("cea608")) {
                                                                                                    str39 = "application/cea-608";
                                                                                                }
                                                                                                i7 = 0;
                                                                                                while (true) {
                                                                                                    str41 = "urn:mpeg:dash:role:2011";
                                                                                                    if (i7 < arrayList12.size()) {
                                                                                                    }
                                                                                                    i7++;
                                                                                                    arrayList12 = arrayList13;
                                                                                                }
                                                                                                i9 = 0;
                                                                                                int i23 = 0;
                                                                                                while (i9 < arrayList13.size()) {
                                                                                                }
                                                                                                arrayList9 = arrayList13;
                                                                                                i10 = 0;
                                                                                                int i24 = 0;
                                                                                                while (i10 < arrayList23.size()) {
                                                                                                }
                                                                                                ArrayList arrayList31 = arrayList29;
                                                                                                int i25 = 2;
                                                                                                int i26 = i23 | i24;
                                                                                                if (str39 != null) {
                                                                                                }
                                                                                                B = Format.B(attributeValue11, null, str37, str39, str38, n6, i8, i26, str15);
                                                                                                a aVar = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList31, -1L);
                                                                                                str42 = B.f268k;
                                                                                                if (!TextUtils.isEmpty(str42)) {
                                                                                                }
                                                                                                i25 = -1;
                                                                                                int c3 = c(i5, i25);
                                                                                                arrayList7 = arrayList11;
                                                                                                arrayList7.add(aVar);
                                                                                                xmlPullParser3 = xmlPullParser;
                                                                                                i17 = c3;
                                                                                                str16 = str33;
                                                                                                str18 = str78;
                                                                                            }
                                                                                            str39 = null;
                                                                                            i7 = 0;
                                                                                            while (true) {
                                                                                                str41 = "urn:mpeg:dash:role:2011";
                                                                                                if (i7 < arrayList12.size()) {
                                                                                                }
                                                                                                i7++;
                                                                                                arrayList12 = arrayList13;
                                                                                            }
                                                                                            i9 = 0;
                                                                                            int i232 = 0;
                                                                                            while (i9 < arrayList13.size()) {
                                                                                            }
                                                                                            arrayList9 = arrayList13;
                                                                                            i10 = 0;
                                                                                            int i242 = 0;
                                                                                            while (i10 < arrayList23.size()) {
                                                                                            }
                                                                                            ArrayList arrayList312 = arrayList29;
                                                                                            int i252 = 2;
                                                                                            int i262 = i232 | i242;
                                                                                            if (str39 != null) {
                                                                                            }
                                                                                            B = Format.B(attributeValue11, null, str37, str39, str38, n6, i8, i262, str15);
                                                                                            a aVar2 = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList312, -1L);
                                                                                            str42 = B.f268k;
                                                                                            if (!TextUtils.isEmpty(str42)) {
                                                                                            }
                                                                                            i252 = -1;
                                                                                            int c32 = c(i5, i252);
                                                                                            arrayList7 = arrayList11;
                                                                                            arrayList7.add(aVar2);
                                                                                            xmlPullParser3 = xmlPullParser;
                                                                                            i17 = c32;
                                                                                            str16 = str33;
                                                                                            str18 = str78;
                                                                                        } else {
                                                                                            str38 = str31;
                                                                                            if (str38 != null) {
                                                                                                if (str38.startsWith("stpp")) {
                                                                                                    str39 = "application/ttml+xml";
                                                                                                } else if (str38.startsWith("wvtt")) {
                                                                                                    str39 = "application/x-mp4-vtt";
                                                                                                }
                                                                                                i7 = 0;
                                                                                                while (true) {
                                                                                                    str41 = "urn:mpeg:dash:role:2011";
                                                                                                    if (i7 < arrayList12.size()) {
                                                                                                        arrayList13 = arrayList12;
                                                                                                        d dVar = (d) arrayList13.get(i7);
                                                                                                        if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar.a) && "main".equals(dVar.b)) {
                                                                                                            i8 = 1;
                                                                                                        } else {
                                                                                                            i7++;
                                                                                                            arrayList12 = arrayList13;
                                                                                                        }
                                                                                                    } else {
                                                                                                        arrayList13 = arrayList12;
                                                                                                        i8 = 0;
                                                                                                    }
                                                                                                }
                                                                                                i9 = 0;
                                                                                                int i2322 = 0;
                                                                                                while (i9 < arrayList13.size()) {
                                                                                                    d dVar2 = (d) arrayList13.get(i9);
                                                                                                    ArrayList arrayList32 = arrayList13;
                                                                                                    if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar2.a)) {
                                                                                                        i2322 |= cVar3.j(dVar2.b);
                                                                                                    }
                                                                                                    i9++;
                                                                                                    arrayList13 = arrayList32;
                                                                                                }
                                                                                                arrayList9 = arrayList13;
                                                                                                i10 = 0;
                                                                                                int i2422 = 0;
                                                                                                while (i10 < arrayList23.size()) {
                                                                                                    d dVar3 = (d) arrayList23.get(i10);
                                                                                                    ArrayList arrayList33 = arrayList29;
                                                                                                    if (str41.equalsIgnoreCase(dVar3.a)) {
                                                                                                        i2422 = cVar3.j(dVar3.b) | i2422;
                                                                                                        str45 = str41;
                                                                                                    } else {
                                                                                                        str45 = str41;
                                                                                                        if ("urn:tva:metadata:cs:AudioPurposeCS:2007".equalsIgnoreCase(dVar3.a)) {
                                                                                                            String str84 = dVar3.b;
                                                                                                            if (str84 != null) {
                                                                                                                switch (str84.hashCode()) {
                                                                                                                    case 49:
                                                                                                                        if (str84.equals("1")) {
                                                                                                                            c2 = 0;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                    case 50:
                                                                                                                        if (str84.equals("2")) {
                                                                                                                            c2 = 1;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                    case 51:
                                                                                                                        if (str84.equals("3")) {
                                                                                                                            c2 = 2;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                    case 52:
                                                                                                                        if (str84.equals("4")) {
                                                                                                                            c2 = 3;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                    case 53:
                                                                                                                    default:
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                    case 54:
                                                                                                                        if (str84.equals("6")) {
                                                                                                                            c2 = 4;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                        c2 = 65535;
                                                                                                                        break;
                                                                                                                }
                                                                                                                if (c2 == 0) {
                                                                                                                    i12 = 512;
                                                                                                                } else if (c2 == 1) {
                                                                                                                    i12 = 2048;
                                                                                                                } else if (c2 == 2) {
                                                                                                                    i12 = 4;
                                                                                                                } else if (c2 == 3) {
                                                                                                                    i12 = 8;
                                                                                                                } else if (c2 == 4) {
                                                                                                                    i12 = 1;
                                                                                                                }
                                                                                                                i2422 = i12 | i2422;
                                                                                                            }
                                                                                                            i12 = 0;
                                                                                                            i2422 = i12 | i2422;
                                                                                                        }
                                                                                                    }
                                                                                                    i10++;
                                                                                                    arrayList29 = arrayList33;
                                                                                                    str41 = str45;
                                                                                                }
                                                                                                ArrayList arrayList3122 = arrayList29;
                                                                                                int i2522 = 2;
                                                                                                int i2622 = i2322 | i2422;
                                                                                                if (str39 != null) {
                                                                                                    String str85 = "audio/eac3";
                                                                                                    if ("audio/eac3".equals(str39)) {
                                                                                                        for (int i27 = 0; i27 < arrayList30.size(); i27++) {
                                                                                                            d dVar4 = (d) arrayList30.get(i27);
                                                                                                            String str86 = dVar4.a;
                                                                                                            if (("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str86) && "JOC".equals(dVar4.b)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str86) && "ec+3".equals(dVar4.b))) {
                                                                                                                str85 = "audio/eac3-joc";
                                                                                                                str39 = str85;
                                                                                                            }
                                                                                                        }
                                                                                                        str39 = str85;
                                                                                                    }
                                                                                                    if (q.j(str39)) {
                                                                                                        B = Format.J(attributeValue11, null, str37, str39, str38, null, n6, n7, n8, m3, null, i8, i2622);
                                                                                                    } else if (q.h(str39)) {
                                                                                                        B = Format.x(attributeValue11, null, str37, str39, str38, null, n6, i22, n9, null, i8, i2622, str15);
                                                                                                    } else if (e(str39)) {
                                                                                                        if ("application/cea-608".equals(str39)) {
                                                                                                            for (int i28 = 0; i28 < arrayList23.size(); i28++) {
                                                                                                                d dVar5 = (d) arrayList23.get(i28);
                                                                                                                if ("urn:scte:dash:cc:cea-608:2015".equals(dVar5.a) && (str44 = dVar5.b) != null) {
                                                                                                                    Matcher matcher = c.matcher(str44);
                                                                                                                    if (matcher.matches()) {
                                                                                                                        parseInt = Integer.parseInt(matcher.group(1));
                                                                                                                        i11 = parseInt;
                                                                                                                        B = Format.G(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15, i11);
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                            parseInt = -1;
                                                                                                            i11 = parseInt;
                                                                                                            B = Format.G(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15, i11);
                                                                                                        } else if ("application/cea-708".equals(str39)) {
                                                                                                            for (int i29 = 0; i29 < arrayList23.size(); i29++) {
                                                                                                                d dVar6 = (d) arrayList23.get(i29);
                                                                                                                if ("urn:scte:dash:cc:cea-708:2015".equals(dVar6.a) && (str43 = dVar6.b) != null) {
                                                                                                                    Matcher matcher2 = f3495d.matcher(str43);
                                                                                                                    if (matcher2.matches()) {
                                                                                                                        parseInt = Integer.parseInt(matcher2.group(1));
                                                                                                                        i11 = parseInt;
                                                                                                                        B = Format.G(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15, i11);
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                            parseInt = -1;
                                                                                                            i11 = parseInt;
                                                                                                            B = Format.G(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15, i11);
                                                                                                        } else {
                                                                                                            i11 = -1;
                                                                                                            B = Format.G(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15, i11);
                                                                                                        }
                                                                                                    }
                                                                                                    a aVar22 = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList3122, -1L);
                                                                                                    str42 = B.f268k;
                                                                                                    if (!TextUtils.isEmpty(str42)) {
                                                                                                        if (!q.j(str42)) {
                                                                                                            if (q.h(str42)) {
                                                                                                                i2522 = 1;
                                                                                                            } else if (e(str42)) {
                                                                                                                i2522 = 3;
                                                                                                            }
                                                                                                        }
                                                                                                        int c322 = c(i5, i2522);
                                                                                                        arrayList7 = arrayList11;
                                                                                                        arrayList7.add(aVar22);
                                                                                                        xmlPullParser3 = xmlPullParser;
                                                                                                        i17 = c322;
                                                                                                        str16 = str33;
                                                                                                        str18 = str78;
                                                                                                    }
                                                                                                    i2522 = -1;
                                                                                                    int c3222 = c(i5, i2522);
                                                                                                    arrayList7 = arrayList11;
                                                                                                    arrayList7.add(aVar22);
                                                                                                    xmlPullParser3 = xmlPullParser;
                                                                                                    i17 = c3222;
                                                                                                    str16 = str33;
                                                                                                    str18 = str78;
                                                                                                }
                                                                                                B = Format.B(attributeValue11, null, str37, str39, str38, n6, i8, i2622, str15);
                                                                                                a aVar222 = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList3122, -1L);
                                                                                                str42 = B.f268k;
                                                                                                if (!TextUtils.isEmpty(str42)) {
                                                                                                }
                                                                                                i2522 = -1;
                                                                                                int c32222 = c(i5, i2522);
                                                                                                arrayList7 = arrayList11;
                                                                                                arrayList7.add(aVar222);
                                                                                                xmlPullParser3 = xmlPullParser;
                                                                                                i17 = c32222;
                                                                                                str16 = str33;
                                                                                                str18 = str78;
                                                                                            }
                                                                                            str39 = null;
                                                                                            i7 = 0;
                                                                                            while (true) {
                                                                                                str41 = "urn:mpeg:dash:role:2011";
                                                                                                if (i7 < arrayList12.size()) {
                                                                                                }
                                                                                                i7++;
                                                                                                arrayList12 = arrayList13;
                                                                                            }
                                                                                            i9 = 0;
                                                                                            int i23222 = 0;
                                                                                            while (i9 < arrayList13.size()) {
                                                                                            }
                                                                                            arrayList9 = arrayList13;
                                                                                            i10 = 0;
                                                                                            int i24222 = 0;
                                                                                            while (i10 < arrayList23.size()) {
                                                                                            }
                                                                                            ArrayList arrayList31222 = arrayList29;
                                                                                            int i25222 = 2;
                                                                                            int i26222 = i23222 | i24222;
                                                                                            if (str39 != null) {
                                                                                            }
                                                                                            B = Format.B(attributeValue11, null, str37, str39, str38, n6, i8, i26222, str15);
                                                                                            a aVar2222 = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList31222, -1L);
                                                                                            str42 = B.f268k;
                                                                                            if (!TextUtils.isEmpty(str42)) {
                                                                                            }
                                                                                            i25222 = -1;
                                                                                            int c322222 = c(i5, i25222);
                                                                                            arrayList7 = arrayList11;
                                                                                            arrayList7.add(aVar2222);
                                                                                            xmlPullParser3 = xmlPullParser;
                                                                                            i17 = c322222;
                                                                                            str16 = str33;
                                                                                            str18 = str78;
                                                                                        }
                                                                                        str24 = str16;
                                                                                        xmlPullParser4 = xmlPullParser8;
                                                                                        str12 = str26;
                                                                                        str23 = str19;
                                                                                        str22 = str20;
                                                                                        arrayList10 = arrayList22;
                                                                                        j12 = j11;
                                                                                    }
                                                                                    str39 = str40;
                                                                                    str37 = str79;
                                                                                    str38 = str31;
                                                                                    i7 = 0;
                                                                                    while (true) {
                                                                                        str41 = "urn:mpeg:dash:role:2011";
                                                                                        if (i7 < arrayList12.size()) {
                                                                                        }
                                                                                        i7++;
                                                                                        arrayList12 = arrayList13;
                                                                                    }
                                                                                    i9 = 0;
                                                                                    int i232222 = 0;
                                                                                    while (i9 < arrayList13.size()) {
                                                                                    }
                                                                                    arrayList9 = arrayList13;
                                                                                    i10 = 0;
                                                                                    int i242222 = 0;
                                                                                    while (i10 < arrayList23.size()) {
                                                                                    }
                                                                                    ArrayList arrayList312222 = arrayList29;
                                                                                    int i252222 = 2;
                                                                                    int i262222 = i232222 | i242222;
                                                                                    if (str39 != null) {
                                                                                    }
                                                                                    B = Format.B(attributeValue11, null, str37, str39, str38, n6, i8, i262222, str15);
                                                                                    a aVar22222 = new a(B, str30, jVar3 == null ? jVar3 : new j.e(), str36, arrayList28, arrayList312222, -1L);
                                                                                    str42 = B.f268k;
                                                                                    if (!TextUtils.isEmpty(str42)) {
                                                                                    }
                                                                                    i252222 = -1;
                                                                                    int c3222222 = c(i5, i252222);
                                                                                    arrayList7 = arrayList11;
                                                                                    arrayList7.add(aVar22222);
                                                                                    xmlPullParser3 = xmlPullParser;
                                                                                    i17 = c3222222;
                                                                                    str16 = str33;
                                                                                    str18 = str78;
                                                                                }
                                                                            } else {
                                                                                str27 = str76;
                                                                                str28 = str69;
                                                                                if (g.h.a.a.p1.e.w0(xmlPullParser10, str28)) {
                                                                                    str29 = attributeValue13;
                                                                                    jVar3 = cVar3.r(xmlPullParser10, (j.e) jVar3);
                                                                                } else {
                                                                                    str29 = attributeValue13;
                                                                                    String str87 = str68;
                                                                                    if (g.h.a.a.p1.e.w0(xmlPullParser10, str87)) {
                                                                                        str68 = str87;
                                                                                        str35 = str80;
                                                                                        i6 = i21;
                                                                                        j13 = j17;
                                                                                        jVar3 = cVar3.s(xmlPullParser10, (j.b) jVar3, j13);
                                                                                        str5 = str59;
                                                                                        str6 = str48;
                                                                                        j11 = j13;
                                                                                        str7 = str58;
                                                                                        str30 = str83;
                                                                                        j7 = j16;
                                                                                        str8 = str62;
                                                                                        str19 = str67;
                                                                                        str31 = str29;
                                                                                        str17 = str35;
                                                                                        str32 = str77;
                                                                                        i5 = i18;
                                                                                        str33 = str28;
                                                                                        arrayList11 = arrayList26;
                                                                                        str20 = str68;
                                                                                        str34 = str81;
                                                                                        arrayList12 = arrayList5;
                                                                                        i2 = i6;
                                                                                        arrayList2 = arrayList;
                                                                                        str21 = str65;
                                                                                        str36 = str82;
                                                                                        if (g.h.a.a.p1.e.s0(xmlPullParser10, "Representation")) {
                                                                                        }
                                                                                    } else {
                                                                                        String str88 = str80;
                                                                                        int i30 = i21;
                                                                                        String str89 = str67;
                                                                                        long j18 = j17;
                                                                                        if (g.h.a.a.p1.e.w0(xmlPullParser10, str89)) {
                                                                                            str19 = str89;
                                                                                            str30 = str83;
                                                                                            str31 = str29;
                                                                                            str32 = str77;
                                                                                            str20 = str87;
                                                                                            arrayList12 = arrayList5;
                                                                                            str6 = str48;
                                                                                            j11 = j18;
                                                                                            j7 = j16;
                                                                                            str17 = str88;
                                                                                            str33 = str28;
                                                                                            i5 = i18;
                                                                                            arrayList11 = arrayList26;
                                                                                            str34 = str81;
                                                                                            i2 = i30;
                                                                                            str5 = str59;
                                                                                            str7 = str58;
                                                                                            arrayList2 = arrayList;
                                                                                            str8 = str62;
                                                                                            str21 = str65;
                                                                                            jVar3 = t(xmlPullParser, (j.c) jVar3, arrayList8, j11);
                                                                                        } else {
                                                                                            str5 = str59;
                                                                                            str19 = str89;
                                                                                            str6 = str48;
                                                                                            j11 = j18;
                                                                                            str7 = str58;
                                                                                            str30 = str83;
                                                                                            j7 = j16;
                                                                                            str8 = str62;
                                                                                            arrayList11 = arrayList26;
                                                                                            str31 = str29;
                                                                                            str17 = str88;
                                                                                            str32 = str77;
                                                                                            i5 = i18;
                                                                                            i2 = i30;
                                                                                            str33 = str28;
                                                                                            str20 = str87;
                                                                                            str34 = str81;
                                                                                            arrayList12 = arrayList5;
                                                                                            arrayList2 = arrayList;
                                                                                            str21 = str65;
                                                                                            if (g.h.a.a.p1.e.w0(xmlPullParser10, str34)) {
                                                                                                Pair<String, DrmInitData.SchemeData> h3 = h(xmlPullParser);
                                                                                                Object obj3 = h3.first;
                                                                                                if (obj3 != null) {
                                                                                                    str82 = (String) obj3;
                                                                                                }
                                                                                                Object obj4 = h3.second;
                                                                                                if (obj4 != null) {
                                                                                                    arrayList28.add(obj4);
                                                                                                }
                                                                                            } else if (g.h.a.a.p1.e.w0(xmlPullParser10, "InbandEventStream")) {
                                                                                                arrayList29.add(k(xmlPullParser10, "InbandEventStream"));
                                                                                            } else if (g.h.a.a.p1.e.w0(xmlPullParser10, str32)) {
                                                                                                arrayList30.add(k(xmlPullParser10, str32));
                                                                                            } else {
                                                                                                d(xmlPullParser);
                                                                                            }
                                                                                        }
                                                                                        str36 = str82;
                                                                                        if (g.h.a.a.p1.e.s0(xmlPullParser10, "Representation")) {
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        str35 = str80;
                                                                        i6 = i21;
                                                                        j13 = j17;
                                                                        str5 = str59;
                                                                        str6 = str48;
                                                                        j11 = j13;
                                                                        str7 = str58;
                                                                        str30 = str83;
                                                                        j7 = j16;
                                                                        str8 = str62;
                                                                        str19 = str67;
                                                                        str31 = str29;
                                                                        str17 = str35;
                                                                        str32 = str77;
                                                                        i5 = i18;
                                                                        str33 = str28;
                                                                        arrayList11 = arrayList26;
                                                                        str20 = str68;
                                                                        str34 = str81;
                                                                        arrayList12 = arrayList5;
                                                                        i2 = i6;
                                                                        arrayList2 = arrayList;
                                                                        str21 = str65;
                                                                        str36 = str82;
                                                                        if (g.h.a.a.p1.e.s0(xmlPullParser10, "Representation")) {
                                                                        }
                                                                    }
                                                                } else {
                                                                    str5 = str59;
                                                                    str6 = str48;
                                                                    str7 = str58;
                                                                    str13 = str63;
                                                                    arrayList6 = arrayList21;
                                                                    str14 = str64;
                                                                    str15 = str74;
                                                                    j7 = j16;
                                                                    str8 = str62;
                                                                    arrayList7 = arrayList26;
                                                                    j11 = j17;
                                                                    i2 = i15;
                                                                    str16 = str69;
                                                                    str17 = str71;
                                                                    arrayList8 = arrayList27;
                                                                    str18 = str72;
                                                                    i3 = i14;
                                                                    int i31 = i17;
                                                                    i4 = n3;
                                                                    arrayList2 = arrayList;
                                                                    str19 = str67;
                                                                    str20 = str68;
                                                                    arrayList9 = arrayList5;
                                                                    str21 = str65;
                                                                    xmlPullParser3 = xmlPullParser;
                                                                    if (g.h.a.a.p1.e.w0(xmlPullParser3, str16)) {
                                                                        jVar2 = r(xmlPullParser3, (j.e) jVar2);
                                                                        i17 = i31;
                                                                    } else {
                                                                        str22 = str20;
                                                                        if (g.h.a.a.p1.e.w0(xmlPullParser3, str22)) {
                                                                            j12 = j11;
                                                                            jVar2 = s(xmlPullParser3, (j.b) jVar2, j12);
                                                                            str24 = str16;
                                                                            xmlPullParser5 = xmlPullParser3;
                                                                            str23 = str19;
                                                                        } else {
                                                                            str23 = str19;
                                                                            j12 = j11;
                                                                            if (g.h.a.a.p1.e.w0(xmlPullParser3, str23)) {
                                                                                str24 = str16;
                                                                                xmlPullParser5 = xmlPullParser3;
                                                                                jVar2 = t(xmlPullParser, (j.c) jVar2, arrayList8, j12);
                                                                            } else {
                                                                                str24 = str16;
                                                                                if (g.h.a.a.p1.e.w0(xmlPullParser3, "InbandEventStream")) {
                                                                                    arrayList10 = arrayList22;
                                                                                    arrayList10.add(k(xmlPullParser3, "InbandEventStream"));
                                                                                } else {
                                                                                    arrayList10 = arrayList22;
                                                                                    if (g.h.a.a.p1.e.w0(xmlPullParser3, "Label")) {
                                                                                        str70 = v(xmlPullParser3, "Label");
                                                                                    } else if (g.h.a.a.p1.e.v0(xmlPullParser)) {
                                                                                        d(xmlPullParser);
                                                                                    }
                                                                                }
                                                                                xmlPullParser4 = xmlPullParser3;
                                                                                i17 = i31;
                                                                            }
                                                                        }
                                                                        i17 = i31;
                                                                        str25 = str66;
                                                                        arrayList10 = arrayList22;
                                                                    }
                                                                }
                                                                xmlPullParser8 = xmlPullParser3;
                                                                str26 = str12;
                                                                str24 = str16;
                                                                xmlPullParser4 = xmlPullParser8;
                                                                str12 = str26;
                                                                str23 = str19;
                                                                str22 = str20;
                                                                arrayList10 = arrayList22;
                                                                j12 = j11;
                                                            }
                                                            str5 = str59;
                                                            str6 = str48;
                                                            str7 = str58;
                                                            arrayList8 = arrayList25;
                                                            xmlPullParser4 = xmlPullParser8;
                                                            str13 = str63;
                                                            arrayList6 = arrayList21;
                                                            str14 = str64;
                                                            str15 = str74;
                                                            str10 = str49;
                                                            j7 = j16;
                                                            str8 = str62;
                                                            arrayList7 = arrayList26;
                                                            j12 = j17;
                                                            str22 = str68;
                                                            i2 = i15;
                                                            str24 = str69;
                                                            arrayList10 = arrayList22;
                                                            str17 = str71;
                                                            arrayList9 = arrayList5;
                                                            str18 = str72;
                                                            i3 = i14;
                                                            i4 = n3;
                                                            arrayList2 = arrayList;
                                                            str23 = str67;
                                                            str21 = str65;
                                                        }
                                                    }
                                                    if (g.h.a.a.p1.e.s0(xmlPullParser5, str25)) {
                                                        arrayList22 = arrayList10;
                                                        str66 = str25;
                                                        j17 = j12;
                                                        str67 = str23;
                                                        str69 = str24;
                                                        xmlPullParser8 = xmlPullParser5;
                                                        str65 = str21;
                                                        str71 = str17;
                                                        arrayList24 = arrayList9;
                                                        arrayList = arrayList2;
                                                        n3 = i4;
                                                        str73 = str12;
                                                        str49 = str10;
                                                        str63 = str13;
                                                        i14 = i3;
                                                        arrayList21 = arrayList6;
                                                        str74 = str15;
                                                        str48 = str6;
                                                        str59 = str5;
                                                        str58 = str7;
                                                        str62 = str8;
                                                        cVar7 = this;
                                                        str68 = str22;
                                                        str72 = str18;
                                                        i15 = i2;
                                                        arrayList25 = arrayList8;
                                                        j16 = j7;
                                                        arrayList26 = arrayList7;
                                                        str64 = str14;
                                                    } else {
                                                        ArrayList arrayList34 = new ArrayList(arrayList7.size());
                                                        int i32 = 0;
                                                        while (i32 < arrayList7.size()) {
                                                            a aVar3 = (a) arrayList7.get(i32);
                                                            Format format = aVar3.a;
                                                            if (str70 != null) {
                                                                format = new Format(format.c, str70, format.f262e, format.f263f, format.f264g, format.f265h, format.f266i, format.f267j, format.f268k, format.f269l, format.f270m, format.f271n, format.f272o, format.p, format.q, format.r, format.s, format.t, format.v, format.u, format.w, format.x, format.y, format.z, format.A, format.B, format.C, format.D, format.E);
                                                            }
                                                            String str90 = aVar3.f3496d;
                                                            if (str90 == null) {
                                                                str90 = str75;
                                                            }
                                                            ArrayList<DrmInitData.SchemeData> arrayList35 = aVar3.f3497e;
                                                            ArrayList arrayList36 = arrayList6;
                                                            arrayList35.addAll(arrayList36);
                                                            if (arrayList35.isEmpty()) {
                                                                arrayList6 = arrayList36;
                                                                arrayList14 = arrayList7;
                                                            } else {
                                                                int size = arrayList35.size() - 1;
                                                                while (size >= 0) {
                                                                    DrmInitData.SchemeData schemeData = arrayList35.get(size);
                                                                    if (schemeData.b()) {
                                                                        arrayList15 = arrayList36;
                                                                        arrayList16 = arrayList7;
                                                                    } else {
                                                                        arrayList15 = arrayList36;
                                                                        arrayList16 = arrayList7;
                                                                        int i33 = 0;
                                                                        while (true) {
                                                                            if (i33 < arrayList35.size()) {
                                                                                DrmInitData.SchemeData schemeData2 = arrayList35.get(i33);
                                                                                if (schemeData2.b() && !schemeData.b() && schemeData2.e(schemeData.f276d)) {
                                                                                    arrayList35.remove(size);
                                                                                } else {
                                                                                    i33++;
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    size--;
                                                                    arrayList7 = arrayList16;
                                                                    arrayList36 = arrayList15;
                                                                }
                                                                arrayList6 = arrayList36;
                                                                arrayList14 = arrayList7;
                                                                format = format.b(new DrmInitData(str90, false, (DrmInitData.SchemeData[]) arrayList35.toArray(new DrmInitData.SchemeData[0])), format.f266i);
                                                            }
                                                            Format format2 = format;
                                                            ArrayList<d> arrayList37 = aVar3.f3498f;
                                                            arrayList37.addAll(arrayList10);
                                                            long j19 = aVar3.f3499g;
                                                            String str91 = aVar3.b;
                                                            j jVar4 = aVar3.c;
                                                            if (jVar4 instanceof j.e) {
                                                                bVar = new i.c(j19, format2, str91, (j.e) jVar4, arrayList37, null, -1L);
                                                            } else if (jVar4 instanceof j.a) {
                                                                bVar = new i.b(j19, format2, str91, (j.a) jVar4, arrayList37);
                                                            } else {
                                                                throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase");
                                                            }
                                                            arrayList34.add(bVar);
                                                            i32++;
                                                            arrayList7 = arrayList14;
                                                        }
                                                        arrayList3.add(new g.h.a.a.k1.l0.k.a(n2, i17, arrayList34, arrayList23, arrayList8));
                                                        cVar2 = this;
                                                        xmlPullParser6 = xmlPullParser;
                                                        j9 = j12;
                                                        arrayList4 = arrayList20;
                                                    }
                                                }
                                                str26 = str12;
                                                str5 = str59;
                                                str6 = str48;
                                                str7 = str58;
                                                arrayList8 = arrayList25;
                                                str13 = str63;
                                                arrayList6 = arrayList21;
                                                str14 = str64;
                                                str15 = str74;
                                                str10 = str49;
                                                j7 = j16;
                                                str8 = str62;
                                                arrayList7 = arrayList26;
                                                j11 = j17;
                                                i2 = i15;
                                                str16 = str69;
                                                str17 = str71;
                                                str18 = str72;
                                                i3 = i14;
                                                i4 = n3;
                                                arrayList2 = arrayList;
                                                str19 = str67;
                                                str20 = str68;
                                                arrayList9 = arrayList24;
                                                str21 = str65;
                                                xmlPullParser3 = xmlPullParser;
                                                str24 = str16;
                                                xmlPullParser4 = xmlPullParser8;
                                                str12 = str26;
                                                str23 = str19;
                                                str22 = str20;
                                                arrayList10 = arrayList22;
                                                j12 = j11;
                                            } else if (z5) {
                                                str12 = str73;
                                                arrayList5 = arrayList24;
                                                str5 = str59;
                                                str6 = str48;
                                                str7 = str58;
                                                arrayList8 = arrayList25;
                                                xmlPullParser4 = xmlPullParser8;
                                                str13 = str63;
                                                arrayList6 = arrayList21;
                                                str14 = str64;
                                                str15 = str74;
                                                str10 = str49;
                                                j7 = j16;
                                                str8 = str62;
                                                arrayList7 = arrayList26;
                                                j12 = j17;
                                                str22 = str68;
                                                i2 = i15;
                                                str24 = str69;
                                                arrayList10 = arrayList22;
                                                str17 = str71;
                                                arrayList9 = arrayList5;
                                                str18 = str72;
                                                i3 = i14;
                                                i4 = n3;
                                                arrayList2 = arrayList;
                                                str23 = str67;
                                                str21 = str65;
                                            } else {
                                                str26 = cVar7.g(xmlPullParser8, str73);
                                                z5 = true;
                                                str5 = str59;
                                                str6 = str48;
                                                str7 = str58;
                                                arrayList8 = arrayList25;
                                                str13 = str63;
                                                arrayList6 = arrayList21;
                                                str14 = str64;
                                                str15 = str74;
                                                str10 = str49;
                                                j7 = j16;
                                                str8 = str62;
                                                arrayList7 = arrayList26;
                                                j11 = j17;
                                                i2 = i15;
                                                str16 = str69;
                                                str17 = str71;
                                                str18 = str72;
                                                i3 = i14;
                                                i4 = n3;
                                                arrayList2 = arrayList;
                                                str19 = str67;
                                                str20 = str68;
                                                arrayList9 = arrayList24;
                                                str21 = str65;
                                                xmlPullParser3 = xmlPullParser;
                                                str24 = str16;
                                                xmlPullParser4 = xmlPullParser8;
                                                str12 = str26;
                                                str23 = str19;
                                                str22 = str20;
                                                arrayList10 = arrayList22;
                                                j12 = j11;
                                            }
                                            xmlPullParser5 = xmlPullParser4;
                                            str25 = str66;
                                            if (g.h.a.a.p1.e.s0(xmlPullParser5, str25)) {
                                            }
                                        }
                                    } else {
                                        str5 = str59;
                                        str6 = str48;
                                        str7 = str58;
                                        str8 = str60;
                                        ArrayList arrayList38 = arrayList19;
                                        str9 = str56;
                                        str10 = str49;
                                        arrayList2 = arrayList;
                                        j7 = j16;
                                        ArrayList arrayList39 = arrayList18;
                                        long j20 = l8;
                                        if (g.h.a.a.p1.e.w0(xmlPullParser6, "EventStream")) {
                                            String str92 = str9;
                                            String attributeValue14 = xmlPullParser6.getAttributeValue(null, str92);
                                            if (attributeValue14 == null) {
                                                attributeValue14 = "";
                                            }
                                            String str93 = str5;
                                            String attributeValue15 = xmlPullParser6.getAttributeValue(null, str93);
                                            if (attributeValue15 == null) {
                                                attributeValue15 = "";
                                            }
                                            long o2 = o(xmlPullParser6, "timescale", 1L);
                                            ArrayList arrayList40 = new ArrayList();
                                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
                                            while (true) {
                                                xmlPullParser.next();
                                                String str94 = "Event";
                                                if (g.h.a.a.p1.e.w0(xmlPullParser6, "Event")) {
                                                    str9 = str92;
                                                    long o3 = o(xmlPullParser6, str7, 0L);
                                                    long o4 = o(xmlPullParser6, str8, -9223372036854775807L);
                                                    long o5 = o(xmlPullParser6, "presentationTime", 0L);
                                                    long F = d0.F(o4, 1000L, o2);
                                                    long F2 = d0.F(o5, 1000000L, o2);
                                                    str5 = str93;
                                                    String attributeValue16 = xmlPullParser6.getAttributeValue(null, "messageData");
                                                    if (attributeValue16 == null) {
                                                        attributeValue16 = null;
                                                    }
                                                    byteArrayOutputStream.reset();
                                                    XmlSerializer newSerializer = Xml.newSerializer();
                                                    arrayList3 = arrayList39;
                                                    newSerializer.setOutput(byteArrayOutputStream, "UTF-8");
                                                    xmlPullParser.nextToken();
                                                    while (!g.h.a.a.p1.e.s0(xmlPullParser6, str94)) {
                                                        switch (xmlPullParser.getEventType()) {
                                                            case 0:
                                                                str11 = str94;
                                                                j10 = j20;
                                                                newSerializer.startDocument(null, Boolean.FALSE);
                                                                break;
                                                            case 1:
                                                                str11 = str94;
                                                                j10 = j20;
                                                                newSerializer.endDocument();
                                                                break;
                                                            case 2:
                                                                str11 = str94;
                                                                newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                                                                int i34 = 0;
                                                                while (i34 < xmlPullParser.getAttributeCount()) {
                                                                    newSerializer.attribute(xmlPullParser6.getAttributeNamespace(i34), xmlPullParser6.getAttributeName(i34), xmlPullParser6.getAttributeValue(i34));
                                                                    i34++;
                                                                    j20 = j20;
                                                                }
                                                                j10 = j20;
                                                                break;
                                                            case 3:
                                                                str11 = str94;
                                                                newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                                                                j10 = j20;
                                                                break;
                                                            case 4:
                                                                newSerializer.text(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 5:
                                                                newSerializer.cdsect(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 6:
                                                                newSerializer.entityRef(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 7:
                                                                newSerializer.ignorableWhitespace(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 8:
                                                                newSerializer.processingInstruction(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 9:
                                                                newSerializer.comment(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            case 10:
                                                                newSerializer.docdecl(xmlPullParser.getText());
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                            default:
                                                                str11 = str94;
                                                                j10 = j20;
                                                                break;
                                                        }
                                                        xmlPullParser.nextToken();
                                                        str94 = str11;
                                                        j20 = j10;
                                                    }
                                                    j9 = j20;
                                                    newSerializer.flush();
                                                    byte[] byteArray = byteArrayOutputStream.toByteArray();
                                                    Long valueOf = Long.valueOf(F2);
                                                    if (attributeValue16 != null) {
                                                        byteArray = d0.t(attributeValue16);
                                                    }
                                                    arrayList40.add(Pair.create(valueOf, new EventMessage(attributeValue14, attributeValue15, F, o3, byteArray)));
                                                } else {
                                                    j9 = j20;
                                                    arrayList3 = arrayList39;
                                                    str9 = str92;
                                                    str5 = str93;
                                                    d(xmlPullParser);
                                                }
                                                if (g.h.a.a.p1.e.s0(xmlPullParser6, "EventStream")) {
                                                    long[] jArr = new long[arrayList40.size()];
                                                    EventMessage[] eventMessageArr = new EventMessage[arrayList40.size()];
                                                    for (int i35 = 0; i35 < arrayList40.size(); i35++) {
                                                        Pair pair = (Pair) arrayList40.get(i35);
                                                        jArr[i35] = ((Long) pair.first).longValue();
                                                        eventMessageArr[i35] = (EventMessage) pair.second;
                                                    }
                                                    arrayList4 = arrayList38;
                                                    arrayList4.add(new e(attributeValue14, attributeValue15, o2, jArr, eventMessageArr));
                                                    cVar2 = cVar6;
                                                } else {
                                                    str92 = str9;
                                                    arrayList39 = arrayList3;
                                                    j20 = j9;
                                                    str93 = str5;
                                                }
                                            }
                                        } else {
                                            arrayList3 = arrayList39;
                                            arrayList4 = arrayList38;
                                            if (g.h.a.a.p1.e.w0(xmlPullParser6, "SegmentBase")) {
                                                cVar = cVar6;
                                                jVar = cVar.r(xmlPullParser6, null);
                                                xmlPullParser2 = xmlPullParser;
                                                j8 = j20;
                                            } else {
                                                cVar = cVar6;
                                                if (g.h.a.a.p1.e.w0(xmlPullParser6, "SegmentList")) {
                                                    j8 = j20;
                                                    jVar = cVar.s(xmlPullParser6, null, j8);
                                                } else {
                                                    j8 = j20;
                                                    if (g.h.a.a.p1.e.w0(xmlPullParser6, "SegmentTemplate")) {
                                                        xmlPullParser2 = xmlPullParser;
                                                        jVar = t(xmlPullParser2, null, Collections.emptyList(), j8);
                                                        xmlPullParser6 = xmlPullParser6;
                                                    } else {
                                                        d(xmlPullParser);
                                                    }
                                                }
                                                xmlPullParser2 = xmlPullParser;
                                            }
                                        }
                                    }
                                    cVar = cVar2;
                                    j8 = j9;
                                    xmlPullParser2 = xmlPullParser;
                                } else if (z4) {
                                    str5 = str59;
                                    str6 = str48;
                                    str7 = str58;
                                    str8 = str60;
                                    arrayList3 = arrayList18;
                                    arrayList4 = arrayList19;
                                    cVar = cVar5;
                                    str9 = str56;
                                    str4 = str57;
                                    z = equals;
                                    str10 = str49;
                                    arrayList2 = arrayList;
                                    xmlPullParser2 = xmlPullParser7;
                                    j7 = j16;
                                    j8 = l8;
                                    str3 = str61;
                                } else {
                                    str61 = cVar5.g(xmlPullParser6, str61);
                                    z4 = true;
                                    str5 = str59;
                                    str6 = str48;
                                    str7 = str58;
                                    str8 = str60;
                                    arrayList3 = arrayList18;
                                    arrayList4 = arrayList19;
                                    cVar = cVar5;
                                    str9 = str56;
                                    str46 = str57;
                                    z = equals;
                                    str10 = str49;
                                    arrayList2 = arrayList;
                                    j7 = j16;
                                    j8 = l8;
                                    if (g.h.a.a.p1.e.s0(xmlPullParser6, str46)) {
                                        str57 = str46;
                                        arrayList19 = arrayList4;
                                        l8 = j8;
                                        equals = z;
                                        str56 = str9;
                                        arrayList = arrayList2;
                                        str49 = str10;
                                        str48 = str6;
                                        j16 = j7;
                                        str59 = str5;
                                        str58 = str7;
                                        str60 = str8;
                                        cVar5 = cVar;
                                        arrayList18 = arrayList3;
                                    } else {
                                        Pair create = Pair.create(new f(attributeValue5, l7, arrayList3, arrayList4), Long.valueOf(j8));
                                        f fVar = (f) create.first;
                                        if (fVar.b != -9223372036854775807L) {
                                            long longValue = ((Long) create.second).longValue();
                                            j15 = longValue == -9223372036854775807L ? -9223372036854775807L : longValue + fVar.b;
                                            arrayList17 = arrayList2;
                                            arrayList17.add(fVar);
                                        } else if (!z) {
                                            StringBuilder P = g.b.a.a.a.P("Unable to determine start of period ");
                                            P.append(arrayList2.size());
                                            throw new l0(P.toString());
                                        } else {
                                            arrayList17 = arrayList2;
                                            j15 = j7;
                                            z3 = true;
                                        }
                                        xmlPullParser6 = xmlPullParser7;
                                    }
                                }
                                str61 = str3;
                                xmlPullParser7 = xmlPullParser2;
                                str46 = str4;
                                if (g.h.a.a.p1.e.s0(xmlPullParser6, str46)) {
                                }
                            }
                        } else {
                            j4 = j15;
                            j5 = C;
                            j6 = l2;
                            z = equals;
                            arrayList17 = arrayList;
                            d(xmlPullParser);
                            j15 = j4;
                            str47 = str2;
                            uri = uri2;
                        }
                    }
                }
                str47 = str2;
                j5 = C;
                j6 = l2;
                z = equals;
                uri = uri2;
                arrayList17 = arrayList;
            } else if (z2) {
                j4 = j15;
                j5 = C;
                j6 = l2;
                j3 = l3;
                z = equals;
                j2 = l4;
                str2 = str47;
                j15 = j4;
                str47 = str2;
                uri = uri2;
            } else {
                str47 = cVar4.g(xmlPullParser6, str47);
                z2 = true;
                arrayList = arrayList17;
                j3 = l3;
                j2 = l4;
                j5 = C;
                j6 = l2;
                z = equals;
                uri = uri2;
                arrayList17 = arrayList;
            }
            if (g.h.a.a.p1.e.s0(xmlPullParser6, "MPD")) {
                if (j6 == -9223372036854775807L) {
                    if (j15 != -9223372036854775807L) {
                        j14 = j15;
                        if (arrayList17.isEmpty()) {
                            return new b(j5, j14, j3, z, j2, l5, l6, C2, gVar, mVar, uri, arrayList17);
                        }
                        throw new l0("No periods found.");
                    } else if (!z) {
                        throw new l0("Unable to determine duration of static manifest.");
                    }
                }
                j14 = j6;
                if (arrayList17.isEmpty()) {
                }
            } else {
                cVar4 = this;
                uri2 = uri;
                l4 = j2;
                l3 = j3;
                C = j5;
                l2 = j6;
                equals = z;
            }
        }
    }

    public h q(XmlPullParser xmlPullParser, String str, String str2) {
        long j2;
        long j3;
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        String attributeValue2 = xmlPullParser.getAttributeValue(null, str2);
        if (attributeValue2 != null) {
            String[] split = attributeValue2.split("-");
            j2 = Long.parseLong(split[0]);
            if (split.length == 2) {
                j3 = (Long.parseLong(split[1]) - j2) + 1;
                return new h(attributeValue, j2, j3);
            }
        } else {
            j2 = 0;
        }
        j3 = -1;
        return new h(attributeValue, j2, j3);
    }

    public j.e r(XmlPullParser xmlPullParser, @Nullable j.e eVar) {
        long j2;
        long j3;
        long o2 = o(xmlPullParser, "timescale", eVar != null ? eVar.b : 1L);
        long o3 = o(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.c : 0L);
        long j4 = eVar != null ? eVar.f3518d : 0L;
        long j5 = eVar != null ? eVar.f3519e : 0L;
        String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
        if (attributeValue != null) {
            String[] split = attributeValue.split("-");
            long parseLong = Long.parseLong(split[0]);
            j2 = (Long.parseLong(split[1]) - parseLong) + 1;
            j3 = parseLong;
        } else {
            j2 = j5;
            j3 = j4;
        }
        h hVar = eVar != null ? eVar.a : null;
        do {
            xmlPullParser.next();
            if (g.h.a.a.p1.e.w0(xmlPullParser, "Initialization")) {
                hVar = q(xmlPullParser, "sourceURL", "range");
            } else {
                d(xmlPullParser);
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "SegmentBase"));
        return new j.e(hVar, o2, o3, j3, j2);
    }

    public j.b s(XmlPullParser xmlPullParser, @Nullable j.b bVar, long j2) {
        h hVar;
        List list;
        List<j.d> list2;
        long o2 = o(xmlPullParser, "timescale", bVar != null ? bVar.b : 1L);
        long o3 = o(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.c : 0L);
        long o4 = o(xmlPullParser, "duration", bVar != null ? bVar.f3512e : -9223372036854775807L);
        long o5 = o(xmlPullParser, "startNumber", bVar != null ? bVar.f3511d : 1L);
        List<j.d> list3 = null;
        List list4 = null;
        h hVar2 = null;
        do {
            xmlPullParser.next();
            if (g.h.a.a.p1.e.w0(xmlPullParser, "Initialization")) {
                hVar2 = q(xmlPullParser, "sourceURL", "range");
            } else if (g.h.a.a.p1.e.w0(xmlPullParser, "SegmentTimeline")) {
                list3 = u(xmlPullParser, o2, j2);
            } else if (g.h.a.a.p1.e.w0(xmlPullParser, "SegmentURL")) {
                if (list4 == null) {
                    list4 = new ArrayList();
                }
                List list5 = list4;
                list5.add(q(xmlPullParser, "media", "mediaRange"));
                list4 = list5;
            } else {
                d(xmlPullParser);
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "SegmentList"));
        if (bVar != null) {
            if (hVar2 == null) {
                hVar2 = bVar.a;
            }
            if (list3 == null) {
                list3 = bVar.f3513f;
            }
            if (list4 == null) {
                list2 = list3;
                hVar = hVar2;
                list = bVar.f3514g;
                return new j.b(hVar, o2, o3, o5, o4, list2, list);
            }
        }
        hVar = hVar2;
        list = list4;
        list2 = list3;
        return new j.b(hVar, o2, o3, o5, o4, list2, list);
    }

    public j.c t(XmlPullParser xmlPullParser, @Nullable j.c cVar, List<d> list, long j2) {
        long j3;
        long o2 = o(xmlPullParser, "timescale", cVar != null ? cVar.b : 1L);
        long o3 = o(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.c : 0L);
        long o4 = o(xmlPullParser, "duration", cVar != null ? cVar.f3512e : -9223372036854775807L);
        long o5 = o(xmlPullParser, "startNumber", cVar != null ? cVar.f3511d : 1L);
        int i2 = 0;
        while (true) {
            if (i2 >= list.size()) {
                j3 = -1;
                break;
            }
            d dVar = list.get(i2);
            if ("http://dashif.org/guidelines/last-segment-number".equalsIgnoreCase(dVar.a)) {
                j3 = Long.parseLong(dVar.b);
                break;
            }
            i2++;
        }
        long j4 = j3;
        List<j.d> list2 = null;
        l w = w(xmlPullParser, "media", cVar != null ? cVar.f3516h : null);
        l w2 = w(xmlPullParser, "initialization", cVar != null ? cVar.f3515g : null);
        h hVar = null;
        do {
            xmlPullParser.next();
            if (g.h.a.a.p1.e.w0(xmlPullParser, "Initialization")) {
                hVar = q(xmlPullParser, "sourceURL", "range");
            } else if (g.h.a.a.p1.e.w0(xmlPullParser, "SegmentTimeline")) {
                list2 = u(xmlPullParser, o2, j2);
            } else {
                d(xmlPullParser);
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "SegmentTemplate"));
        if (cVar != null) {
            if (hVar == null) {
                hVar = cVar.a;
            }
            if (list2 == null) {
                list2 = cVar.f3513f;
            }
        }
        return new j.c(hVar, o2, o3, o5, j4, o4, list2, w2, w);
    }

    public List<j.d> u(XmlPullParser xmlPullParser, long j2, long j3) {
        ArrayList arrayList = new ArrayList();
        long j4 = 0;
        long j5 = -9223372036854775807L;
        boolean z = false;
        int i2 = 0;
        do {
            xmlPullParser.next();
            if (g.h.a.a.p1.e.w0(xmlPullParser, ExifInterface.LATITUDE_SOUTH)) {
                long o2 = o(xmlPullParser, "t", -9223372036854775807L);
                if (z) {
                    j4 = b(arrayList, j4, j5, i2, o2);
                }
                if (o2 == -9223372036854775807L) {
                    o2 = j4;
                }
                j5 = o(xmlPullParser, "d", -9223372036854775807L);
                i2 = n(xmlPullParser, "r", 0);
                j4 = o2;
                z = true;
            } else {
                d(xmlPullParser);
            }
        } while (!g.h.a.a.p1.e.s0(xmlPullParser, "SegmentTimeline"));
        if (z) {
            b(arrayList, j4, j5, i2, d0.F(j3, j2, 1000L));
        }
        return arrayList;
    }

    @Nullable
    public l w(XmlPullParser xmlPullParser, String str, @Nullable l lVar) {
        String str2;
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        if (attributeValue != null) {
            String[] strArr = new String[5];
            int[] iArr = new int[4];
            String[] strArr2 = new String[4];
            strArr[0] = "";
            int i2 = 0;
            int i3 = 0;
            while (i2 < attributeValue.length()) {
                int indexOf = attributeValue.indexOf("$", i2);
                if (indexOf == -1) {
                    strArr[i3] = strArr[i3] + attributeValue.substring(i2);
                    i2 = attributeValue.length();
                } else if (indexOf != i2) {
                    strArr[i3] = strArr[i3] + attributeValue.substring(i2, indexOf);
                    i2 = indexOf;
                } else if (attributeValue.startsWith("$$", i2)) {
                    strArr[i3] = g.b.a.a.a.K(new StringBuilder(), strArr[i3], "$");
                    i2 += 2;
                } else {
                    int i4 = i2 + 1;
                    int indexOf2 = attributeValue.indexOf("$", i4);
                    String substring = attributeValue.substring(i4, indexOf2);
                    if (substring.equals("RepresentationID")) {
                        iArr[i3] = 1;
                    } else {
                        int indexOf3 = substring.indexOf("%0");
                        if (indexOf3 != -1) {
                            str2 = substring.substring(indexOf3);
                            if (!str2.endsWith("d") && !str2.endsWith("x")) {
                                str2 = g.b.a.a.a.E(str2, "d");
                            }
                            substring = substring.substring(0, indexOf3);
                        } else {
                            str2 = "%01d";
                        }
                        substring.hashCode();
                        substring.hashCode();
                        char c2 = 65535;
                        switch (substring.hashCode()) {
                            case -1950496919:
                                if (substring.equals("Number")) {
                                    c2 = 0;
                                    break;
                                }
                                break;
                            case 2606829:
                                if (substring.equals("Time")) {
                                    c2 = 1;
                                    break;
                                }
                                break;
                            case 38199441:
                                if (substring.equals("Bandwidth")) {
                                    c2 = 2;
                                    break;
                                }
                                break;
                        }
                        switch (c2) {
                            case 0:
                                iArr[i3] = 2;
                                break;
                            case 1:
                                iArr[i3] = 4;
                                break;
                            case 2:
                                iArr[i3] = 3;
                                break;
                            default:
                                throw new IllegalArgumentException(g.b.a.a.a.E("Invalid template: ", attributeValue));
                        }
                        strArr2[i3] = str2;
                    }
                    i3++;
                    strArr[i3] = "";
                    i2 = indexOf2 + 1;
                }
            }
            return new l(strArr, iArr, strArr2, i3);
        }
        return lVar;
    }
}