diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-20 01:25:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-22 13:29:59 +0100 |
| commit | 721b17d3384989f2d378a37bbfb25fac0551b117 (patch) | |
| tree | f9931d50e093909e47bf32e3df3c6294e0bc4f24 | |
| parent | f6f1e325b56acce9a1e7349daeb896bc76fddffc (diff) | |
Fix progress reporting.
earliest_time will be empty when we're at the end of the film, not the
beginning.
| -rw-r--r-- | src/lib/player.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 45b6051c7..869067906 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1662,7 +1662,7 @@ Player::frames_done() const optional<DCPTime> earliest_time; std::tie(earliest_content, earliest_time) = earliest_piece_and_time(); - return earliest_time.get_value_or({}).frames_round(film->video_frame_rate()); + return earliest_time.get_value_or(film->length()).frames_round(film->video_frame_rate()); } @@ -1676,5 +1676,5 @@ Player::progress() const optional<DCPTime> earliest_time; std::tie(earliest_content, earliest_time) = earliest_piece_and_time(); - return static_cast<float>(earliest_time.get_value_or({}).get()) / film->length().get(); + return static_cast<float>(earliest_time.get_value_or(film->length()).get()) / film->length().get(); } |
