X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fexport.cpp;h=1aea044c224162398debf7fd6ae67aa4480871ff;hb=b3a7a9eddd8b800f1b921332e8fdacb72e0d9b20;hp=dce83c34a34b1503ef276800c31930b2602ea89b;hpb=4a9e97065dade428e373a83618bc973cd93cbe52;p=nageru diff --git a/futatabi/export.cpp b/futatabi/export.cpp index dce83c3..1aea044 100644 --- a/futatabi/export.cpp +++ b/futatabi/export.cpp @@ -223,7 +223,11 @@ void export_interpolated_clip(const string &filename, const vector &clips) progress.setMaximum(100000); progress.setValue(0); - double total_length = compute_time_left(clips, { { 0, 0.0 } }); + vector clips_with_row; + for (const Clip &clip : clips) { + clips_with_row.emplace_back(Player::ClipWithRow{ clip, 0 }); + } + double total_length = compute_total_time(clips_with_row); promise done_promise; future done = done_promise.get_future(); @@ -236,10 +240,10 @@ void export_interpolated_clip(const string &filename, const vector &clips) done_promise.set_value(); } }); - player.set_progress_callback([¤t_value, &clips, total_length](const std::map &player_progress) { - current_value = 1.0 - compute_time_left(clips, player_progress) / total_length; + player.set_progress_callback([¤t_value, &clips, total_length](const std::map &player_progress, double time_remaining) { + current_value = 1.0 - time_remaining / total_length; }); - player.play(clips); + player.play(clips_with_row); while (done.wait_for(std::chrono::milliseconds(100)) != future_status::ready && !progress.wasCanceled()) { progress.setValue(lrint(100000.0 * current_value)); }