1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 00:42:57 +00:00

options: handle --audio-device changes like the other options

Don't require special property code for handling updates, and simply use
the UPDATE_AUDIO flag instead. Also make runtime changes to
--audio-client-name take effect.
This commit is contained in:
wm4 2016-10-05 16:45:04 +02:00
parent 6fb12a5fda
commit d7e587acc9
2 changed files with 3 additions and 6 deletions

View File

@ -499,9 +499,9 @@ const m_option_t mp_opts[] = {
OPT_SETTINGSLIST("ao", audio_driver_list, 0, &ao_obj_list, ), OPT_SETTINGSLIST("ao", audio_driver_list, 0, &ao_obj_list, ),
OPT_SETTINGSLIST("ao-defaults", ao_defs, 0, &ao_obj_list, OPT_SETTINGSLIST("ao-defaults", ao_defs, 0, &ao_obj_list,
.deprecation_message = "deprecated, use global options"), .deprecation_message = "deprecated, use global options"),
OPT_STRING("audio-device", audio_device, 0), OPT_STRING("audio-device", audio_device, UPDATE_AUDIO),
OPT_FLAG("audio-exclusive", audio_exclusive, UPDATE_AUDIO), OPT_FLAG("audio-exclusive", audio_exclusive, UPDATE_AUDIO),
OPT_STRING("audio-client-name", audio_client_name, 0), OPT_STRING("audio-client-name", audio_client_name, UPDATE_AUDIO),
OPT_FLAG("audio-fallback-to-null", ao_null_fallback, 0), OPT_FLAG("audio-fallback-to-null", ao_null_fallback, 0),
OPT_FLAG("audio-stream-silence", audio_stream_silence, 0), OPT_FLAG("audio-stream-silence", audio_stream_silence, 0),
OPT_FLOATRANGE("audio-wait-open", audio_wait_open, 0, 0, 60), OPT_FLOATRANGE("audio-wait-open", audio_wait_open, 0, 0, 60),

View File

@ -1908,10 +1908,7 @@ static int mp_property_audio_device(void *ctx, struct m_property *prop,
} }
} }
} }
int r = mp_property_generic_option(mpctx, prop, action, arg); return mp_property_generic_option(mpctx, prop, action, arg);
if (action == M_PROPERTY_SET)
reload_audio_output(mpctx);
return r;
} }
static int mp_property_audio_devices(void *ctx, struct m_property *prop, static int mp_property_audio_devices(void *ctx, struct m_property *prop,