Skip to content

Commit

Permalink
Fix some overscan issues in 16bpp mode with double width capture
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Mar 24, 2023
1 parent df878bd commit a5c7f1f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/geometry.c
Expand Up @@ -867,17 +867,24 @@ void geometry_get_fb_params(capture_info_t *capinfo) {
int apparent_height = get_vdisplay();
double_width = (capinfo->sizex2 & SIZEX2_DOUBLE_WIDTH) >> 1;
double_height = capinfo->sizex2 & SIZEX2_DOUBLE_HEIGHT;

hscale >>= double_width;
if (_get_hardware_id() == _RPI && capinfo->bpp == 16 && !uneven) {
if (get_gscaling() == GSCALING_INTEGER) {
int actual_width = (capinfo->chars_per_line << 3);
int actual_height = capinfo->nlines;
left = (apparent_width - (actual_width * hscale)) / 2;
right = left;
top = (apparent_height - (actual_height * vscale)) / 2;
bottom = top;
capinfo->width = actual_width << double_width;
capinfo->height = actual_height << double_height;
if (left >=0 && top >=0) {
right = left;
bottom = top;
capinfo->width = actual_width;
capinfo->height = actual_height << double_height;
} else {
left = 0;
right = 0;
top = 0;
bottom = 0;
}
//log_info("sizes = %d %d %d %d %d %d %d %d %d %d", apparent_width,apparent_height,actual_width, actual_height ,hscale,vscale,left,right,top,bottom);
} else {
top = 0;
Expand Down

0 comments on commit a5c7f1f

Please sign in to comment.