From 3f704fbba5e7180db6d39f71e578ff0c4b1d7c84 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 2 Feb 2026 18:54:20 +0100 Subject: Stop doing some more stuff during content drags in the timeline. --- src/lib/butler.cc | 8 ++++++-- src/lib/butler.h | 2 +- src/lib/player.cc | 40 +++++++++++++++++++++------------------- 3 files changed, 28 insertions(+), 22 deletions(-) (limited to 'src/lib') diff --git a/src/lib/butler.cc b/src/lib/butler.cc index 2bcd818cc..0c5b29005 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -93,7 +93,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, _2), boost::signals2::at_front); + _player_change_connection = _player.Change.connect(bind(&Butler::player_change, this, _1, _2, _3), boost::signals2::at_front); _thread = boost::thread(bind(&Butler::thread, this)); #ifdef DCPOMATIC_LINUX pthread_setname_np(_thread.native_handle(), "butler"); @@ -404,8 +404,12 @@ Butler::memory_used() const void -Butler::player_change(ChangeType type, int property) +Butler::player_change(ChangeType type, int property, bool frequent) { + if (frequent) { + return; + } + if (property == VideoContentProperty::CROP) { if (type == ChangeType::DONE) { auto film = _film.lock(); diff --git a/src/lib/butler.h b/src/lib/butler.h index d85ec90f4..da94b1523 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -103,7 +103,7 @@ private: void text(PlayerText pt, TextType type, boost::optional track, dcpomatic::DCPTimePeriod period); bool should_run() const; void prepare(std::weak_ptr video); - void player_change(ChangeType type, int property); + void player_change(ChangeType type, int property, bool frequent); void seek_unlocked(dcpomatic::DCPTime position, bool accurate); std::weak_ptr _film; diff --git a/src/lib/player.cc b/src/lib/player.cc index dadf2c73e..c6ef90395 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -407,26 +407,28 @@ Player::playlist_content_change(ChangeType type, int property, bool frequent) return; } - if (property == VideoContentProperty::CROP) { - if (type == ChangeType::DONE) { - boost::mutex::scoped_lock lm(_mutex); - for (auto const& i: _delay) { - i.first->reset_metadata(film, _video_container_size); + if (!frequent) { + if (property == VideoContentProperty::CROP) { + if (type == ChangeType::DONE) { + boost::mutex::scoped_lock lm(_mutex); + for (auto const& i: _delay) { + i.first->reset_metadata(film, _video_container_size); + } + } + } else { + if (type == ChangeType::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 == ChangeType::DONE) { + /* A change in our content has gone through. Re-build our pieces. */ + setup_pieces(); + --_suspended; + } else if (type == ChangeType::CANCELLED) { + --_suspended; } - } - } else { - if (type == ChangeType::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 == ChangeType::DONE) { - /* A change in our content has gone through. Re-build our pieces. */ - setup_pieces(); - --_suspended; - } else if (type == ChangeType::CANCELLED) { - --_suspended; } } -- cgit v1.2.3