]> git.sesse.net Git - nageru/blobdiff - futatabi/export.cpp
Make it possible to queue and play clips with no cue-out set (infinite clips). Note...
[nageru] / futatabi / export.cpp
index d513cf0dacf5a6f6f74ff9cbe14ffde737cee615..a865ac6e9369331a3806ef430c70c82b12d33392 100644 (file)
@@ -227,7 +227,7 @@ void export_interpolated_clip(const string &filename, const vector<Clip> &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<void> done_promise;
        future<void> done = done_promise.get_future();
@@ -237,8 +237,8 @@ void export_interpolated_clip(const string &filename, const vector<Clip> &clips)
        player.set_done_callback([&done_promise] {
                done_promise.set_value();
        });
-       player.set_progress_callback([&current_value, total_length](const std::map<uint64_t, double> &player_progress, double time_remaining) {
-               current_value = 1.0 - time_remaining / total_length;
+       player.set_progress_callback([&current_value, total_length](const std::map<uint64_t, double> &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()) {