diff options
author | Johns <johns98@gmx.net> | 2015-03-10 10:10:14 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2015-03-10 10:10:14 +0100 |
commit | a36221dea7ea84943c9df195e360196179e94afb (patch) | |
tree | 109b8f7a0b5e5a46eb8ab313910f848cbf2c175a /video.c | |
parent | 4e7263876615e49db278cc21c195b6d44e03ed80 (diff) | |
download | vdr-plugin-softhddevice-a36221dea7ea84943c9df195e360196179e94afb.tar.gz vdr-plugin-softhddevice-a36221dea7ea84943c9df195e360196179e94afb.tar.bz2 |
Fix bug: center cut-out didn't use cut off pixels.
Diffstat (limited to 'video.c')
-rw-r--r-- | video.c | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -632,27 +632,37 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width, // look which side must be cut if (*crop_width > video_width) { - *crop_height = input_height; + int tmp; + + *crop_height = input_height - VideoCutTopBottom[resolution] * 2; // adjust scaling - *crop_x = ((*crop_width - video_width) * input_width) - / (2 * video_width); - *crop_width = input_width - *crop_x * 2; + tmp = ((*crop_width - video_width) * input_width) / (2 * video_width); // FIXME: round failure? + if (tmp > *crop_x) { + *crop_x = tmp; + } + *crop_width = input_width - *crop_x * 2; } else if (*crop_height > video_height) { - *crop_width = input_width; + int tmp; + + *crop_width = input_width - VideoCutLeftRight[resolution] * 2; // adjust scaling - *crop_y = ((*crop_height - video_height) * input_height) + tmp = ((*crop_height - video_height) * input_height) / (2 * video_height); - *crop_height = input_height - *crop_y * 2; // FIXME: round failure? + if (tmp > *crop_y) { + *crop_y = tmp; + } + *crop_height = input_height - *crop_y * 2; } else { - *crop_width = input_width; - *crop_height = input_height; + *crop_width = input_width - VideoCutLeftRight[resolution] * 2; + *crop_height = input_height - VideoCutTopBottom[resolution] * 2; } Debug(3, "video: aspect crop %dx%d%+d%+d\n", *crop_width, *crop_height, *crop_x, *crop_y); + return; } //---------------------------------------------------------------------------- |