From: Steinar H. Gunderson Date: Wed, 30 Oct 2019 22:55:17 +0000 (+0100) Subject: Fix the previous fix for the infinite display; it was causing crashes and odd stuff... X-Git-Tag: 1.9.1~3 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=ea502b76e42b700e73afb25522a0b947e9ee60a9 Fix the previous fix for the infinite display; it was causing crashes and odd stuff in the UI. --- diff --git a/futatabi/mainwindow.cpp b/futatabi/mainwindow.cpp index 9885232..f55ad0e 100644 --- a/futatabi/mainwindow.cpp +++ b/futatabi/mainwindow.cpp @@ -445,9 +445,6 @@ void MainWindow::queue_clicked() } else { clip.stream_idx = ui->preview_display->get_stream_idx(); } - if (clip.pts_out == -1) { - clip.pts_out = clip.pts_in + int64_t(TIMEBASE) * 86400 * 7; // One week; effectively infinite, but without overflow issues. - } playlist_clips->add_clip(clip); playlist_selection_changed(); diff --git a/futatabi/player.cpp b/futatabi/player.cpp index 910377a..f427d05 100644 --- a/futatabi/player.cpp +++ b/futatabi/player.cpp @@ -628,7 +628,7 @@ TimeRemaining compute_time_left(const vector &clips, size_t currentl for (size_t row = currently_playing_idx; row < clips.size(); ++row) { const Clip &clip = clips[row].clip; double clip_length = double(clip.pts_out - clip.pts_in) / TIMEBASE / clip.speed; - if (clip_length >= 86400.0) { // More than one day. + if (clip_length >= 86400.0 || clip.pts_out == -1) { // More than one day. ++remaining.num_infinite; } else { if (row == currently_playing_idx) {