mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: center cut-out didn't use cut off pixels.
This commit is contained in:
parent
4e72638766
commit
a36221dea7
@ -1,6 +1,7 @@
|
|||||||
User johns
|
User johns
|
||||||
Date:
|
Date:
|
||||||
|
|
||||||
|
Fix bug: center cut-out didn't use cut off pixels.
|
||||||
Fix bug #2058: support for Make.plgcfg.
|
Fix bug #2058: support for Make.plgcfg.
|
||||||
Fix for compile with vdr 2.1.10, for older vdr versions.
|
Fix for compile with vdr 2.1.10, for older vdr versions.
|
||||||
|
|
||||||
|
28
video.c
28
video.c
@ -632,27 +632,37 @@ static void VideoUpdateOutput(AVRational input_aspect_ratio, int input_width,
|
|||||||
|
|
||||||
// look which side must be cut
|
// look which side must be cut
|
||||||
if (*crop_width > video_width) {
|
if (*crop_width > video_width) {
|
||||||
*crop_height = input_height;
|
int tmp;
|
||||||
|
|
||||||
|
*crop_height = input_height - VideoCutTopBottom[resolution] * 2;
|
||||||
|
|
||||||
// adjust scaling
|
// adjust scaling
|
||||||
*crop_x = ((*crop_width - video_width) * input_width)
|
tmp = ((*crop_width - video_width) * input_width) / (2 * video_width);
|
||||||
/ (2 * video_width);
|
// FIXME: round failure?
|
||||||
|
if (tmp > *crop_x) {
|
||||||
|
*crop_x = tmp;
|
||||||
|
}
|
||||||
*crop_width = input_width - *crop_x * 2;
|
*crop_width = input_width - *crop_x * 2;
|
||||||
// FIXME: round failure?
|
|
||||||
} else if (*crop_height > video_height) {
|
} else if (*crop_height > video_height) {
|
||||||
*crop_width = input_width;
|
int tmp;
|
||||||
|
|
||||||
|
*crop_width = input_width - VideoCutLeftRight[resolution] * 2;
|
||||||
|
|
||||||
// adjust scaling
|
// adjust scaling
|
||||||
*crop_y = ((*crop_height - video_height) * input_height)
|
tmp = ((*crop_height - video_height) * input_height)
|
||||||
/ (2 * video_height);
|
/ (2 * video_height);
|
||||||
*crop_height = input_height - *crop_y * 2;
|
|
||||||
// FIXME: round failure?
|
// FIXME: round failure?
|
||||||
|
if (tmp > *crop_y) {
|
||||||
|
*crop_y = tmp;
|
||||||
|
}
|
||||||
|
*crop_height = input_height - *crop_y * 2;
|
||||||
} else {
|
} else {
|
||||||
*crop_width = input_width;
|
*crop_width = input_width - VideoCutLeftRight[resolution] * 2;
|
||||||
*crop_height = input_height;
|
*crop_height = input_height - VideoCutTopBottom[resolution] * 2;
|
||||||
}
|
}
|
||||||
Debug(3, "video: aspect crop %dx%d%+d%+d\n", *crop_width, *crop_height,
|
Debug(3, "video: aspect crop %dx%d%+d%+d\n", *crop_width, *crop_height,
|
||||||
*crop_x, *crop_y);
|
*crop_x, *crop_y);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user