From 51bdd082283e39ebeca5150995d98cdade189fe1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Nov 2018 23:24:33 +0000 Subject: [PATCH] Fix non-updating crop settings (#1421). --- src/lib/player_video.cc | 6 ++++-- src/lib/player_video.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 6c0cf20c1..1df8fb3e8 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -105,10 +105,10 @@ PlayerVideo::set_text (PositionImage image) shared_ptr PlayerVideo::image (function pixel_format, bool aligned, bool fast) const { - /* XXX: this assumes that image() and prepare() are only ever called with the same parameters */ + /* XXX: this assumes that image() and prepare() are only ever called with the same parameters (except crop) */ boost::mutex::scoped_lock lm (_mutex); - if (!_image) { + if (!_image || _crop != _image_crop) { make_image (pixel_format, aligned, fast); } return _image; @@ -124,6 +124,8 @@ PlayerVideo::image (function pixel_format, bool a void PlayerVideo::make_image (function pixel_format, bool aligned, bool fast) const { + _image_crop = _crop; + pair, int> prox = _in->image (_inter_size); shared_ptr im = prox.first; int const reduce = prox.second; diff --git a/src/lib/player_video.h b/src/lib/player_video.h index a874fd3b2..1e214beea 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -126,6 +126,8 @@ private: mutable boost::mutex _mutex; mutable boost::shared_ptr _image; + /** crop that was used to make _image */ + mutable Crop _image_crop; }; #endif -- 2.30.2