package p138.p176.p177.p190.p198.p201;

import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.flv.TagPayloadReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import p138.p176.p177.p190.p198.C3560;
import p138.p176.p177.p190.p239.C4140;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޗ.ހ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3589 extends TagPayloadReader {

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

    public C3589() {
        super(new C3560());
        this.f10673 = -9223372036854775807L;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Object m5914(C4140 c4140, int i) {
        if (i == 0) {
            return Double.valueOf(Double.longBitsToDouble(c4140.m6699()));
        }
        if (i == 1) {
            return Boolean.valueOf(c4140.m6702() == 1);
        }
        if (i == 2) {
            return m5916(c4140);
        }
        if (i != 3) {
            if (i == 8) {
                return m5915(c4140);
            }
            if (i != 10) {
                if (i != 11) {
                    return null;
                }
                Date date = new Date((long) Double.valueOf(Double.longBitsToDouble(c4140.m6699())).doubleValue());
                c4140.m6695(2);
                return date;
            }
            int iM6705 = c4140.m6705();
            ArrayList arrayList = new ArrayList(iM6705);
            for (int i2 = 0; i2 < iM6705; i2++) {
                Object objM5914 = m5914(c4140, c4140.m6702());
                if (objM5914 != null) {
                    arrayList.add(objM5914);
                }
            }
            return arrayList;
        }
        HashMap map = new HashMap();
        while (true) {
            String strM5916 = m5916(c4140);
            int iM6702 = c4140.m6702();
            if (iM6702 == 9) {
                return map;
            }
            Object objM59142 = m5914(c4140, iM6702);
            if (objM59142 != null) {
                map.put(strM5916, objM59142);
            }
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static HashMap<String, Object> m5915(C4140 c4140) {
        int iM6705 = c4140.m6705();
        HashMap<String, Object> map = new HashMap<>(iM6705);
        for (int i = 0; i < iM6705; i++) {
            String strM5916 = m5916(c4140);
            Object objM5914 = m5914(c4140, c4140.m6702());
            if (objM5914 != null) {
                map.put(strM5916, objM5914);
            }
        }
        return map;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public static String m5916(C4140 c4140) {
        int iM6707 = c4140.m6707();
        int i = c4140.f13228;
        c4140.m6695(iM6707);
        return new String(c4140.f13227, i, iM6707);
    }

    @Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
    /* JADX INFO: renamed from: ֏ */
    public boolean mo1140(C4140 c4140) {
        return true;
    }

    @Override // com.google.android.exoplayer2.extractor.flv.TagPayloadReader
    /* JADX INFO: renamed from: ؠ */
    public boolean mo1142(C4140 c4140, long j) throws ParserException {
        if (c4140.m6702() != 2) {
            throw new ParserException();
        }
        if (!"onMetaData".equals(m5916(c4140)) || c4140.m6702() != 8) {
            return false;
        }
        HashMap<String, Object> mapM5915 = m5915(c4140);
        if (mapM5915.containsKey("duration")) {
            double dDoubleValue = ((Double) mapM5915.get("duration")).doubleValue();
            if (dDoubleValue > 0.0d) {
                this.f10673 = (long) (dDoubleValue * 1000000.0d);
            }
        }
        return false;
    }
}
