diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-11-27 23:24:33 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-11-27 23:24:33 +0000 |
| commit | 51bdd082283e39ebeca5150995d98cdade189fe1 (patch) | |
| tree | cd727d71e44e50ff98ed306926b295d8422a2325 /src/lib | |
| parent | b8f0865d6a5d182dc4c718b9320c82091864e55b (diff) | |
Fix non-updating crop settings (#1421).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player_video.cc | 6 | ||||
| -rw-r--r-- | 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<Image> PlayerVideo::image (function<AVPixelFormat (AVPixelFormat)> 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<AVPixelFormat (AVPixelFormat)> pixel_format, bool a void PlayerVideo::make_image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const { + _image_crop = _crop; + pair<shared_ptr<Image>, int> prox = _in->image (_inter_size); shared_ptr<Image> 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> _image; + /** crop that was used to make _image */ + mutable Crop _image_crop; }; #endif |
