package com.ifpdos.player.extractor;

import kotlin.jvm.internal.g;
import kotlin.jvm.internal.l;
import okhttp3.HttpUrl;

/* JADX INFO: loaded from: classes.dex */
public final class SubtitleData {
    public static final Companion Companion = new Companion(null);
    public static final int SUBTITLE_ASS = 1;
    public static final int SUBTITLE_TEXT = 0;
    private final long endTime;
    private final long startTime;
    private final String text;
    private final int type;

    public static final class Companion {
        public /* synthetic */ Companion(g gVar) {
            this();
        }

        private Companion() {
        }
    }

    public SubtitleData(long j2, long j3, String text, int i2) {
        l.e(text, "text");
        this.startTime = j2;
        this.endTime = j3;
        this.text = text;
        this.type = i2;
    }

    public static /* synthetic */ SubtitleData copy$default(SubtitleData subtitleData, long j2, long j3, String str, int i2, int i3, Object obj) {
        if ((i3 & 1) != 0) {
            j2 = subtitleData.startTime;
        }
        long j4 = j2;
        if ((i3 & 2) != 0) {
            j3 = subtitleData.endTime;
        }
        long j5 = j3;
        if ((i3 & 4) != 0) {
            str = subtitleData.text;
        }
        String str2 = str;
        if ((i3 & 8) != 0) {
            i2 = subtitleData.type;
        }
        return subtitleData.copy(j4, j5, str2, i2);
    }

    public final long component1() {
        return this.startTime;
    }

    public final long component2() {
        return this.endTime;
    }

    public final String component3() {
        return this.text;
    }

    public final int component4() {
        return this.type;
    }

    public final SubtitleData copy(long j2, long j3, String text, int i2) {
        l.e(text, "text");
        return new SubtitleData(j2, j3, text, i2);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof SubtitleData)) {
            return false;
        }
        SubtitleData subtitleData = (SubtitleData) obj;
        return this.startTime == subtitleData.startTime && this.endTime == subtitleData.endTime && l.a(this.text, subtitleData.text) && this.type == subtitleData.type;
    }

    public final long getEndTime() {
        return this.endTime;
    }

    public final String getFormatText() {
        String strSubstring;
        if (this.type != 1) {
            return this.text;
        }
        String str = this.text;
        int i2 = 0;
        int i3 = 0;
        int i4 = -1;
        int i5 = 0;
        while (i2 < str.length()) {
            int i6 = i3 + 1;
            if (str.charAt(i2) == ',') {
                i5++;
                i4 = i3;
            }
            i2++;
            i3 = i6;
        }
        if (i5 == 8) {
            strSubstring = this.text.substring(i4 + 1);
            l.d(strSubstring, "substring(...)");
        } else {
            strSubstring = this.text;
        }
        return E1.g.u(strSubstring, "\\N", HttpUrl.FRAGMENT_ENCODE_SET, false, 4, null);
    }

    public final long getStartTime() {
        return this.startTime;
    }

    public final String getText() {
        return this.text;
    }

    public final int getType() {
        return this.type;
    }

    public int hashCode() {
        return (((((Long.hashCode(this.startTime) * 31) + Long.hashCode(this.endTime)) * 31) + this.text.hashCode()) * 31) + Integer.hashCode(this.type);
    }

    public String toString() {
        return "SubtitleData(startTime=" + this.startTime + ", endTime=" + this.endTime + ", text=" + this.text + ", type=" + this.type + ")";
    }
}
