X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fexport.cpp;h=a865ac6e9369331a3806ef430c70c82b12d33392;hb=6a2b68fa99bfd87e9b67edddef025b53188633ae;hp=d513cf0dacf5a6f6f74ff9cbe14ffde737cee615;hpb=4b84fc30175a4dfb56a25ba0b2f9b88ab54cfe7d;p=nageru diff --git a/futatabi/export.cpp b/futatabi/export.cpp index d513cf0..a865ac6 100644 --- a/futatabi/export.cpp +++ b/futatabi/export.cpp @@ -227,7 +227,7 @@ void export_interpolated_clip(const string &filename, const vector &clips) for (const Clip &clip : clips) { clips_with_id.emplace_back(ClipWithID{ clip, 0 }); } - double total_length = compute_total_time(clips_with_id); + TimeRemaining total_length = compute_total_time(clips_with_id); promise done_promise; future done = done_promise.get_future(); @@ -237,8 +237,8 @@ void export_interpolated_clip(const string &filename, const vector &clips) player.set_done_callback([&done_promise] { done_promise.set_value(); }); - player.set_progress_callback([¤t_value, total_length](const std::map &player_progress, double time_remaining) { - current_value = 1.0 - time_remaining / total_length; + player.set_progress_callback([¤t_value, total_length](const std::map &player_progress, TimeRemaining time_remaining) { + current_value = 1.0 - time_remaining.t / total_length.t; // Nothing to do about the infinite clips. }); player.play(clips_with_id); while (done.wait_for(std::chrono::milliseconds(100)) != future_status::ready && !progress.wasCanceled()) {