summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-23 15:33:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-23 15:33:45 +0100
commit97890961be41534b5aae058017d7d65a44d7d0fb (patch)
treead4e6623d699b6da52df4844279907cd86186c09 /src/lib
parentd6be9f27147113dc6355ed0de7c99d1312aaeebd (diff)
Try to fix problems with odd crop values and YUV.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/image.cc2
-rw-r--r--src/lib/player.cc7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 5c04f70e6..f9a42f93b 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -420,7 +420,7 @@ Image::allocate ()
_stride[0] = _stride[1] = _stride[2] = _stride[3] = 0;
for (int i = 0; i < components(); ++i) {
- _line_size[i] = _size.width * bytes_per_pixel(i);
+ _line_size[i] = ceil (_size.width * bytes_per_pixel(i));
_stride[i] = stride_round_up (i, _line_size, _aligned ? 32 : 1);
_data[i] = (uint8_t *) av_malloc (_stride[i] * lines (i));
}
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 84589ce39..8a37cb835 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -250,8 +250,11 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image
if (content->trimmed (relative_time)) {
return;
}
-
- shared_ptr<Image> work_image = image->crop (content->crop(), true);
+
+ /* Convert to RGB first, as FFmpeg doesn't seem to like handling YUV images with odd widths */
+ shared_ptr<Image> work_image = image->scale (image->size (), _film->scaler(), PIX_FMT_RGB24, true);
+
+ shared_ptr<Image> work_image = work_image->crop (content->crop(), true);
libdcp::Size const image_size = content->ratio()->size (_video_container_size);