package p138.p176.p177.p190.p236;

import android.content.res.Resources;
import android.text.TextUtils;
import java.util.Locale;
import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.p239.C4134;
import p138.p176.p177.p190.p239.C4150;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ྉ.ޅ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C4053 implements InterfaceC4072 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final Resources f12861;

    public C4053(Resources resources) {
        if (resources == null) {
            throw null;
        }
        this.f12861 = resources;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final String m6506(C3431 c3431) {
        int i = c3431.f10086;
        return i == -1 ? "" : this.f12861.getString(C4067.exo_track_bitrate, Float.valueOf(i / 1000000.0f));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final String m6507(String... strArr) {
        String string = "";
        for (String str : strArr) {
            if (str.length() > 0) {
                string = TextUtils.isEmpty(string) ? str : this.f12861.getString(C4067.exo_item_list, string, str);
            }
        }
        return string;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final String m6508(C3431 c3431) {
        String displayName;
        String[] strArr = new String[2];
        String str = c3431.f10108;
        if (TextUtils.isEmpty(str) || "und".equals(str)) {
            displayName = "";
        } else {
            displayName = (C4150.f13259 >= 21 ? Locale.forLanguageTag(str) : new Locale(str)).getDisplayName();
        }
        strArr[0] = displayName;
        strArr[1] = m6509(c3431);
        String strM6507 = m6507(strArr);
        if (TextUtils.isEmpty(strM6507)) {
            return TextUtils.isEmpty(c3431.f10083) ? "" : c3431.f10083;
        }
        return strM6507;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final String m6509(C3431 c3431) {
        String string = (c3431.f10085 & 2) != 0 ? this.f12861.getString(C4067.exo_track_role_alternate) : "";
        if ((c3431.f10085 & 4) != 0) {
            string = m6507(string, this.f12861.getString(C4067.exo_track_role_supplementary));
        }
        if ((c3431.f10085 & 8) != 0) {
            string = m6507(string, this.f12861.getString(C4067.exo_track_role_commentary));
        }
        return (c3431.f10085 & 1088) != 0 ? m6507(string, this.f12861.getString(C4067.exo_track_role_closed_captions)) : string;
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x001e  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0014  */
    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public String m6510(C3431 c3431) {
        String strM6508;
        int iM6655 = C4134.m6655(c3431.f10090);
        if (iM6655 == -1) {
            if (C4134.m6656(c3431.f10087) == null) {
                if (C4134.m6651(c3431.f10087) == null) {
                    iM6655 = (c3431.f10095 == -1 && c3431.f10096 == -1) ? (c3431.f10103 == -1 && c3431.f10104 == -1) ? -1 : 1 : 2;
                }
            }
        }
        String string = "";
        if (iM6655 == 2) {
            String[] strArr = new String[3];
            strArr[0] = m6509(c3431);
            int i = c3431.f10095;
            int i2 = c3431.f10096;
            if (i != -1 && i2 != -1) {
                string = this.f12861.getString(C4067.exo_track_resolution, Integer.valueOf(i), Integer.valueOf(i2));
            }
            strArr[1] = string;
            strArr[2] = m6506(c3431);
            strM6508 = m6507(strArr);
        } else if (iM6655 == 1) {
            String[] strArr2 = new String[3];
            strArr2[0] = m6508(c3431);
            int i3 = c3431.f10103;
            if (i3 != -1 && i3 >= 1) {
                string = i3 != 1 ? i3 != 2 ? (i3 == 6 || i3 == 7) ? this.f12861.getString(C4067.exo_track_surround_5_point_1) : i3 != 8 ? this.f12861.getString(C4067.exo_track_surround) : this.f12861.getString(C4067.exo_track_surround_7_point_1) : this.f12861.getString(C4067.exo_track_stereo) : this.f12861.getString(C4067.exo_track_mono);
            }
            strArr2[1] = string;
            strArr2[2] = m6506(c3431);
            strM6508 = m6507(strArr2);
        } else {
            strM6508 = m6508(c3431);
        }
        return strM6508.length() == 0 ? this.f12861.getString(C4067.exo_track_unknown) : strM6508;
    }
}
