海角 v1.5.2版本的 MD5 值为:66a890a3993572bcf201f98e8ab772a0

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


package d.g.a.a.h1.j0.j;

import android.net.Uri;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.util.Pair;
import android.util.Xml;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import b.o.a.n;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.metadata.emsg.EventMessage;
import d.g.a.a.h1.j0.j.i;
import d.g.a.a.h1.j0.j.j;
import d.g.a.a.l1.w;
import d.g.a.a.m1.b0;
import d.g.a.a.m1.o;
import d.g.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;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
public class c extends DefaultHandler implements w.a<b> {
    public static final Pattern f10732a = Pattern.compile("(\\d+)(?:/(\\d+))?");
    public static final Pattern f10733b = Pattern.compile("CC([1-4])=.*");
    public static final Pattern f10734c = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");
    public final XmlPullParserFactory f10735d;

    public static final class a {
        public final Format f10736a;
        public final String f10737b;
        public final j f10738c;
        public final String f10739d;
        public final ArrayList<DrmInitData.SchemeData> f10740e;
        public final ArrayList<d> f10741f;
        public final long f10742g;

        public a(Format format, String str, j jVar, String str2, ArrayList<DrmInitData.SchemeData> arrayList, ArrayList<d> arrayList2, long j2) {
            this.f10736a = format;
            this.f10737b = str;
            this.f10738c = jVar;
            this.f10739d = str2;
            this.f10740e = arrayList;
            this.f10741f = arrayList2;
            this.f10742g = j2;
        }
    }

    public c() {
        try {
            this.f10735d = 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;
        }
        n.H(i2 == i3);
        return i2;
    }

    public static void d(XmlPullParser xmlPullParser) {
        if (n.Y0(xmlPullParser)) {
            int i2 = 1;
            while (i2 != 0) {
                xmlPullParser.next();
                if (n.Y0(xmlPullParser)) {
                    i2++;
                } else {
                    if (xmlPullParser.getEventType() == 3) {
                        i2--;
                    }
                }
            }
        }
    }

    public static boolean e(String str) {
        return o.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 (!n.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 = b0.f11593h.matcher(attributeValue);
        if (matcher.matches()) {
            boolean isEmpty = true ^ TextUtils.isEmpty(matcher.group(1));
            String group = matcher.group(3);
            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);
            long parseDouble6 = (long) ((parseDouble5 + (group6 != null ? Double.parseDouble(group6) : 0.0d)) * 1000.0d);
            return isEmpty ? -parseDouble6 : parseDouble6;
        }
        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 = f10732a.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 (!n.S0(xmlPullParser, str));
        return str2;
    }

