导航菜单

页面标题

页面副标题

迅 唔 v1.3.9 - d.java 源代码

正在查看: 迅 唔 v1.3.9 应用的 d.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package y2;

import android.net.Uri;
import android.text.TextUtils;
import android.util.Pair;
import android.util.Xml;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import o3.j0;
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 p3.n0;
import p3.q0;
import p3.r;
import p3.r0;
import p3.v;
import s1.q1;
import s1.x2;
import t3.q;
import t3.w;
import w1.m;
import y2.k;

public class d extends DefaultHandler implements j0.a<c> {

    public static final Pattern f11722b = Pattern.compile("(\\d+)(?:/(\\d+))?");

    public static final Pattern f11723c = Pattern.compile("CC([1-4])=.*");

    public static final Pattern f11724d = Pattern.compile("([1-9]|[1-5][0-9]|6[0-3])=.*");

    public static final int[] f11725e = {-1, 1, 2, 3, 4, 5, 6, 8, 2, 3, 4, 7, 8, 24, 8, 12, 10, 12, 14, 12, 14};

    public final XmlPullParserFactory f11726a;

    public static final class a {

        public final q1 f11727a;

        public final q<b> f11728b;

        public final k f11729c;

        public final String f11730d;

        public final ArrayList<m.b> f11731e;

        public final ArrayList<e> f11732f;

        public final long f11733g;

        public final List<e> f11734h;

        public final List<e> f11735i;

        public a(q1 q1Var, List<b> list, k kVar, String str, ArrayList<m.b> arrayList, ArrayList<e> arrayList2, List<e> list2, List<e> list3, long j8) {
            this.f11727a = q1Var;
            this.f11728b = q.t(list);
            this.f11729c = kVar;
            this.f11730d = str;
            this.f11731e = arrayList;
            this.f11732f = arrayList2;
            this.f11734h = list2;
            this.f11735i = list3;
            this.f11733g = j8;
        }
    }

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

    public static int D(List<e> list) {
        String str;
        for (int i8 = 0; i8 < list.size(); i8++) {
            e eVar = list.get(i8);
            if ("urn:scte:dash:cc:cea-608:2015".equals(eVar.f11736a) && (str = eVar.f11737b) != null) {
                Matcher matcher = f11723c.matcher(str);
                if (matcher.matches()) {
                    return Integer.parseInt(matcher.group(1));
                }
                r.i("MpdParser", "Unable to parse CEA-608 channel number from: " + eVar.f11737b);
            }
        }
        return -1;
    }

    public static int E(List<e> list) {
        String str;
        for (int i8 = 0; i8 < list.size(); i8++) {
            e eVar = list.get(i8);
            if ("urn:scte:dash:cc:cea-708:2015".equals(eVar.f11736a) && (str = eVar.f11737b) != null) {
                Matcher matcher = f11724d.matcher(str);
                if (matcher.matches()) {
                    return Integer.parseInt(matcher.group(1));
                }
                r.i("MpdParser", "Unable to parse CEA-708 service block number from: " + eVar.f11737b);
            }
        }
        return -1;
    }

