summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-20 01:25:58 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-20 01:25:58 +0100
commit29c84f0827c368432232161554e5ca5408e89bd7 (patch)
tree203c690a14601ca0113ec906f4988d1244fcc959
parente6490d7e293380aa32c2cf097faf08e31a7ea412 (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.cc4
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();
}