diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-01 11:32:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-01 11:32:36 +0100 |
| commit | be2e6e017d853069f02a83f5fe67423235c3096c (patch) | |
| tree | 6853a9192af405c3ddb5e60f431b16ecbfdf344e /src/lib/butler.cc | |
| parent | 090cd7dabd2f975e493a9bbd22754ee578d6a1b2 (diff) | |
Changes to crop can be handled with a reset_metadata().
While playback is happening we need to do that in the butler's
buffers and in the little delay inside Player.
This removes the seek on every crop change, making it a lot
quicker (#1758).
Diffstat (limited to 'src/lib/butler.cc')
| -rw-r--r-- | src/lib/butler.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/butler.cc b/src/lib/butler.cc index 4ab0092c4..270abd2d6 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -26,6 +26,7 @@ #include "cross.h" #include "compose.hpp" #include "exceptions.h" +#include "video_content.h" #include <boost/weak_ptr.hpp> #include <boost/shared_ptr.hpp> @@ -89,7 +90,7 @@ Butler::Butler ( /* The butler must hear about things first, otherwise it might not sort out suspensions in time for get_video() to be called in response to this signal. */ - _player_change_connection = _player->Change.connect (bind (&Butler::player_change, this, _1), boost::signals2::at_front); + _player_change_connection = _player->Change.connect (bind (&Butler::player_change, this, _1, _2), boost::signals2::at_front); _thread = boost::thread (bind(&Butler::thread, this)); #ifdef DCPOMATIC_LINUX pthread_setname_np (_thread.native_handle(), "butler"); @@ -381,8 +382,18 @@ Butler::memory_used () const } void -Butler::player_change (ChangeType type) +Butler::player_change (ChangeType type, int property) { + if (property == VideoContentProperty::CROP) { + if (type == CHANGE_TYPE_DONE) { + shared_ptr<const Film> film = _film.lock(); + if (film) { + _video.reset_metadata (film, _player->video_container_size()); + } + } + return; + } + boost::mutex::scoped_lock lm (_mutex); if (type == CHANGE_TYPE_PENDING) { |
