diff --git a/audio/audio_driver.c b/audio/audio_driver.c index ebdc6465b7..54ba10e362 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -891,6 +891,17 @@ bool audio_driver_disable_callback(void) return true; } +/* Sets audio monitor rate to new value. */ +void audio_driver_monitor_set_rate(void) +{ + settings_t *settings = config_get_ptr(); + double new_src_ratio = (double)settings->audio.out_rate / + audio_driver_data.audio_rate.input; + + audio_driver_data.audio_rate.source_ratio.original = new_src_ratio; + audio_driver_data.audio_rate.source_ratio.current = new_src_ratio; +} + bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data) { settings_t *settings = config_get_ptr(); @@ -921,15 +932,6 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data) case RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES: audio_monitor_adjust_system_rates(); break; - case RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE: - { - double new_src_ratio = (double)settings->audio.out_rate / - audio_driver_data.audio_rate.input; - - audio_driver_data.audio_rate.source_ratio.original = new_src_ratio; - audio_driver_data.audio_rate.source_ratio.current = new_src_ratio; - } - break; case RARCH_AUDIO_CTL_MUTE_TOGGLE: if (!audio_driver_context_audio_data) return false; diff --git a/audio/audio_driver.h b/audio/audio_driver.h index c2b6c33a94..1e9989f8e6 100644 --- a/audio/audio_driver.h +++ b/audio/audio_driver.h @@ -45,8 +45,6 @@ enum rarch_audio_ctl_state RARCH_AUDIO_CTL_DESTROY_DATA, RARCH_AUDIO_CTL_START, RARCH_AUDIO_CTL_STOP, - /* Sets audio monitor refresh rate to new value. */ - RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE, RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES, RARCH_AUDIO_CTL_MUTE_TOGGLE, RARCH_AUDIO_CTL_UNSET_CALLBACK, @@ -181,6 +179,9 @@ void audio_driver_setup_rewind(void); bool audio_driver_set_callback(const void *data); +/* Sets audio monitor rate to new value. */ +void audio_driver_monitor_set_rate(void); + bool audio_driver_find_driver(void); bool audio_driver_deinit(void); diff --git a/driver.c b/driver.c index fc0c9ac4ea..5cda09a53e 100644 --- a/driver.c +++ b/driver.c @@ -477,7 +477,7 @@ bool driver_ctl(enum driver_ctl_state state, void *data) { float *hz = (float*)data; video_monitor_set_refresh_rate(*hz); - audio_driver_ctl(RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE, NULL); + audio_driver_monitor_set_rate(); driver_adjust_system_rates(); } break;