Fix bug: center cut-out didn't use cut off pixels.

This commit is contained in:
Johns 2015-03-10 10:10:14 +01:00
parent 4e72638766
commit a36221dea7
2 changed files with 20 additions and 9 deletions

View File

@ -1,6 +1,7 @@
User johns
Date:
Fix bug: center cut-out didn't use cut off pixels.
Fix bug #2058: support for Make.plgcfg.
Fix for compile with vdr 2.1.10, for older vdr versions.

28
video.c
View File

@ -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);
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;
// FIXME: round failure?
} 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;
}
//----------------------------------------------------------------------------