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/player.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/player.cc')
| -rw-r--r-- | src/lib/player.cc | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 4417c940d..7899f2e83 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -280,18 +280,28 @@ Player::setup_pieces_unlocked () void Player::playlist_content_change (ChangeType type, int property, bool frequent) { - if (type == CHANGE_TYPE_PENDING) { - /* The player content is probably about to change, so we can't carry on - until that has happened and we've rebuilt our pieces. Stop pass() - and seek() from working until then. - */ - ++_suspended; - } else if (type == CHANGE_TYPE_DONE) { - /* A change in our content has gone through. Re-build our pieces. */ - setup_pieces (); - --_suspended; - } else if (type == CHANGE_TYPE_CANCELLED) { - --_suspended; + if (property == VideoContentProperty::CROP) { + if (type == CHANGE_TYPE_DONE) { + dcp::Size const vcs = video_container_size(); + boost::mutex::scoped_lock lm (_mutex); + for (list<pair<shared_ptr<PlayerVideo>, DCPTime> >::const_iterator i = _delay.begin(); i != _delay.end(); ++i) { + i->first->reset_metadata (_film, vcs); + } + } + } else { + if (type == CHANGE_TYPE_PENDING) { + /* The player content is probably about to change, so we can't carry on + until that has happened and we've rebuilt our pieces. Stop pass() + and seek() from working until then. + */ + ++_suspended; + } else if (type == CHANGE_TYPE_DONE) { + /* A change in our content has gone through. Re-build our pieces. */ + setup_pieces (); + --_suspended; + } else if (type == CHANGE_TYPE_CANCELLED) { + --_suspended; + } } Change (type, property, frequent); |
