Commit 547e8b09 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: remove choices list on the device variable

This does not support hot plug and unplug of devices.

Also, it prevented selecting a device not in the choices list due to
checks in the variables subsystem. (At least with ALSA, not all valid
devices are included in the suggestions.)
parent 63992423
......@@ -113,8 +113,6 @@ audio_output_t *aout_New (vlc_object_t *parent)
var_Create (aout, "mute", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
var_AddCallback (aout, "mute", var_Copy, parent);
var_Create (aout, "device", VLC_VAR_STRING | VLC_VAR_HASCHOICE);
text.psz_string = _("Audio Device");
var_Change (aout, "device", VLC_VAR_SETTEXT, &text, NULL);
aout->event.volume_report = aout_VolumeNotify;
aout->event.mute_report = aout_MuteNotify;
......@@ -138,27 +136,6 @@ audio_output_t *aout_New (vlc_object_t *parent)
return NULL;
}
if (aout->device_enum != NULL)
{ /* Backward compatibility with UIs using GETCHOICES/GETLIST */
/* Note: this does NOT support hot-plugged devices. */
char **ids, **names;
int n = aout->device_enum (aout, &ids, &names);
for (int i = 0; i < n; i++)
{
val.psz_string = ids[i];
text.psz_string = names[i];
var_Change (aout, "device", VLC_VAR_ADDCHOICE, &val, &text);
free (names[i]);
free (ids[i]);
}
if (n >= 0)
{
free (names);
free (ids);
}
}
/*
* Persistent audio output variables
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment