package androidx.media3.common;

import androidx.media3.common.util.UnstableApi;
import defpackage.n41;
import defpackage.vw2;

/* JADX INFO: loaded from: classes.dex */
@UnstableApi
public final class VideoFrameProcessingException extends Exception {
    public final long presentationTimeUs;

    /* JADX WARN: Illegal instructions before constructor call */
    public VideoFrameProcessingException(String str, long j) {
        StringBuilder sbQ = vw2.q(str);
        sbQ.append(getPresentationTimeUsString(j));
        super(sbQ.toString());
        this.presentationTimeUs = j;
    }

    public static VideoFrameProcessingException from(Exception exc) {
        return from(exc, C.TIME_UNSET);
    }

    private static String getPresentationTimeUsString(long j) {
        return j == C.TIME_UNSET ? " @UNSET" : n41.j(j, " @");
    }

    public static VideoFrameProcessingException from(Exception exc, long j) {
        return exc instanceof VideoFrameProcessingException ? (VideoFrameProcessingException) exc : new VideoFrameProcessingException(exc, j);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public VideoFrameProcessingException(String str, Throwable th, long j) {
        StringBuilder sbQ = vw2.q(str);
        sbQ.append(getPresentationTimeUsString(j));
        super(sbQ.toString(), th);
        this.presentationTimeUs = j;
    }

    public VideoFrameProcessingException(String str) {
        this(str, C.TIME_UNSET);
    }

    public VideoFrameProcessingException(String str, Throwable th) {
        this(str, th, C.TIME_UNSET);
    }

    public VideoFrameProcessingException(Throwable th) {
        this(th, C.TIME_UNSET);
    }

    public VideoFrameProcessingException(Throwable th, long j) {
        super(getPresentationTimeUsString(j), th);
        this.presentationTimeUs = j;
    }
}