    @Override
    public b a(Uri uri, InputStream inputStream) {
        try {
            XmlPullParser newPullParser = this.f10735d.newPullParser();
            newPullParser.setInput(inputStream, null);
            if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
                return p(newPullParser, uri.toString());
            }
            throw new ParserException("inputStream does not contain a valid media presentation description");
        } catch (XmlPullParserException e2) {
            throw new ParserException(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 = b0.f11586a;
            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 N;
        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)) && (N = b0.N(xmlPullParser.getAttributeValue(null, "value"))) != null) {
            switch (N.hashCode()) {
                case 1596796:
                    if (N.equals("4000")) {
                        c2 = 0;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 2937391:
                    if (N.equals("a000")) {
                        c2 = 1;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 3094035:
                    if (N.equals("f801")) {
                        c2 = 2;
                        break;
                    }
                    c2 = 65535;
                    break;
                case 3133436:
                    if (N.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 (!n.S0(xmlPullParser, "AudioChannelConfiguration"));
        return i2;
    }

    public String g(XmlPullParser xmlPullParser, String str) {
        return n.R1(str, v(xmlPullParser, "BaseURL"));
    }

    public Pair<String, DrmInitData.SchemeData> h(XmlPullParser xmlPullParser) {
        String str;
        UUID uuid;
        byte[] bArr;
        String str2;
        boolean z;
        UUID G1;
        char c2;
        UUID uuid2;
        String str3;
        String attributeValue = xmlPullParser.getAttributeValue(null, "schemeIdUri");
        if (attributeValue != null) {
            String N = b0.N(attributeValue);
            N.hashCode();
            int hashCode = N.hashCode();
            if (hashCode == 489446379) {
                if (N.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 && N.equals("urn:mpeg:dash:mp4protection:2011")) {
                    c2 = 2;
                    if (c2 != 0) {
                        uuid2 = v.f11831e;
                    } else if (c2 == 1) {
                        uuid2 = v.f11830d;
                    } 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.f11828b;
                            bArr = n.z(uuid, uuidArr, null);
                            str2 = null;
                            do {
                                xmlPullParser.next();
                                if (n.Z0(xmlPullParser, "ms:laurl")) {
                                    str2 = xmlPullParser.getAttributeValue(null, "licenseUrl");
                                } else {
                                    if (bArr == null) {
                                        if (n.Y0(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);
                                                    G1 = n.G1(decode);
                                                    if (G1 != null) {
                                                        Log.w("MpdParser", "Skipping malformed cenc:pssh data");
                                                        uuid = G1;
                                                        bArr = null;
                                                    } else {
                                                        bArr = decode;
                                                        uuid = G1;
                                                    }
                                                }
                                            }
                                        }
                                        z = false;
                                        if (z) {
                                            byte[] decode2 = Base64.decode(xmlPullParser.getText(), 0);
                                            G1 = n.G1(decode2);
                                            if (G1 != null) {
                                            }
                                        }
                                    }
                                    if (bArr == null) {
                                        UUID uuid3 = v.f11831e;
                                        if (uuid3.equals(uuid) && n.Z0(xmlPullParser, "mspr:pro") && xmlPullParser.next() == 4) {
                                            bArr = n.y(uuid3, Base64.decode(xmlPullParser.getText(), 0));
                                        }
                                    }
                                    d(xmlPullParser);
                                }
                            } while (!n.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 (N.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 (n.Z0(xmlPullParser, "ms:laurl")) {
                }
            } while (!n.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 (n.Z0(xmlPullParser, "ms:laurl")) {
            }
        } while (!n.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(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;
        long j8;
        ArrayList arrayList3;
        ArrayList arrayList4;
        c cVar;
        long j9;
        XmlPullParser xmlPullParser2;
        c cVar2;
        String str11;
        long j10;
        String str12;
        ArrayList arrayList5;
        String str13;
        ArrayList arrayList6;
        String str14;
        String str15;
        ArrayList arrayList7;
        int i2;
        String str16;
        ArrayList arrayList8;
        String str17;
        int i3;
        int i4;
        ArrayList arrayList9;
        String str18;
        String str19;
        String str20;
        long j11;
        String str21;
        ArrayList arrayList10;
        XmlPullParser xmlPullParser3;
        XmlPullParser xmlPullParser4;
        j t;
        c cVar3;
        String str22;
        String str23;
        String str24;
        long j12;
        String str25;
        ArrayList arrayList11;
        String str26;
        String str27;
        int i5;
        String str28;
        String str29;
        String str30;
        ArrayList arrayList12;
        j t2;
        String str31;
        String str32;
        String str33;
        String str34;
        String str35;
        String g2;
        int i6;
        String str36;
        ArrayList arrayList13;
        int i7;
        int i8;
        int i9;
        Format createContainerFormat;
        String str37;
        int i10;
        int i11;
        String str38;
        int parseInt;
        String str39;
        String str40;
        int i12;
        char c2;
        String str41;
        String str42;
        String str43;
        String str44;
        ArrayList arrayList14;
        i bVar;
        ArrayList arrayList15;
        String str45;
        m mVar;
        Uri uri;
        long j13;
        c cVar4 = this;
        String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityStartTime");
        long E = attributeValue == null ? -9223372036854775807L : b0.E(attributeValue);
        long l2 = l(xmlPullParser, "mediaPresentationDuration", -9223372036854775807L);
        long l3 = l(xmlPullParser, "minBufferTime", -9223372036854775807L);
        boolean equals = "dynamic".equals(xmlPullParser.getAttributeValue(null, IjkMediaMeta.IJKM_KEY_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 E2 = attributeValue2 == null ? -9223372036854775807L : b0.E(attributeValue2);
        ArrayList arrayList16 = new ArrayList();
        long j14 = equals ? -9223372036854775807L : 0L;
        String str46 = str;
        m mVar2 = null;
        Uri uri2 = null;
        g gVar = null;
        XmlPullParser xmlPullParser5 = xmlPullParser;
        boolean z2 = false;
        boolean z3 = false;
        while (true) {
            xmlPullParser.next();
            String str47 = "BaseURL";
            if (!n.Z0(xmlPullParser5, "BaseURL")) {
                arrayList = arrayList16;
                j2 = l4;
                String str48 = "lang";
                if (n.Z0(xmlPullParser5, "ProgramInformation")) {
                    str2 = str46;
                    String attributeValue3 = xmlPullParser5.getAttributeValue(null, "moreInformationURL");
                    String str49 = attributeValue3 == null ? null : attributeValue3;
                    String attributeValue4 = xmlPullParser5.getAttributeValue(null, "lang");
                    if (attributeValue4 == null) {
                        attributeValue4 = null;
                    }
                    String str50 = attributeValue4;
                    String str51 = null;
                    String str52 = null;
                    String str53 = null;
                    do {
                        xmlPullParser.next();
                        String str54 = str51;
                        if (n.Z0(xmlPullParser5, "Title")) {
                            str51 = xmlPullParser.nextText();
                        } else {
                            if (n.Z0(xmlPullParser5, "Source")) {
                                str52 = xmlPullParser.nextText();
                            } else if (n.Z0(xmlPullParser5, "Copyright")) {
                                str53 = xmlPullParser.nextText();
                            } else {
                                d(xmlPullParser);
                            }
                            str51 = str54;
                        }
                    } while (!n.S0(xmlPullParser5, "ProgramInformation"));
                    gVar = new g(str51, str52, str53, str49, str50);
                    j3 = l3;
                } else {
                    str2 = str46;
                    j3 = l3;
                    String str55 = "schemeIdUri";
                    if (n.Z0(xmlPullParser5, "UTCTiming")) {
                        mVar2 = new m(xmlPullParser5.getAttributeValue(null, "schemeIdUri"), xmlPullParser5.getAttributeValue(null, "value"));
                    } else if (n.Z0(xmlPullParser5, "Location")) {
                        uri2 = Uri.parse(xmlPullParser.nextText());
                    } else {
                        String str56 = "Period";
                        if (n.Z0(xmlPullParser5, "Period") && !z3) {
                            String str57 = "id";
                            String str58 = "value";
                            String attributeValue5 = xmlPullParser5.getAttributeValue(null, "id");
                            long l7 = l(xmlPullParser5, "start", j14);
                            String str59 = TypedValues.Transition.S_DURATION;
                            long j15 = j14;
                            long l8 = l(xmlPullParser5, TypedValues.Transition.S_DURATION, -9223372036854775807L);
                            j5 = E;
                            ArrayList arrayList17 = new ArrayList();
                            ArrayList arrayList18 = new ArrayList();
                            j6 = l2;
                            String str60 = str2;
                            j jVar = null;
                            boolean z4 = false;
                            XmlPullParser xmlPullParser6 = xmlPullParser5;
                            c cVar5 = cVar4;
                            while (true) {
                                xmlPullParser.next();
                                if (!n.Z0(xmlPullParser5, str47)) {
                                    str3 = str60;
                                    z = equals;
                                    str4 = str56;
                                    c cVar6 = cVar5;
                                    if (n.Z0(xmlPullParser5, "AdaptationSet")) {
                                        String str61 = str59;
                                        int n = n(xmlPullParser5, str57, -1);
                                        int i13 = i(xmlPullParser);
                                        ArrayList arrayList19 = arrayList18;
                                        String str62 = "mimeType";
                                        String attributeValue6 = xmlPullParser5.getAttributeValue(null, "mimeType");
                                        str9 = str55;
                                        String str63 = "codecs";
                                        String attributeValue7 = xmlPullParser5.getAttributeValue(null, "codecs");
                                        String str64 = "width";
                                        arrayList3 = arrayList17;
                                        String str65 = "AdaptationSet";
                                        int n2 = n(xmlPullParser5, "width", -1);
                                        int n3 = n(xmlPullParser5, "height", -1);
                                        String str66 = "SegmentTemplate";
                                        float m = m(xmlPullParser5, -1.0f);
                                        long j16 = l8;
                                        int n4 = n(xmlPullParser5, "audioSamplingRate", -1);
                                        String str67 = "SegmentList";
                                        String attributeValue8 = xmlPullParser5.getAttributeValue(null, str48);
                                        String str68 = "SegmentBase";
                                        String attributeValue9 = xmlPullParser5.getAttributeValue(null, "label");
                                        ArrayList arrayList20 = new ArrayList();
                                        ArrayList arrayList21 = new ArrayList();
                                        ArrayList arrayList22 = new ArrayList();
                                        String str69 = attributeValue9;
                                        ArrayList arrayList23 = new ArrayList();
                                        ArrayList arrayList24 = new ArrayList();
                                        String str70 = "audioSamplingRate";
                                        String str71 = "height";
                                        int i14 = n3;
                                        String str72 = str3;
                                        j jVar2 = jVar;
                                        String str73 = attributeValue8;
                                        boolean z5 = false;
                                        int i15 = -1;
                                        XmlPullParser xmlPullParser7 = xmlPullParser;
                                        int i16 = n4;
                                        c cVar7 = cVar6;
                                        String str74 = null;
                                        ArrayList arrayList25 = new ArrayList();
                                        int i17 = i13;
                                        while (true) {
                                            xmlPullParser.next();
                                            if (!n.Z0(xmlPullParser7, str47)) {
                                                if (n.Z0(xmlPullParser7, "ContentProtection")) {
                                                    Pair<String, DrmInitData.SchemeData> h2 = h(xmlPullParser);
                                                    str12 = str72;
                                                    Object obj = h2.first;
                                                    if (obj != null) {
                                                        str74 = (String) obj;
                                                    }
                                                    Object obj2 = h2.second;
                                                    if (obj2 != null) {
                                                        arrayList20.add(obj2);
                                                    }
                                                } else {
                                                    str12 = str72;
                                                    if (n.Z0(xmlPullParser7, "ContentComponent")) {
                                                        String attributeValue10 = xmlPullParser7.getAttributeValue(null, str48);
                                                        if (str73 == null) {
                                                            str73 = attributeValue10;
                                                        } else if (attributeValue10 != null) {
                                                            n.H(str73.equals(attributeValue10));
                                                        }
                                                        i17 = c(i17, i(xmlPullParser));
                                                    } else if (n.Z0(xmlPullParser7, "Role")) {
                                                        arrayList23.add(k(xmlPullParser7, "Role"));
                                                        arrayList5 = arrayList23;
                                                        str5 = str58;
                                                        str6 = str47;
                                                        str7 = str57;
                                                        arrayList8 = arrayList24;
                                                        xmlPullParser3 = xmlPullParser7;
                                                        str13 = str62;
                                                        arrayList6 = arrayList20;
                                                        str14 = str63;
                                                        str15 = str73;
                                                        str10 = str48;
                                                        j7 = j15;
                                                        str8 = str61;
                                                        arrayList7 = arrayList25;
                                                        j11 = j16;
                                                        str19 = str67;
                                                        i2 = i16;
                                                        str21 = str68;
                                                        str16 = str70;
                                                        arrayList9 = arrayList5;
                                                        str17 = str71;
                                                        i3 = i14;
                                                        xmlPullParser4 = xmlPullParser;
                                                        i4 = n2;
                                                        arrayList2 = arrayList;
                                                        str20 = str66;
                                                        str18 = str64;
                                                        arrayList10 = arrayList21;
                                                        str42 = str65;
                                                        str43 = str69;
                                                        if (n.S0(xmlPullParser3, str42)) {
                                                        }
                                                    } else {
                                                        String str75 = "AudioChannelConfiguration";
                                                        if (n.Z0(xmlPullParser7, "AudioChannelConfiguration")) {
                                                            i15 = f(xmlPullParser);
                                                        } else {
                                                            arrayList5 = arrayList23;
                                                            if (n.Z0(xmlPullParser7, "Accessibility")) {
                                                                arrayList22.add(k(xmlPullParser7, "Accessibility"));
                                                            } else if (n.Z0(xmlPullParser7, "SupplementalProperty")) {
                                                                arrayList24.add(k(xmlPullParser7, "SupplementalProperty"));
                                                            } else {
                                                                ArrayList arrayList26 = arrayList24;
                                                                str10 = str48;
                                                                if (n.Z0(xmlPullParser7, "Representation")) {
                                                                    String str76 = "SupplementalProperty";
                                                                    String attributeValue11 = xmlPullParser7.getAttributeValue(null, str57);
                                                                    int i18 = i17;
                                                                    int n5 = n(xmlPullParser7, "bandwidth", -1);
                                                                    String attributeValue12 = xmlPullParser7.getAttributeValue(null, str62);
                                                                    if (attributeValue12 == null) {
                                                                        attributeValue12 = attributeValue6;
                                                                    }
                                                                    String attributeValue13 = xmlPullParser7.getAttributeValue(null, str63);
                                                                    if (attributeValue13 == null) {
                                                                        attributeValue13 = attributeValue7;
                                                                    }
                                                                    int n6 = n(xmlPullParser7, str64, n2);
                                                                    str13 = str62;
                                                                    String str77 = str71;
                                                                    i4 = n2;
                                                                    int i19 = i14;
                                                                    int n7 = n(xmlPullParser7, str77, i19);
                                                                    float m2 = m(xmlPullParser7, m);
                                                                    String str78 = attributeValue12;
                                                                    String str79 = str70;
                                                                    int i20 = i16;
                                                                    String str80 = "ContentProtection";
                                                                    int i21 = i20;
                                                                    int n8 = n(xmlPullParser7, str79, i21);
                                                                    XmlPullParser xmlPullParser8 = xmlPullParser7;
                                                                    ArrayList arrayList27 = new ArrayList();
                                                                    ArrayList arrayList28 = new ArrayList();
                                                                    i3 = i19;
                                                                    ArrayList arrayList29 = new ArrayList();
                                                                    boolean z6 = false;
                                                                    String str81 = null;
                                                                    arrayList6 = arrayList20;
                                                                    str14 = str63;
                                                                    XmlPullParser xmlPullParser9 = xmlPullParser8;
                                                                    int i22 = i15;
                                                                    j jVar3 = jVar2;
                                                                    String str82 = str12;
                                                                    while (true) {
                                                                        xmlPullParser.next();
                                                                        if (n.Z0(xmlPullParser9, str47)) {
                                                                            if (z6) {
                                                                                str15 = str73;
                                                                                arrayList8 = arrayList26;
                                                                                cVar3 = this;
                                                                            } else {
                                                                                str15 = str73;
                                                                                arrayList8 = arrayList26;
                                                                                cVar3 = this;
                                                                                str82 = cVar3.g(xmlPullParser9, str82);
                                                                                z6 = true;
                                                                            }
                                                                            str22 = str75;
                                                                            str23 = str68;
                                                                            str31 = attributeValue13;
                                                                        } else {
                                                                            str15 = str73;
                                                                            arrayList8 = arrayList26;
                                                                            cVar3 = this;
                                                                            if (n.Z0(xmlPullParser9, str75)) {
                                                                                str5 = str58;
                                                                                str26 = attributeValue13;
                                                                                str6 = str47;
                                                                                str7 = str57;
                                                                                str22 = str75;
                                                                                j7 = j15;
                                                                                str8 = str61;
                                                                                j12 = j16;
                                                                                str30 = str80;
                                                                                str28 = str68;
                                                                                i22 = f(xmlPullParser);
                                                                                i5 = i18;
                                                                                str32 = str81;
                                                                                str16 = str79;
                                                                                str25 = str82;
                                                                                arrayList2 = arrayList;
                                                                                str24 = str66;
                                                                                str29 = str67;
                                                                                arrayList12 = arrayList5;
                                                                                str27 = str76;
                                                                                str18 = str64;
                                                                                arrayList11 = arrayList25;
                                                                                i2 = i21;
                                                                                if (n.S0(xmlPullParser9, "Representation")) {
                                                                                    xmlPullParser9 = xmlPullParser;
                                                                                    str81 = str32;
                                                                                    str76 = str27;
                                                                                    str64 = str18;
                                                                                    str79 = str16;
                                                                                    i21 = i2;
                                                                                    arrayList25 = arrayList11;
                                                                                    str82 = str25;
                                                                                    str66 = str24;
                                                                                    arrayList5 = arrayList12;
                                                                                    arrayList = arrayList2;
                                                                                    str67 = str29;
                                                                                    attributeValue13 = str26;
                                                                                    str73 = str15;
                                                                                    arrayList26 = arrayList8;
                                                                                    str47 = str6;
                                                                                    j16 = j12;
                                                                                    i18 = i5;
                                                                                    str58 = str5;
                                                                                    str57 = str7;
                                                                                    str61 = str8;
                                                                                    str80 = str30;
                                                                                    str68 = str28;
                                                                                    str75 = str22;
                                                                                    j15 = j7;
                                                                                } else {
                                                                                    if (o.h(str78)) {
                                                                                        g2 = o.a(str26);
                                                                                    } else if (o.j(str78)) {
                                                                                        g2 = o.g(str26);
                                                                                    } else if (!e(str78)) {
                                                                                        str33 = str78;
                                                                                        if (!"application/mp4".equals(str33)) {
                                                                                            str34 = str26;
                                                                                            if ("application/x-rawcc".equals(str33) && str34 != null) {
                                                                                                if (str34.contains("cea708")) {
                                                                                                    str35 = "application/cea-708";
                                                                                                } else if (str34.contains("eia608") || str34.contains("cea608")) {
                                                                                                    str35 = "application/cea-608";
                                                                                                }
                                                                                                i6 = 0;
                                                                                                while (true) {
                                                                                                    str36 = "urn:mpeg:dash:role:2011";
                                                                                                    if (i6 >= arrayList12.size()) {
                                                                                                    }
                                                                                                    i6++;
                                                                                                    arrayList12 = arrayList13;
                                                                                                }
                                                                                                i8 = 0;
                                                                                                int i23 = 0;
                                                                                                while (i8 < arrayList13.size()) {
                                                                                                }
                                                                                                arrayList9 = arrayList13;
                                                                                                i9 = 0;
                                                                                                int i24 = 0;
                                                                                                while (i9 < arrayList22.size()) {
                                                                                                }
                                                                                                ArrayList arrayList30 = arrayList28;
                                                                                                int i25 = i23 | i24;
                                                                                                if (str35 != null) {
                                                                                                }
                                                                                                createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i25, str15);
                                                                                                a aVar = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList30, -1L);
                                                                                                str37 = createContainerFormat.sampleMimeType;
                                                                                                if (!TextUtils.isEmpty(str37)) {
                                                                                                }
                                                                                                i10 = -1;
                                                                                                int c3 = c(i5, i10);
                                                                                                arrayList7 = arrayList11;
                                                                                                arrayList7.add(aVar);
                                                                                                xmlPullParser4 = xmlPullParser;
                                                                                                i17 = c3;
                                                                                                str21 = str28;
                                                                                                str20 = str24;
                                                                                                str19 = str29;
                                                                                                str17 = str77;
                                                                                                j11 = j12;
                                                                                            }
                                                                                            str35 = null;
                                                                                            i6 = 0;
                                                                                            while (true) {
                                                                                                str36 = "urn:mpeg:dash:role:2011";
                                                                                                if (i6 >= arrayList12.size()) {
                                                                                                }
                                                                                                i6++;
                                                                                                arrayList12 = arrayList13;
                                                                                            }
                                                                                            i8 = 0;
                                                                                            int i232 = 0;
                                                                                            while (i8 < arrayList13.size()) {
                                                                                            }
                                                                                            arrayList9 = arrayList13;
                                                                                            i9 = 0;
                                                                                            int i242 = 0;
                                                                                            while (i9 < arrayList22.size()) {
                                                                                            }
                                                                                            ArrayList arrayList302 = arrayList28;
                                                                                            int i252 = i232 | i242;
                                                                                            if (str35 != null) {
                                                                                            }
                                                                                            createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252, str15);
                                                                                            a aVar2 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList302, -1L);
                                                                                            str37 = createContainerFormat.sampleMimeType;
                                                                                            if (!TextUtils.isEmpty(str37)) {
                                                                                            }
                                                                                            i10 = -1;
                                                                                            int c32 = c(i5, i10);
                                                                                            arrayList7 = arrayList11;
                                                                                            arrayList7.add(aVar2);
                                                                                            xmlPullParser4 = xmlPullParser;
                                                                                            i17 = c32;
                                                                                            str21 = str28;
                                                                                            str20 = str24;
                                                                                            str19 = str29;
                                                                                            str17 = str77;
                                                                                            j11 = j12;
                                                                                        } else {
                                                                                            str34 = str26;
                                                                                            if (str34 != null) {
                                                                                                if (str34.startsWith("stpp")) {
                                                                                                    str35 = "application/ttml+xml";
                                                                                                } else if (str34.startsWith("wvtt")) {
                                                                                                    str35 = "application/x-mp4-vtt";
                                                                                                }
                                                                                                i6 = 0;
                                                                                                while (true) {
                                                                                                    str36 = "urn:mpeg:dash:role:2011";
                                                                                                    if (i6 >= arrayList12.size()) {
                                                                                                    }
                                                                                                    i6++;
                                                                                                    arrayList12 = arrayList13;
                                                                                                }
                                                                                                i8 = 0;
                                                                                                int i2322 = 0;
                                                                                                while (i8 < arrayList13.size()) {
                                                                                                }
                                                                                                arrayList9 = arrayList13;
                                                                                                i9 = 0;
                                                                                                int i2422 = 0;
                                                                                                while (i9 < arrayList22.size()) {
                                                                                                }
                                                                                                ArrayList arrayList3022 = arrayList28;
                                                                                                int i2522 = i2322 | i2422;
                                                                                                if (str35 != null) {
                                                                                                }
                                                                                                createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i2522, str15);
                                                                                                a aVar22 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList3022, -1L);
                                                                                                str37 = createContainerFormat.sampleMimeType;
                                                                                                if (!TextUtils.isEmpty(str37)) {
                                                                                                }
                                                                                                i10 = -1;
                                                                                                int c322 = c(i5, i10);
                                                                                                arrayList7 = arrayList11;
                                                                                                arrayList7.add(aVar22);
                                                                                                xmlPullParser4 = xmlPullParser;
                                                                                                i17 = c322;
                                                                                                str21 = str28;
                                                                                                str20 = str24;
                                                                                                str19 = str29;
                                                                                                str17 = str77;
                                                                                                j11 = j12;
                                                                                            }
                                                                                            str35 = null;
                                                                                            i6 = 0;
                                                                                            while (true) {
                                                                                                str36 = "urn:mpeg:dash:role:2011";
                                                                                                if (i6 >= arrayList12.size()) {
                                                                                                }
                                                                                                i6++;
                                                                                                arrayList12 = arrayList13;
                                                                                            }
                                                                                            i8 = 0;
                                                                                            int i23222 = 0;
                                                                                            while (i8 < arrayList13.size()) {
                                                                                            }
                                                                                            arrayList9 = arrayList13;
                                                                                            i9 = 0;
                                                                                            int i24222 = 0;
                                                                                            while (i9 < arrayList22.size()) {
                                                                                            }
                                                                                            ArrayList arrayList30222 = arrayList28;
                                                                                            int i25222 = i23222 | i24222;
                                                                                            if (str35 != null) {
                                                                                            }
                                                                                            createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i25222, str15);
                                                                                            a aVar222 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList30222, -1L);
                                                                                            str37 = createContainerFormat.sampleMimeType;
                                                                                            if (!TextUtils.isEmpty(str37)) {
                                                                                            }
                                                                                            i10 = -1;
                                                                                            int c3222 = c(i5, i10);
                                                                                            arrayList7 = arrayList11;
                                                                                            arrayList7.add(aVar222);
                                                                                            xmlPullParser4 = xmlPullParser;
                                                                                            i17 = c3222;
                                                                                            str21 = str28;
                                                                                            str20 = str24;
                                                                                            str19 = str29;
                                                                                            str17 = str77;
                                                                                            j11 = j12;
                                                                                        }
                                                                                        arrayList10 = arrayList21;
                                                                                        str42 = str65;
                                                                                        str43 = str69;
                                                                                        if (n.S0(xmlPullParser3, str42)) {
                                                                                        }
                                                                                    } else {
                                                                                        str33 = str78;
                                                                                        str35 = str33;
                                                                                        str34 = str26;
                                                                                        i6 = 0;
                                                                                        while (true) {
                                                                                            str36 = "urn:mpeg:dash:role:2011";
                                                                                            if (i6 >= arrayList12.size()) {
                                                                                                arrayList13 = arrayList12;
                                                                                                d dVar = (d) arrayList13.get(i6);
                                                                                                if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar.f10743a) && "main".equals(dVar.f10744b)) {
                                                                                                    i7 = 1;
                                                                                                } else {
                                                                                                    i6++;
                                                                                                    arrayList12 = arrayList13;
                                                                                                }
                                                                                            } else {
                                                                                                arrayList13 = arrayList12;
                                                                                                i7 = 0;
                                                                                            }
                                                                                        }
                                                                                        i8 = 0;
                                                                                        int i232222 = 0;
                                                                                        while (i8 < arrayList13.size()) {
                                                                                            d dVar2 = (d) arrayList13.get(i8);
                                                                                            ArrayList arrayList31 = arrayList13;
                                                                                            if ("urn:mpeg:dash:role:2011".equalsIgnoreCase(dVar2.f10743a)) {
                                                                                                i232222 |= cVar3.j(dVar2.f10744b);
                                                                                            }
                                                                                            i8++;
                                                                                            arrayList13 = arrayList31;
                                                                                        }
                                                                                        arrayList9 = arrayList13;
                                                                                        i9 = 0;
                                                                                        int i242222 = 0;
                                                                                        while (i9 < arrayList22.size()) {
                                                                                            d dVar3 = (d) arrayList22.get(i9);
                                                                                            ArrayList arrayList32 = arrayList28;
                                                                                            if (str36.equalsIgnoreCase(dVar3.f10743a)) {
                                                                                                i242222 = cVar3.j(dVar3.f10744b) | i242222;
                                                                                                str40 = str36;
                                                                                            } else {
                                                                                                str40 = str36;
                                                                                                if ("urn:tva:metadata:cs:AudioPurposeCS:2007".equalsIgnoreCase(dVar3.f10743a)) {
                                                                                                    String str83 = dVar3.f10744b;
                                                                                                    if (str83 != null) {
                                                                                                        switch (str83.hashCode()) {
                                                                                                            case 49:
                                                                                                                if (str83.equals("1")) {
                                                                                                                    c2 = 0;
                                                                                                                    break;
                                                                                                                }
                                                                                                                c2 = 65535;
                                                                                                                break;
                                                                                                            case 50:
                                                                                                                if (str83.equals("2")) {
                                                                                                                    c2 = 1;
                                                                                                                    break;
                                                                                                                }
                                                                                                                c2 = 65535;
                                                                                                                break;
                                                                                                            case 51:
                                                                                                                if (str83.equals("3")) {
                                                                                                                    c2 = 2;
                                                                                                                    break;
                                                                                                                }
                                                                                                                c2 = 65535;
                                                                                                                break;
                                                                                                            case 52:
                                                                                                                if (str83.equals("4")) {
                                                                                                                    c2 = 3;
                                                                                                                    break;
                                                                                                                }
                                                                                                                c2 = 65535;
                                                                                                                break;
                                                                                                            case 53:
                                                                                                            default:
                                                                                                                c2 = 65535;
                                                                                                                break;
                                                                                                            case 54:
                                                                                                                if (str83.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;
                                                                                                        }
                                                                                                        i242222 = i12 | i242222;
                                                                                                    }
                                                                                                    i12 = 0;
                                                                                                    i242222 = i12 | i242222;
                                                                                                }
                                                                                            }
                                                                                            i9++;
                                                                                            arrayList28 = arrayList32;
                                                                                            str36 = str40;
                                                                                        }
                                                                                        ArrayList arrayList302222 = arrayList28;
                                                                                        int i252222 = i232222 | i242222;
                                                                                        if (str35 != null) {
                                                                                            String str84 = "audio/eac3";
                                                                                            if ("audio/eac3".equals(str35)) {
                                                                                                for (int i26 = 0; i26 < arrayList29.size(); i26++) {
                                                                                                    d dVar4 = (d) arrayList29.get(i26);
                                                                                                    String str85 = dVar4.f10743a;
                                                                                                    if (("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str85) && "JOC".equals(dVar4.f10744b)) || ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str85) && "ec+3".equals(dVar4.f10744b))) {
                                                                                                        str84 = "audio/eac3-joc";
                                                                                                        str35 = str84;
                                                                                                    }
                                                                                                }
                                                                                                str35 = str84;
                                                                                            }
                                                                                            if (o.j(str35)) {
                                                                                                createContainerFormat = Format.createVideoContainerFormat(attributeValue11, null, str33, str35, str34, null, n5, n6, n7, m2, null, i7, i252222);
                                                                                            } else if (o.h(str35)) {
                                                                                                createContainerFormat = Format.createAudioContainerFormat(attributeValue11, null, str33, str35, str34, null, n5, i22, n8, null, i7, i252222, str15);
                                                                                            } else if (e(str35)) {
                                                                                                if ("application/cea-608".equals(str35)) {
                                                                                                    for (int i27 = 0; i27 < arrayList22.size(); i27++) {
                                                                                                        d dVar5 = (d) arrayList22.get(i27);
                                                                                                        if ("urn:scte:dash:cc:cea-608:2015".equals(dVar5.f10743a) && (str39 = dVar5.f10744b) != null) {
                                                                                                            Matcher matcher = f10733b.matcher(str39);
                                                                                                            if (matcher.matches()) {
                                                                                                                parseInt = Integer.parseInt(matcher.group(1));
                                                                                                                i11 = parseInt;
                                                                                                                createContainerFormat = Format.createTextContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15, i11);
                                                                                                            } else {
                                                                                                                d.a.a.a.a.g0(d.a.a.a.a.D("Unable to parse CEA-608 channel number from: "), dVar5.f10744b, "MpdParser");
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                    parseInt = -1;
                                                                                                    i11 = parseInt;
                                                                                                    createContainerFormat = Format.createTextContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15, i11);
                                                                                                } else if ("application/cea-708".equals(str35)) {
                                                                                                    for (int i28 = 0; i28 < arrayList22.size(); i28++) {
                                                                                                        d dVar6 = (d) arrayList22.get(i28);
                                                                                                        if ("urn:scte:dash:cc:cea-708:2015".equals(dVar6.f10743a) && (str38 = dVar6.f10744b) != null) {
                                                                                                            Matcher matcher2 = f10734c.matcher(str38);
                                                                                                            if (matcher2.matches()) {
                                                                                                                parseInt = Integer.parseInt(matcher2.group(1));
                                                                                                                i11 = parseInt;
                                                                                                                createContainerFormat = Format.createTextContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15, i11);
                                                                                                            } else {
                                                                                                                d.a.a.a.a.g0(d.a.a.a.a.D("Unable to parse CEA-708 service block number from: "), dVar6.f10744b, "MpdParser");
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                    parseInt = -1;
                                                                                                    i11 = parseInt;
                                                                                                    createContainerFormat = Format.createTextContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15, i11);
                                                                                                } else {
                                                                                                    i11 = -1;
                                                                                                    createContainerFormat = Format.createTextContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15, i11);
                                                                                                }
                                                                                            }
                                                                                            a aVar2222 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList302222, -1L);
                                                                                            str37 = createContainerFormat.sampleMimeType;
                                                                                            if (!TextUtils.isEmpty(str37)) {
                                                                                                if (o.j(str37)) {
                                                                                                    i10 = 2;
                                                                                                } else if (o.h(str37)) {
                                                                                                    i10 = 1;
                                                                                                } else if (e(str37)) {
                                                                                                    i10 = 3;
                                                                                                }
                                                                                                int c32222 = c(i5, i10);
                                                                                                arrayList7 = arrayList11;
                                                                                                arrayList7.add(aVar2222);
                                                                                                xmlPullParser4 = xmlPullParser;
                                                                                                i17 = c32222;
                                                                                                str21 = str28;
                                                                                                str20 = str24;
                                                                                                str19 = str29;
                                                                                                str17 = str77;
                                                                                                j11 = j12;
                                                                                            }
                                                                                            i10 = -1;
                                                                                            int c322222 = c(i5, i10);
                                                                                            arrayList7 = arrayList11;
                                                                                            arrayList7.add(aVar2222);
                                                                                            xmlPullParser4 = xmlPullParser;
                                                                                            i17 = c322222;
                                                                                            str21 = str28;
                                                                                            str20 = str24;
                                                                                            str19 = str29;
                                                                                            str17 = str77;
                                                                                            j11 = j12;
                                                                                        }
                                                                                        createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i252222, str15);
                                                                                        a aVar22222 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList302222, -1L);
                                                                                        str37 = createContainerFormat.sampleMimeType;
                                                                                        if (!TextUtils.isEmpty(str37)) {
                                                                                        }
                                                                                        i10 = -1;
                                                                                        int c3222222 = c(i5, i10);
                                                                                        arrayList7 = arrayList11;
                                                                                        arrayList7.add(aVar22222);
                                                                                        xmlPullParser4 = xmlPullParser;
                                                                                        i17 = c3222222;
                                                                                        str21 = str28;
                                                                                        str20 = str24;
                                                                                        str19 = str29;
                                                                                        str17 = str77;
                                                                                        j11 = j12;
                                                                                    }
                                                                                    str35 = g2;
                                                                                    str33 = str78;
                                                                                    str34 = str26;
                                                                                    i6 = 0;
                                                                                    while (true) {
                                                                                        str36 = "urn:mpeg:dash:role:2011";
                                                                                        if (i6 >= arrayList12.size()) {
                                                                                        }
                                                                                        i6++;
                                                                                        arrayList12 = arrayList13;
                                                                                    }
                                                                                    i8 = 0;
                                                                                    int i2322222 = 0;
                                                                                    while (i8 < arrayList13.size()) {
                                                                                    }
                                                                                    arrayList9 = arrayList13;
                                                                                    i9 = 0;
                                                                                    int i2422222 = 0;
                                                                                    while (i9 < arrayList22.size()) {
                                                                                    }
                                                                                    ArrayList arrayList3022222 = arrayList28;
                                                                                    int i2522222 = i2322222 | i2422222;
                                                                                    if (str35 != null) {
                                                                                    }
                                                                                    createContainerFormat = Format.createContainerFormat(attributeValue11, null, str33, str35, str34, n5, i7, i2522222, str15);
                                                                                    a aVar222222 = new a(createContainerFormat, str25, jVar3 != null ? jVar3 : new j.e(), str32, arrayList27, arrayList3022222, -1L);
                                                                                    str37 = createContainerFormat.sampleMimeType;
                                                                                    if (!TextUtils.isEmpty(str37)) {
                                                                                    }
                                                                                    i10 = -1;
                                                                                    int c32222222 = c(i5, i10);
                                                                                    arrayList7 = arrayList11;
                                                                                    arrayList7.add(aVar222222);
                                                                                    xmlPullParser4 = xmlPullParser;
                                                                                    i17 = c32222222;
                                                                                    str21 = str28;
                                                                                    str20 = str24;
                                                                                    str19 = str29;
                                                                                    str17 = str77;
                                                                                    j11 = j12;
                                                                                }
                                                                            } else {
                                                                                str22 = str75;
                                                                                str23 = str68;
                                                                                if (n.Z0(xmlPullParser9, str23)) {
                                                                                    str31 = attributeValue13;
                                                                                    jVar3 = cVar3.r(xmlPullParser9, (j.e) jVar3);
                                                                                } else {
                                                                                    String str86 = attributeValue13;
                                                                                    String str87 = str67;
                                                                                    if (n.Z0(xmlPullParser9, str87)) {
                                                                                        String str88 = str79;
                                                                                        long j17 = j16;
                                                                                        t2 = cVar3.s(xmlPullParser9, (j.b) jVar3, j17);
                                                                                        str5 = str58;
                                                                                        str6 = str47;
                                                                                        j12 = j17;
                                                                                        str7 = str57;
                                                                                        str25 = str82;
                                                                                        j7 = j15;
                                                                                        str8 = str61;
                                                                                        str24 = str66;
                                                                                        str26 = str86;
                                                                                        str16 = str88;
                                                                                        str27 = str76;
                                                                                        i5 = i18;
                                                                                        str28 = str23;
                                                                                        arrayList11 = arrayList25;
                                                                                        str29 = str87;
                                                                                        str30 = str80;
                                                                                        arrayList12 = arrayList5;
                                                                                        i2 = i21;
                                                                                        arrayList2 = arrayList;
                                                                                        str18 = str64;
                                                                                    } else {
                                                                                        String str89 = str79;
                                                                                        int i29 = i21;
                                                                                        String str90 = str66;
                                                                                        long j18 = j16;
                                                                                        if (n.Z0(xmlPullParser9, str90)) {
                                                                                            str24 = str90;
                                                                                            str25 = str82;
                                                                                            str26 = str86;
                                                                                            str27 = str76;
                                                                                            str29 = str87;
                                                                                            arrayList12 = arrayList5;
                                                                                            str6 = str47;
                                                                                            j12 = j18;
                                                                                            j7 = j15;
                                                                                            str16 = str89;
                                                                                            str28 = str23;
                                                                                            i5 = i18;
                                                                                            arrayList11 = arrayList25;
                                                                                            str30 = str80;
                                                                                            i2 = i29;
                                                                                            str5 = str58;
                                                                                            str7 = str57;
                                                                                            arrayList2 = arrayList;
                                                                                            str8 = str61;
                                                                                            str18 = str64;
                                                                                            t2 = t(xmlPullParser, (j.c) jVar3, arrayList8, j12);
                                                                                        } else {
                                                                                            str5 = str58;
                                                                                            str24 = str90;
                                                                                            str6 = str47;
                                                                                            j12 = j18;
                                                                                            str7 = str57;
                                                                                            str25 = str82;
                                                                                            j7 = j15;
                                                                                            str8 = str61;
                                                                                            arrayList11 = arrayList25;
                                                                                            str26 = str86;
                                                                                            str16 = str89;
                                                                                            str27 = str76;
                                                                                            i5 = i18;
                                                                                            i2 = i29;
                                                                                            str28 = str23;
                                                                                            str29 = str87;
                                                                                            str30 = str80;
                                                                                            arrayList12 = arrayList5;
                                                                                            arrayList2 = arrayList;
                                                                                            str18 = str64;
                                                                                            if (n.Z0(xmlPullParser9, str30)) {
                                                                                                Pair<String, DrmInitData.SchemeData> h3 = h(xmlPullParser);
                                                                                                Object obj3 = h3.first;
                                                                                                if (obj3 != null) {
                                                                                                    str81 = (String) obj3;
                                                                                                }
                                                                                                Object obj4 = h3.second;
                                                                                                if (obj4 != null) {
                                                                                                    arrayList27.add(obj4);
                                                                                                }
                                                                                            } else if (n.Z0(xmlPullParser9, "InbandEventStream")) {
                                                                                                arrayList28.add(k(xmlPullParser9, "InbandEventStream"));
                                                                                            } else if (n.Z0(xmlPullParser9, str27)) {
                                                                                                arrayList29.add(k(xmlPullParser9, str27));
                                                                                            } else {
                                                                                                d(xmlPullParser);
                                                                                            }
                                                                                            str32 = str81;
                                                                                            if (n.S0(xmlPullParser9, "Representation")) {
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                    jVar3 = t2;
                                                                                    str32 = str81;
                                                                                    if (n.S0(xmlPullParser9, "Representation")) {
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        str5 = str58;
                                                                        str6 = str47;
                                                                        str7 = str57;
                                                                        j7 = j15;
                                                                        str8 = str61;
                                                                        j12 = j16;
                                                                        str26 = str31;
                                                                        i5 = i18;
                                                                        str16 = str79;
                                                                        str28 = str23;
                                                                        str25 = str82;
                                                                        str24 = str66;
                                                                        str29 = str67;
                                                                        str30 = str80;
                                                                        arrayList12 = arrayList5;
                                                                        str27 = str76;
                                                                        arrayList2 = arrayList;
                                                                        arrayList11 = arrayList25;
                                                                        i2 = i21;
                                                                        str18 = str64;
                                                                        str32 = str81;
                                                                        if (n.S0(xmlPullParser9, "Representation")) {
                                                                        }
                                                                    }
                                                                } else {
                                                                    str5 = str58;
                                                                    str6 = str47;
                                                                    str7 = str57;
                                                                    str13 = str62;
                                                                    arrayList6 = arrayList20;
                                                                    str14 = str63;
                                                                    str15 = str73;
                                                                    j7 = j15;
                                                                    str8 = str61;
                                                                    arrayList7 = arrayList25;
                                                                    long j19 = j16;
                                                                    i2 = i16;
                                                                    String str91 = str68;
                                                                    str16 = str70;
                                                                    arrayList8 = arrayList26;
                                                                    str17 = str71;
                                                                    i3 = i14;
                                                                    int i30 = i17;
                                                                    i4 = n2;
                                                                    arrayList2 = arrayList;
                                                                    String str92 = str66;
                                                                    String str93 = str67;
                                                                    arrayList9 = arrayList5;
                                                                    str18 = str64;
                                                                    if (n.Z0(xmlPullParser, str91)) {
                                                                        t = r(xmlPullParser, (j.e) jVar2);
                                                                        str19 = str93;
                                                                        j11 = j19;
                                                                    } else {
                                                                        str19 = str93;
                                                                        if (n.Z0(xmlPullParser, str19)) {
                                                                            j11 = j19;
                                                                            t = s(xmlPullParser, (j.b) jVar2, j11);
                                                                        } else {
                                                                            str20 = str92;
                                                                            j11 = j19;
                                                                            if (n.Z0(xmlPullParser, str20)) {
                                                                                str21 = str91;
                                                                                xmlPullParser4 = xmlPullParser;
                                                                                t = t(xmlPullParser, (j.c) jVar2, arrayList8, j11);
                                                                                jVar2 = t;
                                                                                i17 = i30;
                                                                            } else {
                                                                                str21 = str91;
                                                                                if (n.Z0(xmlPullParser, "InbandEventStream")) {
                                                                                    arrayList10 = arrayList21;
                                                                                    arrayList10.add(k(xmlPullParser, "InbandEventStream"));
                                                                                } else {
                                                                                    arrayList10 = arrayList21;
                                                                                    if (n.Z0(xmlPullParser, "Label")) {
                                                                                        str69 = v(xmlPullParser, "Label");
                                                                                    } else if (n.Y0(xmlPullParser)) {
                                                                                        d(xmlPullParser);
                                                                                    }
                                                                                }
                                                                                xmlPullParser3 = xmlPullParser;
                                                                                i17 = i30;
                                                                                str42 = str65;
                                                                                str43 = str69;
                                                                                if (n.S0(xmlPullParser3, str42)) {
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    str21 = str91;
                                                                    xmlPullParser4 = xmlPullParser;
                                                                    str20 = str92;
                                                                    jVar2 = t;
                                                                    i17 = i30;
                                                                }
                                                                xmlPullParser3 = xmlPullParser4;
                                                                arrayList10 = arrayList21;
                                                                str42 = str65;
                                                                str43 = str69;
                                                                if (n.S0(xmlPullParser3, str42)) {
                                                                }
                                                            }
                                                            str5 = str58;
                                                            str6 = str47;
                                                            str7 = str57;
                                                            arrayList8 = arrayList24;
                                                            xmlPullParser3 = xmlPullParser7;
                                                            str13 = str62;
                                                            arrayList6 = arrayList20;
                                                            str14 = str63;
                                                            str15 = str73;
                                                            str10 = str48;
                                                            j7 = j15;
                                                            str8 = str61;
                                                            arrayList7 = arrayList25;
                                                            j11 = j16;
                                                            str19 = str67;
                                                            i2 = i16;
                                                            str21 = str68;
                                                            str16 = str70;
                                                            arrayList9 = arrayList5;
                                                            str17 = str71;
                                                            i3 = i14;
                                                            xmlPullParser4 = xmlPullParser;
                                                            i4 = n2;
                                                            arrayList2 = arrayList;
                                                            str20 = str66;
                                                            str18 = str64;
                                                            arrayList10 = arrayList21;
                                                            str42 = str65;
                                                            str43 = str69;
                                                            if (n.S0(xmlPullParser3, str42)) {
                                                            }
                                                        }
                                                    }
                                                }
                                                str41 = str12;
                                                str5 = str58;
                                                str6 = str47;
                                                str7 = str57;
                                                arrayList8 = arrayList24;
                                                str12 = str41;
                                                str13 = str62;
                                                arrayList6 = arrayList20;
                                                str14 = str63;
                                                str15 = str73;
                                                str10 = str48;
                                                j7 = j15;
                                                str8 = str61;
                                                arrayList7 = arrayList25;
                                                str19 = str67;
                                                i2 = i16;
                                                str21 = str68;
                                                arrayList10 = arrayList21;
                                                str43 = str69;
                                                str16 = str70;
                                                str17 = str71;
                                                i3 = i14;
                                                arrayList9 = arrayList23;
                                                xmlPullParser3 = xmlPullParser7;
                                                i4 = n2;
                                                arrayList2 = arrayList;
                                                str20 = str66;
                                                j11 = j16;
                                                str18 = str64;
                                                str42 = str65;
                                                if (n.S0(xmlPullParser3, str42)) {
                                                }
                                            } else if (!z5) {
                                                str41 = cVar7.g(xmlPullParser7, str72);
                                                z5 = true;
                                                str5 = str58;
                                                str6 = str47;
                                                str7 = str57;
                                                arrayList8 = arrayList24;
                                                str12 = str41;
                                                str13 = str62;
                                                arrayList6 = arrayList20;
                                                str14 = str63;
                                                str15 = str73;
                                                str10 = str48;
                                                j7 = j15;
                                                str8 = str61;
                                                arrayList7 = arrayList25;
                                                str19 = str67;
                                                i2 = i16;
                                                str21 = str68;
                                                arrayList10 = arrayList21;
                                                str43 = str69;
                                                str16 = str70;
                                                str17 = str71;
                                                i3 = i14;
                                                arrayList9 = arrayList23;
                                                xmlPullParser3 = xmlPullParser7;
                                                i4 = n2;
                                                arrayList2 = arrayList;
                                                str20 = str66;
                                                j11 = j16;
                                                str18 = str64;
                                                str42 = str65;
                                                if (n.S0(xmlPullParser3, str42)) {
                                                    String str94 = str43;
                                                    cVar7 = this;
                                                    str69 = str94;
                                                    arrayList21 = arrayList10;
                                                    str65 = str42;
                                                    j16 = j11;
                                                    str66 = str20;
                                                    str68 = str21;
                                                    str64 = str18;
                                                    str70 = str16;
                                                    arrayList = arrayList2;
                                                    n2 = i4;
                                                    str72 = str12;
                                                    str48 = str10;
                                                    str62 = str13;
                                                    i14 = i3;
                                                    arrayList20 = arrayList6;
                                                    str73 = str15;
                                                    str47 = str6;
                                                    str58 = str5;
                                                    str57 = str7;
                                                    str61 = str8;
                                                    xmlPullParser7 = xmlPullParser3;
                                                    str71 = str17;
                                                    i16 = i2;
                                                    arrayList23 = arrayList9;
                                                    j15 = j7;
                                                    str67 = str19;
                                                    arrayList25 = arrayList7;
                                                    str63 = str14;
                                                    arrayList24 = arrayList8;
                                                } else {
                                                    ArrayList arrayList33 = new ArrayList(arrayList7.size());
                                                    int i31 = 0;
                                                    while (i31 < arrayList7.size()) {
                                                        a aVar3 = (a) arrayList7.get(i31);
                                                        Format format = aVar3.f10736a;
                                                        if (str43 != null) {
                                                            format = format.copyWithLabel(str43);
                                                        }
                                                        String str95 = aVar3.f10739d;
                                                        if (str95 == null) {
                                                            str95 = str74;
                                                        }
                                                        ArrayList<DrmInitData.SchemeData> arrayList34 = aVar3.f10740e;
                                                        ArrayList arrayList35 = arrayList6;
                                                        arrayList34.addAll(arrayList35);
                                                        if (arrayList34.isEmpty()) {
                                                            str44 = str43;
                                                            arrayList14 = arrayList7;
                                                        } else {
                                                            int size = arrayList34.size();
                                                            while (true) {
                                                                str44 = str43;
                                                                int i32 = size - 1;
                                                                if (i32 >= 0) {
                                                                    DrmInitData.SchemeData schemeData = arrayList34.get(i32);
                                                                    if (schemeData.hasData()) {
                                                                        arrayList15 = arrayList7;
                                                                    } else {
                                                                        arrayList15 = arrayList7;
                                                                        int i33 = 0;
                                                                        while (true) {
                                                                            if (i33 >= arrayList34.size()) {
                                                                                break;
                                                                            } else if (arrayList34.get(i33).canReplace(schemeData)) {
                                                                                arrayList34.remove(i32);
                                                                            } else {
                                                                                i33++;
                                                                            }
                                                                        }
                                                                    }
                                                                    size = i32;
                                                                    arrayList7 = arrayList15;
                                                                    str43 = str44;
                                                                } else {
                                                                    arrayList14 = arrayList7;
                                                                    format = format.copyWithDrmInitData(new DrmInitData(str95, arrayList34));
                                                                }
                                                            }
                                                        }
                                                        Format format2 = format;
                                                        ArrayList<d> arrayList36 = aVar3.f10741f;
                                                        arrayList36.addAll(arrayList10);
                                                        long j20 = aVar3.f10742g;
                                                        String str96 = aVar3.f10737b;
                                                        j jVar4 = aVar3.f10738c;
                                                        if (jVar4 instanceof j.e) {
                                                            bVar = new i.c(j20, format2, str96, (j.e) jVar4, arrayList36, null, -1L);
                                                        } else if (jVar4 instanceof j.a) {
                                                            bVar = new i.b(j20, format2, str96, (j.a) jVar4, arrayList36);
                                                        } else {
                                                            throw new IllegalArgumentException("segmentBase must be of type SingleSegmentBase or MultiSegmentBase");
                                                        }
                                                        arrayList33.add(bVar);
                                                        i31++;
                                                        str43 = str44;
                                                        arrayList6 = arrayList35;
                                                        arrayList7 = arrayList14;
                                                    }
                                                    arrayList3.add(new d.g.a.a.h1.j0.j.a(n, i17, arrayList33, arrayList22, arrayList8));
                                                    cVar2 = this;
                                                    xmlPullParser5 = xmlPullParser;
                                                    j8 = j11;
                                                    arrayList4 = arrayList19;
                                                }
                                            } else {
                                                str12 = str72;
                                                arrayList5 = arrayList23;
                                                str5 = str58;
                                                str6 = str47;
                                                str7 = str57;
                                                arrayList8 = arrayList24;
                                                xmlPullParser3 = xmlPullParser7;
                                                str13 = str62;
                                                arrayList6 = arrayList20;
                                                str14 = str63;
                                                str15 = str73;
                                                str10 = str48;
                                                j7 = j15;
                                                str8 = str61;
                                                arrayList7 = arrayList25;
                                                j11 = j16;
                                                str19 = str67;
                                                i2 = i16;
                                                str21 = str68;
                                                str16 = str70;
                                                arrayList9 = arrayList5;
                                                str17 = str71;
                                                i3 = i14;
                                                xmlPullParser4 = xmlPullParser;
                                                i4 = n2;
                                                arrayList2 = arrayList;
                                                str20 = str66;
                                                str18 = str64;
                                                arrayList10 = arrayList21;
                                                str42 = str65;
                                                str43 = str69;
                                                if (n.S0(xmlPullParser3, str42)) {
                                                }
                                            }
                                        }
                                    } else {
                                        str5 = str58;
                                        str6 = str47;
                                        str7 = str57;
                                        str8 = str59;
                                        ArrayList arrayList37 = arrayList18;
                                        str9 = str55;
                                        str10 = str48;
                                        arrayList2 = arrayList;
                                        j7 = j15;
                                        ArrayList arrayList38 = arrayList17;
                                        long j21 = l8;
                                        if (n.Z0(xmlPullParser5, "EventStream")) {
                                            String str97 = str9;
                                            String attributeValue14 = xmlPullParser5.getAttributeValue(null, str97);
                                            if (attributeValue14 == null) {
                                                attributeValue14 = "";
                                            }
                                            String str98 = str5;
                                            String attributeValue15 = xmlPullParser5.getAttributeValue(null, str98);
                                            if (attributeValue15 == null) {
                                                attributeValue15 = "";
                                            }
                                            long o = o(xmlPullParser5, "timescale", 1L);
                                            ArrayList arrayList39 = new ArrayList();
                                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(512);
                                            while (true) {
                                                xmlPullParser.next();
                                                String str99 = "Event";
                                                if (n.Z0(xmlPullParser5, "Event")) {
                                                    str9 = str97;
                                                    long o2 = o(xmlPullParser5, str7, 0L);
                                                    long o3 = o(xmlPullParser5, str8, -9223372036854775807L);
                                                    long o4 = o(xmlPullParser5, "presentationTime", 0L);
                                                    long H = b0.H(o3, 1000L, o);
                                                    long H2 = b0.H(o4, 1000000L, o);
                                                    str5 = str98;
                                                    String attributeValue16 = xmlPullParser5.getAttributeValue(null, "messageData");
                                                    if (attributeValue16 == null) {
                                                        attributeValue16 = null;
                                                    }
                                                    byteArrayOutputStream.reset();
                                                    XmlSerializer newSerializer = Xml.newSerializer();
                                                    arrayList3 = arrayList38;
                                                    newSerializer.setOutput(byteArrayOutputStream, "UTF-8");
                                                    xmlPullParser.nextToken();
                                                    while (!n.S0(xmlPullParser5, str99)) {
                                                        switch (xmlPullParser.getEventType()) {
                                                            case 0:
                                                                str11 = str99;
                                                                j10 = j21;
                                                                newSerializer.startDocument(null, Boolean.FALSE);
                                                                break;
                                                            case 1:
                                                                str11 = str99;
                                                                j10 = j21;
                                                                newSerializer.endDocument();
                                                                break;
                                                            case 2:
                                                                str11 = str99;
                                                                newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                                                                int i34 = 0;
                                                                while (i34 < xmlPullParser.getAttributeCount()) {
                                                                    newSerializer.attribute(xmlPullParser5.getAttributeNamespace(i34), xmlPullParser5.getAttributeName(i34), xmlPullParser5.getAttributeValue(i34));
                                                                    i34++;
                                                                    j21 = j21;
                                                                }
                                                                j10 = j21;
                                                                break;
                                                            case 3:
                                                                str11 = str99;
                                                                newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                                                                j10 = j21;
                                                                break;
                                                            case 4:
                                                                newSerializer.text(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 5:
                                                                newSerializer.cdsect(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 6:
                                                                newSerializer.entityRef(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 7:
                                                                newSerializer.ignorableWhitespace(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 8:
                                                                newSerializer.processingInstruction(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 9:
                                                                newSerializer.comment(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            case 10:
                                                                newSerializer.docdecl(xmlPullParser.getText());
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                            default:
                                                                str11 = str99;
                                                                j10 = j21;
                                                                break;
                                                        }
                                                        xmlPullParser.nextToken();
                                                        str99 = str11;
                                                        j21 = j10;
                                                    }
                                                    j8 = j21;
                                                    newSerializer.flush();
                                                    byte[] byteArray = byteArrayOutputStream.toByteArray();
                                                    Long valueOf = Long.valueOf(H2);
                                                    if (attributeValue16 != null) {
                                                        byteArray = b0.u(attributeValue16);
                                                    }
                                                    arrayList39.add(Pair.create(valueOf, new EventMessage(attributeValue14, attributeValue15, H, o2, byteArray)));
                                                } else {
                                                    j8 = j21;
                                                    arrayList3 = arrayList38;
                                                    str9 = str97;
                                                    str5 = str98;
                                                    d(xmlPullParser);
                                                }
                                                if (n.S0(xmlPullParser5, "EventStream")) {
                                                    long[] jArr = new long[arrayList39.size()];
                                                    EventMessage[] eventMessageArr = new EventMessage[arrayList39.size()];
                                                    for (int i35 = 0; i35 < arrayList39.size(); i35++) {
                                                        Pair pair = (Pair) arrayList39.get(i35);
                                                        jArr[i35] = ((Long) pair.first).longValue();
                                                        eventMessageArr[i35] = (EventMessage) pair.second;
                                                    }
                                                    arrayList4 = arrayList37;
                                                    arrayList4.add(new e(attributeValue14, attributeValue15, o, jArr, eventMessageArr));
                                                    cVar2 = cVar6;
                                                } else {
                                                    str97 = str9;
                                                    arrayList38 = arrayList3;
                                                    j21 = j8;
                                                    str98 = str5;
                                                }
                                            }
                                        } else {
                                            j8 = j21;
                                            arrayList3 = arrayList38;
                                            arrayList4 = arrayList37;
                                            if (n.Z0(xmlPullParser5, "SegmentBase")) {
                                                cVar = cVar6;
                                                jVar = cVar.r(xmlPullParser5, null);
                                                j9 = j8;
                                                xmlPullParser2 = xmlPullParser;
                                            } else {
                                                cVar = cVar6;
                                                if (n.Z0(xmlPullParser5, "SegmentList")) {
                                                    j9 = j8;
                                                    jVar = cVar.s(xmlPullParser5, null, j9);
                                                } else {
                                                    j9 = j8;
                                                    if (n.Z0(xmlPullParser5, "SegmentTemplate")) {
                                                        xmlPullParser2 = xmlPullParser;
                                                        jVar = t(xmlPullParser2, null, Collections.emptyList(), j9);
                                                        xmlPullParser5 = xmlPullParser5;
                                                    } else {
                                                        d(xmlPullParser);
                                                    }
                                                }
                                                xmlPullParser2 = xmlPullParser;
                                            }
                                        }
                                    }
                                    cVar = cVar2;
                                    j9 = j8;
                                    xmlPullParser2 = xmlPullParser;
                                } else if (z4) {
                                    str5 = str58;
                                    str6 = str47;
                                    str7 = str57;
                                    str8 = str59;
                                    arrayList3 = arrayList17;
                                    arrayList4 = arrayList18;
                                    cVar = cVar5;
                                    str9 = str55;
                                    str4 = str56;
                                    z = equals;
                                    str10 = str48;
                                    arrayList2 = arrayList;
                                    xmlPullParser2 = xmlPullParser6;
                                    j7 = j15;
                                    j9 = l8;
                                    str3 = str60;
                                } else {
                                    str60 = cVar5.g(xmlPullParser5, str60);
                                    z4 = true;
                                    str5 = str58;
                                    str6 = str47;
                                    str7 = str57;
                                    str8 = str59;
                                    arrayList3 = arrayList17;
                                    arrayList4 = arrayList18;
                                    cVar = cVar5;
                                    str9 = str55;
                                    str45 = str56;
                                    z = equals;
                                    str10 = str48;
                                    arrayList2 = arrayList;
                                    j7 = j15;
                                    j9 = l8;
                                    if (n.S0(xmlPullParser5, str45)) {
                                        str56 = str45;
                                        arrayList18 = arrayList4;
                                        l8 = j9;
                                        equals = z;
                                        str55 = str9;
                                        arrayList = arrayList2;
                                        str48 = str10;
                                        str47 = str6;
                                        j15 = j7;
                                        str58 = str5;
                                        str57 = str7;
                                        str59 = str8;
                                        cVar5 = cVar;
                                        arrayList17 = arrayList3;
                                    } else {
                                        Pair create = Pair.create(new f(attributeValue5, l7, arrayList3, arrayList4), Long.valueOf(j9));
                                        f fVar = (f) create.first;
                                        if (fVar.f10751b != -9223372036854775807L) {
                                            long longValue = ((Long) create.second).longValue();
                                            j14 = longValue == -9223372036854775807L ? -9223372036854775807L : longValue + fVar.f10751b;
                                            arrayList16 = arrayList2;
                                            arrayList16.add(fVar);
                                            str46 = str2;
                                            mVar = mVar2;
                                            uri = uri2;
                                            xmlPullParser5 = xmlPullParser6;
                                        } else if (!z) {
                                            StringBuilder D = d.a.a.a.a.D("Unable to determine start of period ");
                                            D.append(arrayList2.size());
                                            throw new ParserException(D.toString());
                                        } else {
                                            str46 = str2;
                                            mVar = mVar2;
                                            uri = uri2;
                                            xmlPullParser5 = xmlPullParser6;
                                            arrayList16 = arrayList2;
                                            j14 = j7;
                                            z3 = true;
                                        }
                                    }
                                }
                                str60 = str3;
                                xmlPullParser6 = xmlPullParser2;
                                str45 = str4;
                                if (n.S0(xmlPullParser5, str45)) {
                                }
                            }
                        } else {
                            j4 = j14;
                            j5 = E;
                            j6 = l2;
                            z = equals;
                            arrayList16 = arrayList;
                            d(xmlPullParser);
                            str46 = str2;
                            mVar = mVar2;
                            uri = uri2;
                            j14 = j4;
                        }
                    }
                }
                str46 = str2;
                j5 = E;
                j6 = l2;
                z = equals;
                mVar = mVar2;
                uri = uri2;
                arrayList16 = arrayList;
            } else if (z2) {
                j4 = j14;
                j5 = E;
                j6 = l2;
                j3 = l3;
                z = equals;
                j2 = l4;
                str2 = str46;
                str46 = str2;
                mVar = mVar2;
                uri = uri2;
                j14 = j4;
            } else {
                str46 = cVar4.g(xmlPullParser5, str46);
                z2 = true;
                arrayList = arrayList16;
                j3 = l3;
                j2 = l4;
                j5 = E;
                j6 = l2;
                z = equals;
                mVar = mVar2;
                uri = uri2;
                arrayList16 = arrayList;
            }
            if (n.S0(xmlPullParser5, "MPD")) {
                if (j6 == -9223372036854775807L) {
                    if (j14 != -9223372036854775807L) {
                        j13 = j14;
                        if (arrayList16.isEmpty()) {
                            return new b(j5, j13, j3, z, j2, l5, l6, E2, gVar, mVar, uri, arrayList16);
                        }
                        throw new ParserException("No periods found.");
                    } else if (!z) {
                        throw new ParserException("Unable to determine duration of static manifest.");
                    }
                }
                j13 = j6;
                if (arrayList16.isEmpty()) {
                }
            } else {
                mVar2 = mVar;
                uri2 = uri;
                l4 = j2;
                l3 = j3;
                E = j5;
                l2 = j6;
                equals = z;
                cVar4 = this;
            }
        }
    }

    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, j.e eVar) {
        long j2;
        long j3;
        long o = o(xmlPullParser, "timescale", eVar != null ? eVar.f10773b : 1L);
        long o2 = o(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.f10774c : 0L);
        long j4 = eVar != null ? eVar.f10784d : 0L;
        long j5 = eVar != null ? eVar.f10785e : 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.f10772a : null;
        do {
            xmlPullParser.next();
            if (n.Z0(xmlPullParser, "Initialization")) {
                hVar = q(xmlPullParser, "sourceURL", "range");
            } else {
                d(xmlPullParser);
            }
        } while (!n.S0(xmlPullParser, "SegmentBase"));
        return new j.e(hVar, o, o2, j3, j2);
    }

    public j.b s(XmlPullParser xmlPullParser, j.b bVar, long j2) {
        h hVar;
        List list;
        List<j.d> list2;
        long o = o(xmlPullParser, "timescale", bVar != null ? bVar.f10773b : 1L);
        long o2 = o(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.f10774c : 0L);
        long o3 = o(xmlPullParser, TypedValues.Transition.S_DURATION, bVar != null ? bVar.f10776e : -9223372036854775807L);
        long o4 = o(xmlPullParser, "startNumber", bVar != null ? bVar.f10775d : 1L);
        List<j.d> list3 = null;
        List list4 = null;
        h hVar2 = null;
        do {
            xmlPullParser.next();
            if (n.Z0(xmlPullParser, "Initialization")) {
                hVar2 = q(xmlPullParser, "sourceURL", "range");
            } else if (n.Z0(xmlPullParser, "SegmentTimeline")) {
                list3 = u(xmlPullParser, o, j2);
            } else if (n.Z0(xmlPullParser, "SegmentURL")) {
                if (list4 == null) {
                    list4 = new ArrayList();
                }
                List list5 = list4;
                list5.add(q(xmlPullParser, "media", "mediaRange"));
                list4 = list5;
            } else {
                d(xmlPullParser);
            }
        } while (!n.S0(xmlPullParser, "SegmentList"));
        if (bVar != null) {
            if (hVar2 == null) {
                hVar2 = bVar.f10772a;
            }
            if (list3 == null) {
                list3 = bVar.f10777f;
            }
            if (list4 == null) {
                list2 = list3;
                hVar = hVar2;
                list = bVar.f10778g;
                return new j.b(hVar, o, o2, o4, o3, list2, list);
            }
        }
        hVar = hVar2;
        list = list4;
        list2 = list3;
        return new j.b(hVar, o, o2, o4, o3, list2, list);
    }

    public j.c t(XmlPullParser xmlPullParser, j.c cVar, List<d> list, long j2) {
        long j3;
        long o = o(xmlPullParser, "timescale", cVar != null ? cVar.f10773b : 1L);
        long o2 = o(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.f10774c : 0L);
        long o3 = o(xmlPullParser, TypedValues.Transition.S_DURATION, cVar != null ? cVar.f10776e : -9223372036854775807L);
        long o4 = o(xmlPullParser, "startNumber", cVar != null ? cVar.f10775d : 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.f10743a)) {
                j3 = Long.parseLong(dVar.f10744b);
                break;
            }
            i2++;
        }
        long j4 = j3;
        List<j.d> list2 = null;
        l w = w(xmlPullParser, "media", cVar != null ? cVar.f10780h : null);
        l w2 = w(xmlPullParser, "initialization", cVar != null ? cVar.f10779g : null);
        h hVar = null;
        do {
            xmlPullParser.next();
            if (n.Z0(xmlPullParser, "Initialization")) {
                hVar = q(xmlPullParser, "sourceURL", "range");
            } else if (n.Z0(xmlPullParser, "SegmentTimeline")) {
                list2 = u(xmlPullParser, o, j2);
            } else {
                d(xmlPullParser);
            }
        } while (!n.S0(xmlPullParser, "SegmentTemplate"));
        if (cVar != null) {
            if (hVar == null) {
                hVar = cVar.f10772a;
            }
            if (list2 == null) {
                list2 = cVar.f10777f;
            }
        }
        return new j.c(hVar, o, o2, o4, j4, o3, 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 (n.Z0(xmlPullParser, "S")) {
                long o = o(xmlPullParser, "t", -9223372036854775807L);
                if (z) {
                    j4 = b(arrayList, j4, j5, i2, o);
                }
                if (o == -9223372036854775807L) {
                    o = j4;
                }
                j5 = o(xmlPullParser, "d", -9223372036854775807L);
                i2 = n(xmlPullParser, "r", 0);
                j4 = o;
                z = true;
            } else {
                d(xmlPullParser);
            }
        } while (!n.S0(xmlPullParser, "SegmentTimeline"));
        if (z) {
            b(arrayList, j4, j5, i2, b0.H(j3, j2, 1000L));
        }
        return arrayList;
    }

    public l w(XmlPullParser xmlPullParser, String str, 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] = d.a.a.a.a.A(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 = d.a.a.a.a.u(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(d.a.a.a.a.u("Invalid template: ", attributeValue));
                        }
                        strArr2[i3] = str2;
                    }
                    i3++;
                    strArr[i3] = "";
                    i2 = indexOf2 + 1;
                }
            }
            return new l(strArr, iArr, strArr2, i3);
        }
        return lVar;
    }
}