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-22 13:29:59 +0100
commit721b17d3384989f2d378a37bbfb25fac0551b117 (patch)
treef9931d50e093909e47bf32e3df3c6294e0bc4f24
parentf6f1e325b56acce9a1e7349daeb896bc76fddffc (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();
}