Commit 90cce4e0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

ALSA: remove variable callback (refs #5273)

parent 78231daf
......@@ -147,18 +147,17 @@ static void DumpDeviceStatus (vlc_object_t *obj, snd_pcm_t *pcm)
static void Probe (vlc_object_t *obj)
{
/* Due to design bug in audio output core, this hack is required: */
if (var_Type (obj, "audio-device"))
return;
/* The variable does not exist - first call. */
vlc_value_t text;
var_Create (obj, "audio-device", VLC_VAR_STRING | VLC_VAR_HASCHOICE);
text.psz_string = _("Audio Device");
var_Change (obj, "audio-device", VLC_VAR_SETTEXT, &text, NULL);
if (var_Type (obj, "audio-device") == 0)
{
/* The variable does not exist - first call. */
vlc_value_t text;
GetDevices (obj, NULL);
var_Create (obj, "audio-device", VLC_VAR_STRING | VLC_VAR_HASCHOICE);
text.psz_string = _("Audio Device");
var_Change (obj, "audio-device", VLC_VAR_SETTEXT, &text, NULL);
GetDevices (obj, NULL);
}
var_AddCallback (obj, "audio-device", aout_ChannelsRestart, NULL);
var_TriggerCallback (obj, "intf-change");
}
......@@ -697,6 +696,7 @@ static void Close (vlc_object_t *obj)
aout_sys_t *sys = aout->sys;
snd_pcm_t *pcm = aout->sys->pcm;
var_DelCallback (obj, "audio-device", aout_ChannelsRestart, NULL);
snd_pcm_drop (pcm);
snd_pcm_close (pcm);
free (sys);
......
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