diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-05-12 15:38:31 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-05-15 23:49:51 +0200 |
| commit | 61130610f6d01fe6b1682d91933eb7dbbb1eac76 (patch) | |
| tree | e7f4c721a1c8d7643681d61447123bd1852bfc92 /src/lib/player.cc | |
| parent | 26678a922a1808db33954e002c165678d8191fc6 (diff) | |
Update DCP encoder progress on all passe()es, not just when audio is emitted.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 2e96e4bee..91a51c67f 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -1671,3 +1671,17 @@ Player::frames_done() const return earliest_time.get_value_or({}).frames_round(film->video_frame_rate()); } + + +float +Player::progress() const +{ + auto film = _film.lock(); + DCPOMATIC_ASSERT(film); + + shared_ptr<Piece> earliest_content; + 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(); +} |
