Don't omit AR changes when not reinitting video in SET_SYSTEM_AV_INFO

This commit is contained in:
Nikos Chantziaras 2019-11-19 04:26:31 +02:00
parent c0bc8d2df2
commit 33ab147514
No known key found for this signature in database
GPG Key ID: 15B600E72CA59238

View File

@ -9595,21 +9595,23 @@ static bool rarch_environment_cb(unsigned cmd, void *data)
if (info && av_info)
{
settings_t *settings = configuration_settings;
int reinit_flags = DRIVERS_CMD_ALL;
const bool no_video_reinit =
settings->uints.crt_switch_resolution == 0 && data
&& (*info)->geometry.max_width == av_info->geometry.max_width
&& (*info)->geometry.max_height == av_info->geometry.max_height;
/* When not doing video reinit, we also must not do input and menu
* reinit, otherwise the input driver crashes and the menu gets
* corrupted. */
int reinit_flags = no_video_reinit ?
DRIVERS_CMD_ALL & ~(DRIVER_VIDEO_MASK | DRIVER_INPUT_MASK | DRIVER_MENU_MASK)
: DRIVERS_CMD_ALL;
RARCH_LOG("[Environ]: SET_SYSTEM_AV_INFO.\n");
if (settings->uints.crt_switch_resolution == 0 && data
&& (*info)->geometry.max_width == av_info->geometry.max_width
&& (*info)->geometry.max_height == av_info->geometry.max_height)
{
/* When not doing video reinit, we also must not do input and
* menu reinit, otherwise the input driver crashes and the menu
* gets corrupted. */
reinit_flags &= ~(DRIVER_VIDEO_MASK | DRIVER_INPUT_MASK | DRIVER_MENU_MASK);
}
memcpy(av_info, *info, sizeof(*av_info));
command_event(CMD_EVENT_REINIT, &reinit_flags);
if (no_video_reinit)
video_driver_set_aspect_ratio();
/* Cannot continue recording with different parameters.
* Take the easiest route out and just restart the recording. */