diff options
author | wm4 <wm4@nowhere> | 2018-05-21 15:11:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:35 +0200 |
commit | fb22bf2317d4704895fca407507972031e932298 (patch) | |
tree | 8f7432be5ab95b0ea43d6be6b3d4c2866d72d014 /player/command.c | |
parent | 160e5c8377840ddc5cb80ab28a897c46f46851d2 (diff) | |
download | mpv-fb22bf2317d4704895fca407507972031e932298.tar.bz2 mpv-fb22bf2317d4704895fca407507972031e932298.tar.xz |
ao: use a local option struct
Instead of accessing MPOpts.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c index e836b3ef21..7d52f2425c 100644 --- a/player/command.c +++ b/player/command.c @@ -2008,14 +2008,21 @@ static int mp_property_audio_device(void *ctx, struct m_property *prop, if (action == M_PROPERTY_PRINT) { create_hotplug(mpctx); + char *name = NULL; + if (mp_property_generic_option(mpctx, prop, M_PROPERTY_GET, &name) < 1) + name = NULL; + struct ao_device_list *list = ao_hotplug_get_device_list(cmd->hotplug); for (int n = 0; n < list->num_devices; n++) { struct ao_device_desc *dev = &list->devices[n]; - if (dev->name && strcmp(dev->name, mpctx->opts->audio_device) == 0) { + if (dev->name && name && strcmp(dev->name, name) == 0) { *(char **)arg = talloc_strdup(NULL, dev->desc ? dev->desc : "?"); + talloc_free(name); return M_PROPERTY_OK; } } + + talloc_free(name); } return mp_property_generic_option(mpctx, prop, action, arg); } |