From f34de634501f0fd95ac6ea26b3ed643183222165 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Apr 2017 17:44:26 +0200 Subject: ao_openal: kill off device listing Probably helps with #4311. It surely is not the correct fix, of course. But ao_openal has no business of causing trouble anyway. --- audio/out/ao_openal.c | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c index a1fd95ab18..ea1567dfaa 100644 --- a/audio/out/ao_openal.c +++ b/audio/out/ao_openal.c @@ -68,7 +68,6 @@ static int unqueue_buf[MAX_CHANS]; static struct ao *ao_data; struct priv { - char *cfg_device; ALenum al_format; int chunk_size; }; @@ -96,36 +95,6 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) return CONTROL_UNKNOWN; } -static int validate_device_opt(struct mp_log *log, const m_option_t *opt, - struct bstr name, struct bstr param) -{ - if (bstr_equals0(param, "help")) { - if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_TRUE) { - mp_fatal(log, "Device listing not supported.\n"); - return M_OPT_EXIT; - } - const char *list = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - mp_info(log, "OpenAL devices:\n"); - while (list && *list) { - mp_info(log, " '%s'\n", list); - list = list + strlen(list) + 1; - } - return M_OPT_EXIT; - } - return 0; -} - -static void list_devs(struct ao *ao, struct ao_device_list *list) -{ - if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_TRUE) - return; - const char *devs = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); - while (devs && *devs) { - ao_device_list_add(list, ao, &(struct ao_device_desc){devs, devs}); - devs = devs + strlen(devs) + 1; - } -} - struct speaker { int id; float pos[3]; @@ -205,9 +174,7 @@ static int init(struct ao *ao) goto err_out; } } - char *dev_name = p->cfg_device; - if (!dev_name || !dev_name[0]) - dev_name = ao->device; + char *dev_name = ao->device; dev = alcOpenDevice(dev_name && dev_name[0] ? dev_name : NULL); if (!dev) { MP_FATAL(ao, "could not open device\n"); @@ -367,12 +334,5 @@ const struct ao_driver audio_out_openal = { .resume = audio_resume, .reset = reset, .drain = drain, - .list_devs = list_devs, .priv_size = sizeof(struct priv), - .options = (const struct m_option[]) { - OPT_STRING_VALIDATE("device", cfg_device, 0, validate_device_opt, - DEVICE_OPT_DEPRECATION), - {0} - }, - .options_prefix = "ao-openal", }; -- cgit v1.2.3