Merge pull request #9852 from realnc/swap-interval-drc

Support DRC even when using a vsync swap interval higher than 1
This commit is contained in:
hizzlekizzle 2019-12-13 22:16:25 -06:00 committed by GitHub
commit b468aa8c01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -38,6 +38,7 @@
- SCANNER/MANUAL: Add option to scan inside archives
- SCANNER/MANUAL: Enable automatic naming of arcade content via DAT files. This is compatible with DAT files in either Logiqx XML or MAME List XML format.
- VIDEO: Do not reinit video driver on SET_SYSTEM_AV_INFO unless needed
- VIDEO: Support DRC even when using a vsync swap interval higher than 1
- VIDEO LAYOUT: Fixed XML parsing of attributes with spaces, should fix issues with several video layouts
- VITA: GL1 driver support
- WINDOWS/XINPUT: Get rid of 128 byte device name limit for XInput device discover - when device name was too long, it would not be picked up by the XInput driver and would instead fallback to DirectInput

View File

@ -18922,7 +18922,8 @@ static void audio_driver_monitor_adjust_system_rates(void)
{
float timing_skew;
settings_t *settings = configuration_settings;
float video_refresh_rate = settings->floats.video_refresh_rate;
const float target_video_sync_rate =
settings->floats.video_refresh_rate / settings->uints.video_swap_interval;
float max_timing_skew = settings->floats.audio_max_timing_skew;
struct retro_system_av_info *av_info = &video_driver_av_info;
const struct retro_system_timing *info =
@ -18931,11 +18932,11 @@ static void audio_driver_monitor_adjust_system_rates(void)
if (info->sample_rate <= 0.0)
return;
timing_skew = fabs(1.0f - info->fps / video_refresh_rate);
timing_skew = fabs(1.0f - info->fps / target_video_sync_rate);
audio_driver_input = info->sample_rate;
if (timing_skew <= max_timing_skew && !settings->bools.vrr_runloop_enable)
audio_driver_input *= (video_refresh_rate / info->fps);
audio_driver_input *= target_video_sync_rate / info->fps;
RARCH_LOG("[Audio]: Set audio input rate to: %.2f Hz.\n",
audio_driver_input);