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