From 721b17d3384989f2d378a37bbfb25fac0551b117 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 20 Mar 2025 01:25:58 +0100 Subject: Fix progress reporting. earliest_time will be empty when we're at the end of the film, not the beginning. --- src/lib/player.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') 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 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 earliest_time; std::tie(earliest_content, earliest_time) = earliest_piece_and_time(); - return static_cast(earliest_time.get_value_or({}).get()) / film->length().get(); + return static_cast(earliest_time.get_value_or(film->length()).get()) / film->length().get(); } -- cgit v1.2.3