diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-24 22:54:11 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-08-24 22:54:11 +0200 |
| commit | bb0bf599e9d114246fac113442391cfd890a2836 (patch) | |
| tree | 90bc1de94bdaf343661bff6e365b9e5fcdd97ede /src/lib | |
| parent | f07aadd69c58fef14f36c9a844f7834c93b4a7de (diff) | |
Add Player::set_always_trim.cpl-trim
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 12 | ||||
| -rw-r--r-- | src/lib/player.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 57fc7a67c..a940b42b8 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -97,6 +97,7 @@ Player::Player (shared_ptr<const Film> film) , _fast (false) , _tolerant (film->tolerant()) , _play_referenced (false) + , _always_trim (false) , _audio_merger (_film->audio_frame_rate()) , _shuffler (0) { @@ -114,6 +115,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist , _fast (false) , _tolerant (film->tolerant()) , _play_referenced (false) + , _always_trim (false) , _audio_merger (_film->audio_frame_rate()) , _shuffler (0) { @@ -504,6 +506,16 @@ Player::set_play_referenced () setup_pieces_unlocked (); } + +void +Player::set_always_trim () +{ + boost::mutex::scoped_lock lm (_mutex); + _always_trim = true; + setup_pieces_unlocked (); +} + + static void maybe_add_asset (list<ReferencedReelAsset>& a, shared_ptr<dcp::ReelAsset> r, Frame reel_trim_start, Frame reel_trim_end, DCPTime from, int const ffr) { diff --git a/src/lib/player.h b/src/lib/player.h index ea81ae939..50f78d2f8 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -93,6 +93,7 @@ public: void set_always_burn_open_subtitles (); void set_fast (); void set_play_referenced (); + void set_always_trim (); void set_dcp_decode_reduction (boost::optional<int> reduction); boost::optional<dcpomatic::DCPTime> content_time_to_dcp (boost::shared_ptr<Content> content, dcpomatic::ContentTime t); @@ -184,6 +185,8 @@ private: bool _tolerant; /** true if we should `play' (i.e output) referenced DCP data (e.g. for preview) */ bool _play_referenced; + /** true if we should always trim content, even if it is set to TRIM_PLAYLIST (e.g. for preview) */ + bool _always_trim; /** Time just after the last video frame we emitted, or the time of the last accurate seek */ boost::optional<dcpomatic::DCPTime> _last_video_time; |
