summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-27 23:33:23 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-27 23:33:23 +0000
commit3a42767c354cb0877f17a2a0078bbf37380967d0 (patch)
treec9d347cd9b367c5c164ebf66f12cddf39223fdb2 /src/lib
parent51bdd082283e39ebeca5150995d98cdade189fe1 (diff)
Similar fix for scaling (#1416).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player_video.cc6
-rw-r--r--src/lib/player_video.h6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index 1df8fb3e8..023ab826a 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 (except crop) */
+ /* XXX: this assumes that image() and prepare() are only ever called with the same parameters (except crop, inter size, out size) */
boost::mutex::scoped_lock lm (_mutex);
- if (!_image || _crop != _image_crop) {
+ if (!_image || _crop != _image_crop || _inter_size != _image_inter_size || _out_size != _image_out_size) {
make_image (pixel_format, aligned, fast);
}
return _image;
@@ -125,6 +125,8 @@ void
PlayerVideo::make_image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
{
_image_crop = _crop;
+ _image_inter_size = _inter_size;
+ _image_out_size = _out_size;
pair<shared_ptr<Image>, int> prox = _in->image (_inter_size);
shared_ptr<Image> im = prox.first;
diff --git a/src/lib/player_video.h b/src/lib/player_video.h
index 1e214beea..6275c5113 100644
--- a/src/lib/player_video.h
+++ b/src/lib/player_video.h
@@ -126,8 +126,12 @@ private:
mutable boost::mutex _mutex;
mutable boost::shared_ptr<Image> _image;
- /** crop that was used to make _image */
+ /** _crop that was used to make _image */
mutable Crop _image_crop;
+ /** _inter_size that was used to make _image */
+ mutable dcp::Size _image_inter_size;
+ /** _out_size that was used to make _image */
+ mutable dcp::Size _image_out_size;
};
#endif