    public static long H(XmlPullParser xmlPullParser, String str, long j8) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j8 : q0.I0(attributeValue);
    }

    public static e I(XmlPullParser xmlPullParser, String str) {
        String r02 = r0(xmlPullParser, "schemeIdUri", "");
        String r03 = r0(xmlPullParser, "value", null);
        String r04 = r0(xmlPullParser, "id", null);
        do {
            xmlPullParser.next();
        } while (!r0.d(xmlPullParser, str));
        return new e(r02, r03, r04);
    }

    public static int J(XmlPullParser xmlPullParser) {
        char c8;
        String attributeValue = xmlPullParser.getAttributeValue(null, "value");
        if (attributeValue == null) {
            return -1;
        }
        String e8 = s3.b.e(attributeValue);
        e8.hashCode();
        switch (e8.hashCode()) {
            case 1596796:
                if (e8.equals("4000")) {
                    c8 = 0;
                    break;
                }
                c8 = 65535;
                break;
            case 2937391:
                if (e8.equals("a000")) {
                    c8 = 1;
                    break;
                }
                c8 = 65535;
                break;
            case 3094035:
                if (e8.equals("f801")) {
                    c8 = 2;
                    break;
                }
                c8 = 65535;
                break;
            case 3133436:
                if (e8.equals("fa01")) {
                    c8 = 3;
                    break;
                }
                c8 = 65535;
                break;
            default:
                c8 = 65535;
                break;
        }
        switch (c8) {
        }
        return -1;
    }

    public static int K(XmlPullParser xmlPullParser) {
        int U = U(xmlPullParser, "value", -1);
        if (U <= 0 || U >= 33) {
            return -1;
        }
        return U;
    }

    public static int L(XmlPullParser xmlPullParser) {
        int bitCount;
        String attributeValue = xmlPullParser.getAttributeValue(null, "value");
        if (attributeValue == null || (bitCount = Integer.bitCount(Integer.parseInt(attributeValue, 16))) == 0) {
            return -1;
        }
        return bitCount;
    }

    public static long M(XmlPullParser xmlPullParser, String str, long j8) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? j8 : q0.J0(attributeValue);
    }

    public static String N(List<e> list) {
        for (int i8 = 0; i8 < list.size(); i8++) {
            e eVar = list.get(i8);
            String str = eVar.f11736a;
            if ("tag:dolby.com,2018:dash:EC3_ExtensionType:2018".equals(str) && "JOC".equals(eVar.f11737b)) {
                return "audio/eac3-joc";
            }
            if ("tag:dolby.com,2014:dash:DolbyDigitalPlusExtensionType:2014".equals(str) && "ec+3".equals(eVar.f11737b)) {
                return "audio/eac3-joc";
            }
        }
        return "audio/eac3";
    }

    public static float R(XmlPullParser xmlPullParser, String str, float f8) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? f8 : Float.parseFloat(attributeValue);
    }

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

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

    public static long W(List<e> list) {
        for (int i8 = 0; i8 < list.size(); i8++) {
            e eVar = list.get(i8);
            if (s3.b.a("http://dashif.org/guidelines/last-segment-number", eVar.f11736a)) {
                return Long.parseLong(eVar.f11737b);
            }
        }
        return -1L;
    }

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

    public static int Z(XmlPullParser xmlPullParser) {
        int U = U(xmlPullParser, "value", -1);
        if (U < 0) {
            return -1;
        }
        int[] iArr = f11725e;
        if (U < iArr.length) {
            return iArr[U];
        }
        return -1;
    }

    public static int p(int i8, int i9) {
        if (i8 == -1) {
            return i9;
        }
        if (i9 == -1) {
            return i8;
        }
        p3.a.f(i8 == i9);
        return i8;
    }

    public static String q(String str, String str2) {
        if (str == null) {
            return str2;
        }
        if (str2 == null) {
            return str;
        }
        p3.a.f(str.equals(str2));
        return str;
    }

    public static void r(ArrayList<m.b> arrayList) {
        String str;
        int i8 = 0;
        while (true) {
            if (i8 >= arrayList.size()) {
                str = null;
                break;
            }
            m.b bVar = arrayList.get(i8);
            if (s1.l.f8543c.equals(bVar.f10854i) && (str = bVar.f10855j) != null) {
                arrayList.remove(i8);
                break;
            }
            i8++;
        }
        if (str == null) {
            return;
        }
        for (int i9 = 0; i9 < arrayList.size(); i9++) {
            m.b bVar2 = arrayList.get(i9);
            if (s1.l.f8542b.equals(bVar2.f10854i) && bVar2.f10855j == null) {
                arrayList.set(i9, new m.b(s1.l.f8543c, str, bVar2.f10856k, bVar2.f10857l));
            }
        }
    }

    public static String r0(XmlPullParser xmlPullParser, String str, String str2) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? str2 : attributeValue;
    }

    public static void s(ArrayList<m.b> arrayList) {
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            m.b bVar = arrayList.get(size);
            if (!bVar.d()) {
                int i8 = 0;
                while (true) {
                    if (i8 >= arrayList.size()) {
                        break;
                    }
                    if (arrayList.get(i8).b(bVar)) {
                        arrayList.remove(size);
                        break;
                    }
                    i8++;
                }
            }
        }
    }

    public static String s0(XmlPullParser xmlPullParser, String str) {
        String str2 = "";
        do {
            xmlPullParser.next();
            if (xmlPullParser.getEventType() == 4) {
                str2 = xmlPullParser.getText();
            } else {
                w(xmlPullParser);
            }
        } while (!r0.d(xmlPullParser, str));
        return str2;
    }

    public static long t(long j8, long j9) {
        if (j9 != -9223372036854775807L) {
            j8 = j9;
        }
        if (j8 == Long.MAX_VALUE) {
            return -9223372036854775807L;
        }
        return j8;
    }

    public static String u(String str, String str2) {
        if (v.o(str)) {
            return v.c(str2);
        }
        if (v.s(str)) {
            return v.n(str2);
        }
        if (v.r(str) || v.p(str)) {
            return str;
        }
        if (!"application/mp4".equals(str)) {
            return null;
        }
        String g8 = v.g(str2);
        return "text/vtt".equals(g8) ? "application/x-mp4-vtt" : g8;
    }

    public static void w(XmlPullParser xmlPullParser) {
        if (r0.e(xmlPullParser)) {
            int i8 = 1;
            while (i8 != 0) {
                xmlPullParser.next();
                if (r0.e(xmlPullParser)) {
                    i8++;
                } else if (r0.c(xmlPullParser)) {
                    i8--;
                }
            }
        }
    }

    public int A(XmlPullParser xmlPullParser) {
        char c8;
        String r02 = r0(xmlPullParser, "schemeIdUri", null);
        r02.hashCode();
        int i8 = -1;
        switch (r02.hashCode()) {
            case -2128649360:
                if (r02.equals("urn:dts:dash:audio_channel_configuration:2012")) {
                    c8 = 0;
                    break;
                }
                c8 = 65535;
                break;
            case -1352850286:
                if (r02.equals("urn:mpeg:dash:23003:3:audio_channel_configuration:2011")) {
                    c8 = 1;
                    break;
                }
                c8 = 65535;
                break;
            case -1138141449:
                if (r02.equals("tag:dolby.com,2014:dash:audio_channel_configuration:2011")) {
                    c8 = 2;
                    break;
                }
                c8 = 65535;
                break;
            case -986633423:
                if (r02.equals("urn:mpeg:mpegB:cicp:ChannelConfiguration")) {
                    c8 = 3;
                    break;
                }
                c8 = 65535;
                break;
            case -79006963:
                if (r02.equals("tag:dts.com,2014:dash:audio_channel_configuration:2012")) {
                    c8 = 4;
                    break;
                }
                c8 = 65535;
                break;
            case 312179081:
                if (r02.equals("tag:dts.com,2018:uhd:audio_channel_configuration")) {
                    c8 = 5;
                    break;
                }
                c8 = 65535;
                break;
            case 2036691300:
                if (r02.equals("urn:dolby:dash:audio_channel_configuration:2011")) {
                    c8 = 6;
                    break;
                }
                c8 = 65535;
                break;
            default:
                c8 = 65535;
                break;
        }
        switch (c8) {
            case 0:
            case 4:
                i8 = K(xmlPullParser);
                break;
            case 1:
                i8 = U(xmlPullParser, "value", -1);
                break;
            case 2:
            case 6:
                i8 = J(xmlPullParser);
                break;
            case 3:
                i8 = Z(xmlPullParser);
                break;
            case 5:
                i8 = L(xmlPullParser);
                break;
        }
        do {
            xmlPullParser.next();
        } while (!r0.d(xmlPullParser, "AudioChannelConfiguration"));
        return i8;
    }

    public long B(XmlPullParser xmlPullParser, long j8) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "availabilityTimeOffset");
        if (attributeValue == null) {
            return j8;
        }
        if ("INF".equals(attributeValue)) {
            return Long.MAX_VALUE;
        }
        return (long) (Float.parseFloat(attributeValue) * 1000000.0f);
    }

    public List<b> C(XmlPullParser xmlPullParser, List<b> list, boolean z7) {
        String attributeValue = xmlPullParser.getAttributeValue(null, "dvb:priority");
        int parseInt = attributeValue != null ? Integer.parseInt(attributeValue) : z7 ? 1 : Integer.MIN_VALUE;
        String attributeValue2 = xmlPullParser.getAttributeValue(null, "dvb:weight");
        int parseInt2 = attributeValue2 != null ? Integer.parseInt(attributeValue2) : 1;
        String attributeValue3 = xmlPullParser.getAttributeValue(null, "serviceLocation");
        String s02 = s0(xmlPullParser, "BaseURL");
        if (n0.b(s02)) {
            if (attributeValue3 == null) {
                attributeValue3 = s02;
            }
            return w.j(new b(s02, attributeValue3, parseInt, parseInt2));
        }
        ArrayList arrayList = new ArrayList();
        for (int i8 = 0; i8 < list.size(); i8++) {
            b bVar = list.get(i8);
            String d8 = n0.d(bVar.f11705a, s02);
            String str = attributeValue3 == null ? d8 : attributeValue3;
            if (z7) {
                parseInt = bVar.f11707c;
                parseInt2 = bVar.f11708d;
                str = bVar.f11706b;
            }
            arrayList.add(new b(d8, str, parseInt, parseInt2));
        }
        return arrayList;
    }

    public android.util.Pair<java.lang.String, w1.m.b> F(org.xmlpull.v1.XmlPullParser r11) {
        throw new UnsupportedOperationException("Method not decompiled: y2.d.F(org.xmlpull.v1.XmlPullParser):android.util.Pair");
    }

    public int G(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;
        }
        if ("text".equals(attributeValue)) {
            return 3;
        }
        return "image".equals(attributeValue) ? 4 : -1;
    }

    public Pair<Long, m2.a> O(XmlPullParser xmlPullParser, String str, String str2, long j8, long j9, ByteArrayOutputStream byteArrayOutputStream) {
        long X = X(xmlPullParser, "id", 0L);
        long X2 = X(xmlPullParser, "duration", -9223372036854775807L);
        long X3 = X(xmlPullParser, "presentationTime", 0L);
        long N0 = q0.N0(X2, 1000L, j8);
        long N02 = q0.N0(X3 - j9, 1000000L, j8);
        String r02 = r0(xmlPullParser, "messageData", null);
        byte[] P = P(xmlPullParser, byteArrayOutputStream);
        Long valueOf = Long.valueOf(N02);
        if (r02 != null) {
            P = q0.l0(r02);
        }
        return Pair.create(valueOf, d(str, str2, X, N0, P));
    }

    public byte[] P(XmlPullParser xmlPullParser, ByteArrayOutputStream byteArrayOutputStream) {
        byteArrayOutputStream.reset();
        XmlSerializer newSerializer = Xml.newSerializer();
        newSerializer.setOutput(byteArrayOutputStream, s3.d.f9008c.name());
        while (true) {
            xmlPullParser.nextToken();
            if (r0.d(xmlPullParser, "Event")) {
                newSerializer.flush();
                return byteArrayOutputStream.toByteArray();
            }
            switch (xmlPullParser.getEventType()) {
                case 0:
                    newSerializer.startDocument(null, Boolean.FALSE);
                    break;
                case 1:
                    newSerializer.endDocument();
                    break;
                case 2:
                    newSerializer.startTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                    for (int i8 = 0; i8 < xmlPullParser.getAttributeCount(); i8++) {
                        newSerializer.attribute(xmlPullParser.getAttributeNamespace(i8), xmlPullParser.getAttributeName(i8), xmlPullParser.getAttributeValue(i8));
                    }
                    break;
                case 3:
                    newSerializer.endTag(xmlPullParser.getNamespace(), xmlPullParser.getName());
                    break;
                case 4:
                    newSerializer.text(xmlPullParser.getText());
                    break;
                case 5:
                    newSerializer.cdsect(xmlPullParser.getText());
                    break;
                case 6:
                    newSerializer.entityRef(xmlPullParser.getText());
                    break;
                case 7:
                    newSerializer.ignorableWhitespace(xmlPullParser.getText());
                    break;
                case 8:
                    newSerializer.processingInstruction(xmlPullParser.getText());
                    break;
                case 9:
                    newSerializer.comment(xmlPullParser.getText());
                    break;
                case 10:
                    newSerializer.docdecl(xmlPullParser.getText());
                    break;
            }
        }
    }

    public f Q(XmlPullParser xmlPullParser) {
        ByteArrayOutputStream byteArrayOutputStream;
        long j8;
        ArrayList arrayList;
        String r02 = r0(xmlPullParser, "schemeIdUri", "");
        String r03 = r0(xmlPullParser, "value", "");
        long X = X(xmlPullParser, "timescale", 1L);
        long X2 = X(xmlPullParser, "presentationTimeOffset", 0L);
        ArrayList arrayList2 = new ArrayList();
        ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(512);
        while (true) {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Event")) {
                byteArrayOutputStream = byteArrayOutputStream2;
                long j9 = X2;
                j8 = X2;
                arrayList = arrayList2;
                arrayList.add(O(xmlPullParser, r02, r03, X, j9, byteArrayOutputStream));
            } else {
                byteArrayOutputStream = byteArrayOutputStream2;
                j8 = X2;
                arrayList = arrayList2;
                w(xmlPullParser);
            }
            if (r0.d(xmlPullParser, "EventStream")) {
                break;
            }
            arrayList2 = arrayList;
            byteArrayOutputStream2 = byteArrayOutputStream;
            X2 = j8;
        }
        long[] jArr = new long[arrayList.size()];
        m2.a[] aVarArr = new m2.a[arrayList.size()];
        for (int i8 = 0; i8 < arrayList.size(); i8++) {
            Pair pair = (Pair) arrayList.get(i8);
            jArr[i8] = ((Long) pair.first).longValue();
            aVarArr[i8] = (m2.a) pair.second;
        }
        return e(r02, r03, X, jArr, aVarArr);
    }

    public i T(XmlPullParser xmlPullParser) {
        return d0(xmlPullParser, "sourceURL", "range");
    }

    public String V(XmlPullParser xmlPullParser) {
        return s0(xmlPullParser, "Label");
    }

    public y2.c Y(org.xmlpull.v1.XmlPullParser r47, android.net.Uri r48) {
        throw new UnsupportedOperationException("Method not decompiled: y2.d.Y(org.xmlpull.v1.XmlPullParser, android.net.Uri):y2.c");
    }

    public Pair<g, Long> a0(XmlPullParser xmlPullParser, List<b> list, long j8, long j9, long j10, long j11, boolean z7) {
        long j12;
        ArrayList arrayList;
        ArrayList arrayList2;
        ArrayList arrayList3;
        Object obj;
        long j13;
        k l02;
        d dVar = this;
        XmlPullParser xmlPullParser2 = xmlPullParser;
        Object obj2 = null;
        String attributeValue = xmlPullParser2.getAttributeValue(null, "id");
        long M = M(xmlPullParser2, "start", j8);
        long j14 = -9223372036854775807L;
        long j15 = j10 != -9223372036854775807L ? j10 + M : -9223372036854775807L;
        long M2 = M(xmlPullParser2, "duration", -9223372036854775807L);
        ArrayList arrayList4 = new ArrayList();
        ArrayList arrayList5 = new ArrayList();
        ArrayList arrayList6 = new ArrayList();
        long j16 = j9;
        long j17 = -9223372036854775807L;
        k kVar = null;
        e eVar = null;
        boolean z8 = false;
        while (true) {
            xmlPullParser.next();
            if (r0.f(xmlPullParser2, "BaseURL")) {
                if (!z8) {
                    j16 = dVar.B(xmlPullParser2, j16);
                    z8 = true;
                }
                arrayList6.addAll(dVar.C(xmlPullParser2, list, z7));
                arrayList3 = arrayList5;
                arrayList = arrayList6;
                j13 = j14;
                obj = obj2;
                arrayList2 = arrayList4;
            } else {
                if (r0.f(xmlPullParser2, "AdaptationSet")) {
                    j12 = j16;
                    arrayList = arrayList6;
                    arrayList2 = arrayList4;
                    arrayList2.add(y(xmlPullParser, !arrayList6.isEmpty() ? arrayList6 : list, kVar, M2, j16, j17, j15, j11, z7));
                    xmlPullParser2 = xmlPullParser;
                    arrayList3 = arrayList5;
                } else {
                    j12 = j16;
                    ArrayList arrayList7 = arrayList5;
                    arrayList = arrayList6;
                    arrayList2 = arrayList4;
                    xmlPullParser2 = xmlPullParser;
                    if (r0.f(xmlPullParser2, "EventStream")) {
                        arrayList7.add(Q(xmlPullParser));
                        arrayList3 = arrayList7;
                    } else {
                        arrayList3 = arrayList7;
                        if (r0.f(xmlPullParser2, "SegmentBase")) {
                            kVar = j0(xmlPullParser2, null);
                            obj = null;
                            j16 = j12;
                            j13 = -9223372036854775807L;
                        } else {
                            if (r0.f(xmlPullParser2, "SegmentList")) {
                                long B = B(xmlPullParser2, -9223372036854775807L);
                                obj = null;
                                l02 = k0(xmlPullParser, null, j15, M2, j12, B, j11);
                                j17 = B;
                                j16 = j12;
                                j13 = -9223372036854775807L;
                            } else {
                                obj = null;
                                if (r0.f(xmlPullParser2, "SegmentTemplate")) {
                                    long B2 = B(xmlPullParser2, -9223372036854775807L);
                                    j13 = -9223372036854775807L;
                                    l02 = l0(xmlPullParser, null, q.x(), j15, M2, j12, B2, j11);
                                    j17 = B2;
                                    j16 = j12;
                                } else {
                                    j13 = -9223372036854775807L;
                                    if (r0.f(xmlPullParser2, "AssetIdentifier")) {
                                        eVar = I(xmlPullParser2, "AssetIdentifier");
                                    } else {
                                        w(xmlPullParser);
                                    }
                                    j16 = j12;
                                }
                            }
                            kVar = l02;
                        }
                    }
                }
                obj = null;
                j13 = -9223372036854775807L;
                j16 = j12;
            }
            if (r0.d(xmlPullParser2, "Period")) {
                return Pair.create(h(attributeValue, M, arrayList2, arrayList3, eVar), Long.valueOf(M2));
            }
            arrayList4 = arrayList2;
            arrayList6 = arrayList;
            obj2 = obj;
            arrayList5 = arrayList3;
            j14 = j13;
            dVar = this;
        }
    }

    public final long b(List<k.d> list, long j8, long j9, int i8, long j10) {
        int m8 = i8 >= 0 ? i8 + 1 : (int) q0.m(j10 - j8, j9);
        for (int i9 = 0; i9 < m8; i9++) {
            list.add(m(j8, j9));
            j8 += j9;
        }
        return j8;
    }

    public String[] b0(XmlPullParser xmlPullParser, String str, String[] strArr) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue == null ? strArr : attributeValue.split(",");
    }

    public y2.a c(int i8, int i9, List<j> list, List<e> list2, List<e> list3, List<e> list4) {
        return new y2.a(i8, i9, list, list2, list3, list4);
    }

    public h c0(XmlPullParser xmlPullParser) {
        String str = null;
        String r02 = r0(xmlPullParser, "moreInformationURL", null);
        String r03 = r0(xmlPullParser, "lang", null);
        String str2 = null;
        String str3 = null;
        while (true) {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Title")) {
                str = xmlPullParser.nextText();
            } else if (r0.f(xmlPullParser, "Source")) {
                str2 = xmlPullParser.nextText();
            } else if (r0.f(xmlPullParser, "Copyright")) {
                str3 = xmlPullParser.nextText();
            } else {
                w(xmlPullParser);
            }
            String str4 = str3;
            if (r0.d(xmlPullParser, "ProgramInformation")) {
                return new h(str, str2, str4, r02, r03);
            }
            str3 = str4;
        }
    }

    public m2.a d(String str, String str2, long j8, long j9, byte[] bArr) {
        return new m2.a(str, str2, j9, j8, bArr);
    }

    public i d0(XmlPullParser xmlPullParser, String str, String str2) {
        long j8;
        long j9;
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        String attributeValue2 = xmlPullParser.getAttributeValue(null, str2);
        if (attributeValue2 != null) {
            String[] split = attributeValue2.split("-");
            j8 = Long.parseLong(split[0]);
            if (split.length == 2) {
                j9 = (Long.parseLong(split[1]) - j8) + 1;
                return i(attributeValue, j8, j9);
            }
        } else {
            j8 = 0;
        }
        j9 = -1;
        return i(attributeValue, j8, j9);
    }

    public f e(String str, String str2, long j8, long[] jArr, m2.a[] aVarArr) {
        return new f(str, str2, j8, jArr, aVarArr);
    }

    public y2.d.a e0(org.xmlpull.v1.XmlPullParser r36, java.util.List<y2.b> r37, java.lang.String r38, java.lang.String r39, int r40, int r41, float r42, int r43, int r44, java.lang.String r45, java.util.List<y2.e> r46, java.util.List<y2.e> r47, java.util.List<y2.e> r48, java.util.List<y2.e> r49, y2.k r50, long r51, long r53, long r55, long r57, long r59, boolean r61) {
        throw new UnsupportedOperationException("Method not decompiled: y2.d.e0(org.xmlpull.v1.XmlPullParser, java.util.List, java.lang.String, java.lang.String, int, int, float, int, int, java.lang.String, java.util.List, java.util.List, java.util.List, java.util.List, y2.k, long, long, long, long, long, boolean):y2.d$a");
    }

    public q1 f(String str, String str2, int i8, int i9, float f8, int i10, int i11, int i12, String str3, List<e> list, List<e> list2, String str4, List<e> list3, List<e> list4) {
        String str5 = str4;
        String u7 = u(str2, str5);
        if ("audio/eac3".equals(u7)) {
            u7 = N(list4);
            if ("audio/eac3-joc".equals(u7)) {
                str5 = "ec+3";
            }
        }
        int p02 = p0(list);
        int i02 = i0(list) | f0(list2) | h0(list3) | h0(list4);
        Pair<Integer, Integer> t02 = t0(list3);
        q1.b X = new q1.b().U(str).M(str2).g0(u7).K(str5).b0(i12).i0(p02).e0(i02).X(str3);
        int i13 = -1;
        q1.b m02 = X.l0(t02 != null ? ((Integer) t02.first).intValue() : -1).m0(t02 != null ? ((Integer) t02.second).intValue() : -1);
        if (v.s(u7)) {
            m02.n0(i8).S(i9).R(f8);
        } else if (v.o(u7)) {
            m02.J(i10).h0(i11);
        } else if (v.r(u7)) {
            if ("application/cea-608".equals(u7)) {
                i13 = D(list2);
            } else if ("application/cea-708".equals(u7)) {
                i13 = E(list2);
            }
            m02.H(i13);
        } else if (v.p(u7)) {
            m02.n0(i8).S(i9);
        }
        return m02.G();
    }

    public int f0(List<e> list) {
        int u02;
        int i8 = 0;
        for (int i9 = 0; i9 < list.size(); i9++) {
            e eVar = list.get(i9);
            if (s3.b.a("urn:mpeg:dash:role:2011", eVar.f11736a)) {
                u02 = g0(eVar.f11737b);
            } else if (s3.b.a("urn:tva:metadata:cs:AudioPurposeCS:2007", eVar.f11736a)) {
                u02 = u0(eVar.f11737b);
            }
            i8 |= u02;
        }
        return i8;
    }

    public c g(long j8, long j9, long j10, boolean z7, long j11, long j12, long j13, long j14, h hVar, o oVar, l lVar, Uri uri, List<g> list) {
        return new c(j8, j9, j10, z7, j11, j12, j13, j14, hVar, oVar, lVar, uri, list);
    }

    public int g0(String str) {
        if (str == null) {
            return 0;
        }
        switch (str) {
        }
        return 0;
    }

    public g h(String str, long j8, List<y2.a> list, List<f> list2, e eVar) {
        return new g(str, j8, list, list2, eVar);
    }

    public int h0(List<e> list) {
        int i8 = 0;
        for (int i9 = 0; i9 < list.size(); i9++) {
            if (s3.b.a("http://dashif.org/guidelines/trickmode", list.get(i9).f11736a)) {
                i8 |= 16384;
            }
        }
        return i8;
    }

    public i i(String str, long j8, long j9) {
        return new i(str, j8, j9);
    }

    public int i0(List<e> list) {
        int i8 = 0;
        for (int i9 = 0; i9 < list.size(); i9++) {
            e eVar = list.get(i9);
            if (s3.b.a("urn:mpeg:dash:role:2011", eVar.f11736a)) {
                i8 |= g0(eVar.f11737b);
            }
        }
        return i8;
    }

    public j j(a aVar, String str, String str2, ArrayList<m.b> arrayList, ArrayList<e> arrayList2) {
        q1.b b8 = aVar.f11727a.b();
        if (str != null) {
            b8.W(str);
        }
        String str3 = aVar.f11730d;
        if (str3 != null) {
            str2 = str3;
        }
        ArrayList<m.b> arrayList3 = aVar.f11731e;
        arrayList3.addAll(arrayList);
        if (!arrayList3.isEmpty()) {
            r(arrayList3);
            s(arrayList3);
            b8.O(new w1.m(str2, arrayList3));
        }
        ArrayList<e> arrayList4 = aVar.f11732f;
        arrayList4.addAll(arrayList2);
        return j.o(aVar.f11733g, b8.G(), aVar.f11728b, aVar.f11729c, arrayList4, aVar.f11734h, aVar.f11735i, null);
    }

    public k.e j0(XmlPullParser xmlPullParser, k.e eVar) {
        long j8;
        long j9;
        long X = X(xmlPullParser, "timescale", eVar != null ? eVar.f11773b : 1L);
        long X2 = X(xmlPullParser, "presentationTimeOffset", eVar != null ? eVar.f11774c : 0L);
        long j10 = eVar != null ? eVar.f11787d : 0L;
        long j11 = eVar != null ? eVar.f11788e : 0L;
        String attributeValue = xmlPullParser.getAttributeValue(null, "indexRange");
        if (attributeValue != null) {
            String[] split = attributeValue.split("-");
            long parseLong = Long.parseLong(split[0]);
            j8 = (Long.parseLong(split[1]) - parseLong) + 1;
            j9 = parseLong;
        } else {
            j8 = j11;
            j9 = j10;
        }
        i iVar = eVar != null ? eVar.f11772a : null;
        do {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Initialization")) {
                iVar = T(xmlPullParser);
            } else {
                w(xmlPullParser);
            }
        } while (!r0.d(xmlPullParser, "SegmentBase"));
        return n(iVar, X, X2, j9, j8);
    }

    public k.b k(i iVar, long j8, long j9, long j10, long j11, List<k.d> list, long j12, List<i> list2, long j13, long j14) {
        return new k.b(iVar, j8, j9, j10, j11, list, j12, list2, q0.B0(j13), q0.B0(j14));
    }

    public k.b k0(XmlPullParser xmlPullParser, k.b bVar, long j8, long j9, long j10, long j11, long j12) {
        long X = X(xmlPullParser, "timescale", bVar != null ? bVar.f11773b : 1L);
        long X2 = X(xmlPullParser, "presentationTimeOffset", bVar != null ? bVar.f11774c : 0L);
        long X3 = X(xmlPullParser, "duration", bVar != null ? bVar.f11776e : -9223372036854775807L);
        long X4 = X(xmlPullParser, "startNumber", bVar != null ? bVar.f11775d : 1L);
        long t7 = t(j10, j11);
        List<k.d> list = null;
        List<i> list2 = null;
        i iVar = null;
        do {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Initialization")) {
                iVar = T(xmlPullParser);
            } else if (r0.f(xmlPullParser, "SegmentTimeline")) {
                list = m0(xmlPullParser, X, j9);
            } else if (r0.f(xmlPullParser, "SegmentURL")) {
                if (list2 == null) {
                    list2 = new ArrayList<>();
                }
                list2.add(n0(xmlPullParser));
            } else {
                w(xmlPullParser);
            }
        } while (!r0.d(xmlPullParser, "SegmentList"));
        if (bVar != null) {
            if (iVar == null) {
                iVar = bVar.f11772a;
            }
            if (list == null) {
                list = bVar.f11777f;
            }
            if (list2 == null) {
                list2 = bVar.f11781j;
            }
        }
        return k(iVar, X, X2, X4, X3, list, t7, list2, j12, j8);
    }

    public k.c l(i iVar, long j8, long j9, long j10, long j11, long j12, List<k.d> list, long j13, n nVar, n nVar2, long j14, long j15) {
        return new k.c(iVar, j8, j9, j10, j11, j12, list, j13, nVar, nVar2, q0.B0(j14), q0.B0(j15));
    }

    public k.c l0(XmlPullParser xmlPullParser, k.c cVar, List<e> list, long j8, long j9, long j10, long j11, long j12) {
        long X = X(xmlPullParser, "timescale", cVar != null ? cVar.f11773b : 1L);
        long X2 = X(xmlPullParser, "presentationTimeOffset", cVar != null ? cVar.f11774c : 0L);
        long X3 = X(xmlPullParser, "duration", cVar != null ? cVar.f11776e : -9223372036854775807L);
        long X4 = X(xmlPullParser, "startNumber", cVar != null ? cVar.f11775d : 1L);
        long W = W(list);
        long t7 = t(j10, j11);
        List<k.d> list2 = null;
        n v02 = v0(xmlPullParser, "media", cVar != null ? cVar.f11783k : null);
        n v03 = v0(xmlPullParser, "initialization", cVar != null ? cVar.f11782j : null);
        i iVar = null;
        do {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Initialization")) {
                iVar = T(xmlPullParser);
            } else if (r0.f(xmlPullParser, "SegmentTimeline")) {
                list2 = m0(xmlPullParser, X, j9);
            } else {
                w(xmlPullParser);
            }
        } while (!r0.d(xmlPullParser, "SegmentTemplate"));
        if (cVar != null) {
            if (iVar == null) {
                iVar = cVar.f11772a;
            }
            if (list2 == null) {
                list2 = cVar.f11777f;
            }
        }
        return l(iVar, X, X2, X4, W, X3, list2, t7, v03, v02, j12, j8);
    }

    public k.d m(long j8, long j9) {
        return new k.d(j8, j9);
    }

    public List<k.d> m0(XmlPullParser xmlPullParser, long j8, long j9) {
        ArrayList arrayList = new ArrayList();
        long j10 = 0;
        long j11 = -9223372036854775807L;
        boolean z7 = false;
        int i8 = 0;
        do {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "S")) {
                long X = X(xmlPullParser, "t", -9223372036854775807L);
                if (z7) {
                    j10 = b(arrayList, j10, j11, i8, X);
                }
                if (X == -9223372036854775807L) {
                    X = j10;
                }
                j11 = X(xmlPullParser, "d", -9223372036854775807L);
                i8 = U(xmlPullParser, "r", 0);
                j10 = X;
                z7 = true;
            } else {
                w(xmlPullParser);
            }
        } while (!r0.d(xmlPullParser, "SegmentTimeline"));
        if (z7) {
            b(arrayList, j10, j11, i8, q0.N0(j9, j8, 1000L));
        }
        return arrayList;
    }

    public k.e n(i iVar, long j8, long j9, long j10, long j11) {
        return new k.e(iVar, j8, j9, j10, j11);
    }

    public i n0(XmlPullParser xmlPullParser) {
        return d0(xmlPullParser, "media", "mediaRange");
    }

    public o o(String str, String str2) {
        return new o(str, str2);
    }

    public int o0(String str) {
        if (str == null) {
            return 0;
        }
        return (str.equals("forced_subtitle") || str.equals("forced-subtitle")) ? 2 : 0;
    }

    public int p0(List<e> list) {
        int i8 = 0;
        for (int i9 = 0; i9 < list.size(); i9++) {
            e eVar = list.get(i9);
            if (s3.b.a("urn:mpeg:dash:role:2011", eVar.f11736a)) {
                i8 |= o0(eVar.f11737b);
            }
        }
        return i8;
    }

    public l q0(XmlPullParser xmlPullParser) {
        long j8 = -9223372036854775807L;
        long j9 = -9223372036854775807L;
        long j10 = -9223372036854775807L;
        float f8 = -3.4028235E38f;
        float f9 = -3.4028235E38f;
        while (true) {
            xmlPullParser.next();
            if (r0.f(xmlPullParser, "Latency")) {
                j8 = X(xmlPullParser, "target", -9223372036854775807L);
                j9 = X(xmlPullParser, "min", -9223372036854775807L);
                j10 = X(xmlPullParser, "max", -9223372036854775807L);
            } else if (r0.f(xmlPullParser, "PlaybackRate")) {
                f8 = R(xmlPullParser, "min", -3.4028235E38f);
                f9 = R(xmlPullParser, "max", -3.4028235E38f);
            }
            long j11 = j8;
            long j12 = j9;
            long j13 = j10;
            float f10 = f8;
            float f11 = f9;
            if (r0.d(xmlPullParser, "ServiceDescription")) {
                return new l(j11, j12, j13, f10, f11);
            }
            j8 = j11;
            j9 = j12;
            j10 = j13;
            f8 = f10;
            f9 = f11;
        }
    }

    public Pair<Integer, Integer> t0(List<e> list) {
        String str;
        for (int i8 = 0; i8 < list.size(); i8++) {
            e eVar = list.get(i8);
            if ((s3.b.a("http://dashif.org/thumbnail_tile", eVar.f11736a) || s3.b.a("http://dashif.org/guidelines/thumbnail_tile", eVar.f11736a)) && (str = eVar.f11737b) != null) {
                String[] Q0 = q0.Q0(str, "x");
                if (Q0.length != 2) {
                    continue;
                } else {
                    try {
                        return Pair.create(Integer.valueOf(Integer.parseInt(Q0[0])), Integer.valueOf(Integer.parseInt(Q0[1])));
                    } catch (NumberFormatException unused) {
                        continue;
                    }
                }
            }
        }
        return null;
    }

    public int u0(String str) {
        if (str == null) {
            return 0;
        }
        switch (str) {
        }
        return 0;
    }

    public final boolean v(String[] strArr) {
        for (String str : strArr) {
            if (str.startsWith("urn:dvb:dash:profile:dvb-dash:")) {
                return true;
            }
        }
        return false;
    }

    public n v0(XmlPullParser xmlPullParser, String str, n nVar) {
        String attributeValue = xmlPullParser.getAttributeValue(null, str);
        return attributeValue != null ? n.b(attributeValue) : nVar;
    }

    public o w0(XmlPullParser xmlPullParser) {
        return o(xmlPullParser.getAttributeValue(null, "schemeIdUri"), xmlPullParser.getAttributeValue(null, "value"));
    }

    @Override
    public c a(Uri uri, InputStream inputStream) {
        try {
            XmlPullParser newPullParser = this.f11726a.newPullParser();
            newPullParser.setInput(inputStream, null);
            if (newPullParser.next() == 2 && "MPD".equals(newPullParser.getName())) {
                return Y(newPullParser, uri);
            }
            throw x2.c("inputStream does not contain a valid media presentation description", null);
        } catch (XmlPullParserException e8) {
            throw x2.c(null, e8);
        }
    }

    public y2.a y(org.xmlpull.v1.XmlPullParser r55, java.util.List<y2.b> r56, y2.k r57, long r58, long r60, long r62, long r64, long r66, boolean r68) {
        throw new UnsupportedOperationException("Method not decompiled: y2.d.y(org.xmlpull.v1.XmlPullParser, java.util.List, y2.k, long, long, long, long, long, boolean):y2.a");
    }

    public void z(XmlPullParser xmlPullParser) {
        w(xmlPullParser);
    }
}