package tv.danmaku.ijk.media.player.ui.subtitleconverter.subtitleFile;

import java.util.Hashtable;
import java.util.TreeMap;

/* JADX INFO: loaded from: classes3.dex */
public class TimedTextObject {
    public String title = "";
    public String description = "";
    public String copyrigth = "";
    public String author = "";
    public String fileName = "";
    public String language = "";
    public boolean useASSInsteadOfSSA = true;
    public int offset = 0;
    public boolean built = false;
    public Hashtable<String, Style> styling = new Hashtable<>();
    public TreeMap<Integer, Caption> captions = new TreeMap<>();
    public String warnings = "List of non fatal errors produced during parsing:\n\n";

    public void cleanUnusedStyles() {
        Hashtable<String, Style> hashtable = new Hashtable<>();
        for (Caption caption : this.captions.values()) {
            Style style = caption.style;
            if (style != null) {
                String str = style.iD;
                if (!hashtable.containsKey(str)) {
                    hashtable.put(str, caption.style);
                }
            }
        }
        this.styling = hashtable;
    }

    public String[] toASS() {
        return new FormatASS().toFile(this);
    }

    public String[] toSCC() {
        return new FormatSCC().toFile(this);
    }

    public String[] toSRT() {
        return new FormatSRT().toFile(this);
    }

    public byte[] toSTL() {
        return new FormatSTL().toFile(this);
    }

    public String[] toTTML() {
        return new FormatTTML().toFile(this);
    }
}
