Update audio latency without restart using RARCH_CMD_AUDIO_REINIT

This commit is contained in:
Mike Robinson 2014-10-08 06:01:46 +01:00
parent 63741eeb57
commit c8b452e5ac
3 changed files with 9 additions and 0 deletions

View File

@ -158,6 +158,7 @@ enum basic_event
RARCH_CMD_COMMAND_DEINIT,
RARCH_CMD_DRIVERS_DEINIT,
RARCH_CMD_DRIVERS_INIT,
RARCH_CMD_AUDIO_REINIT,
RARCH_CMD_TEMPORARY_CONTENT_DEINIT,
RARCH_CMD_SUBSYSTEM_FULLPATHS_DEINIT,
RARCH_CMD_LOG_FILE_DEINIT,

View File

@ -2456,6 +2456,10 @@ bool rarch_main_command(unsigned cmd)
case RARCH_CMD_DRIVERS_INIT:
init_drivers(DRIVERS_CMD_ALL);
break;
case RARCH_CMD_AUDIO_REINIT:
uninit_drivers(DRIVER_AUDIO);
init_drivers(DRIVER_AUDIO);
break;
case RARCH_CMD_RESET_CONTEXT:
rarch_main_command(RARCH_CMD_DRIVERS_DEINIT);
rarch_main_command(RARCH_CMD_DRIVERS_INIT);

View File

@ -1998,6 +1998,8 @@ static void general_write_handler(void *data)
}
else if (!strcmp(setting->name, "audio_volume"))
g_extern.audio_data.volume_gain = db_to_gain(*setting->value.fraction);
else if (!strcmp(setting->name, "audio_latency"))
rarch_cmd = RARCH_CMD_AUDIO_REINIT;
else if (!strcmp(setting->name, "audio_rate_control_delta"))
{
if (*setting->value.fraction < 0.0005)
@ -3628,6 +3630,8 @@ bool setting_data_append_list_audio_options(
subgroup_info.name,
general_write_handler,
general_read_handler);
settings_list_current_add_range(list, list_info, 1, 256, 1.0, true, true);
CONFIG_FLOAT(
g_settings.audio.rate_control_delta,