From 3295f7e178ffb254f7223e5c13d21c4f0689f2be Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 16 Dec 2018 22:44:49 +0100 Subject: [PATCH] When previewing the playlist time, use compute_time_left(). Less code duplication, and also fixes an issue where the fade time would not be counted correctly. --- futatabi/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/futatabi/mainwindow.cpp b/futatabi/mainwindow.cpp index 8d52c06..68b29e4 100644 --- a/futatabi/mainwindow.cpp +++ b/futatabi/mainwindow.cpp @@ -793,11 +793,11 @@ void MainWindow::playlist_selection_changed() if (!any_selected) { set_output_status("paused"); } else { - double remaining = 0.0; - for (int row = selected->selectedRows().front().row(); row < int(playlist_clips->size()); ++row) { - const Clip clip = *playlist_clips->clip(row); - remaining += double(clip.pts_out - clip.pts_in) / TIMEBASE / 0.5; // FIXME: stop hardcoding speed. + vector clips; + for (size_t row = 0; row < playlist_clips->size(); ++row) { + clips.push_back(*playlist_clips->clip(row)); } + double remaining = compute_time_left(clips, {{selected->selectedRows().front().row(), 0.0}}); set_output_status(format_duration(remaining) + " ready"); } } -- 2.39.2