diff --git a/retroarch.c b/retroarch.c index cee3f72db7..4299257a00 100644 --- a/retroarch.c +++ b/retroarch.c @@ -30054,11 +30054,12 @@ static bool video_driver_init_internal( ) { video_info_t video; + struct retro_game_geometry geom; unsigned max_dim, scale, width, height; video_viewport_t *custom_vp = NULL; input_driver_t *tmp = NULL; static uint16_t dummy_pixels[32] = {0}; - struct retro_game_geometry *geom = &p_rarch->video_driver_av_info.geometry; + struct retro_game_geometry *core_geom = &p_rarch->video_driver_av_info.geometry; const enum retro_pixel_format video_driver_pix_fmt = p_rarch->video_driver_pix_fmt; #ifdef HAVE_VIDEO_FILTER @@ -30068,7 +30069,15 @@ static bool video_driver_init_internal( video_driver_init_filter(video_driver_pix_fmt, settings); #endif - max_dim = MAX(geom->max_width, geom->max_height); + geom.base_width = core_geom->base_width; + geom.base_height = core_geom->base_height; + geom.max_width = core_geom->max_width; + geom.max_height = core_geom->max_height; + geom.aspect_ratio = core_geom->aspect_ratio; + + RARCH_LOG("[Video]: AV geometry base width: %d, base_height: %d\n", geom.base_width, geom.base_height); + RARCH_LOG("[Video]: AV geometry max_width: %d, max_height: %d, aspect: %.2f\n", geom.max_width, geom.max_height, geom.aspect_ratio); + max_dim = MAX(geom.max_width, geom.max_height); scale = next_pow2(max_dim) / RARCH_SCALE_BASE; scale = MAX(scale, 1); @@ -30081,9 +30090,9 @@ static bool video_driver_init_internal( max_dim, scale); /* Update core-dependent aspect ratio values. */ - video_driver_set_viewport_square_pixel(geom); + video_driver_set_viewport_square_pixel(&geom); video_driver_set_viewport_core(); - video_driver_set_viewport_config(geom, + video_driver_set_viewport_config(&geom, settings->floats.video_aspect_ratio, settings->bools.video_aspect_ratio_auto); @@ -30132,13 +30141,13 @@ static bool video_driver_init_internal( { /* Do rounding here to simplify integer scale correctness. */ unsigned base_width = - roundf(geom->base_height * p_rarch->video_driver_aspect_ratio); + roundf(geom.base_height * p_rarch->video_driver_aspect_ratio); width = roundf(base_width * video_scale); RARCH_LOG("[Video]: Force video aspect\n"); } else - width = roundf(geom->base_width * video_scale); - height = roundf(geom->base_height * video_scale); + width = roundf(geom.base_width * video_scale); + height = roundf(geom.base_height * video_scale); RARCH_LOG("[Video]: Set width and height based on window position width [%dx%d]\n", width, height); } }