package p138.p176.p177.p190.p226.p234;

import com.google.android.exoplayer2.ParserException;
import java.util.regex.Pattern;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p190.p239.C4140;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ໟ.ސ.ޅ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C4012 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final Pattern f12707 = Pattern.compile("^NOTE([ \t].*)?$");

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static float m6464(String str) {
        if (str.endsWith("%")) {
            return Float.parseFloat(str.substring(0, str.length() - 1)) / 100.0f;
        }
        throw new NumberFormatException("Percentages must end with %");
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static boolean m6465(C4140 c4140) {
        String strM6690 = c4140.m6690();
        return strM6690 != null && strM6690.startsWith("WEBVTT");
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static long m6466(String str) {
        String[] strArrM6795 = C4150.m6795(str, "\\.");
        long j = 0;
        for (String str2 : C4150.m6781(strArrM6795[0], ":")) {
            j = (j * 60) + Long.parseLong(str2);
        }
        long j2 = j * 1000;
        if (strArrM6795.length == 2) {
            j2 += Long.parseLong(strArrM6795[1]);
        }
        return j2 * 1000;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static void m6467(C4140 c4140) throws ParserException {
        int i = c4140.f13228;
        if (m6465(c4140)) {
            return;
        }
        c4140.m6693(i);
        StringBuilder sbM4889 = C2803.m4889("Expected WEBVTT. Got ");
        sbM4889.append(c4140.m6690());
        throw new ParserException(sbM4889.toString());
    }
}
