[vlc-commits] PulseAudio: yet another hack around the variable subsystem
Rémi Denis-Courmont
git at videolan.org
Tue Oct 18 22:41:39 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Oct 18 23:40:50 2011 +0300| [d9ec490b4275bc71c527cda0481d573bf05bdfd8] | committer: Rémi Denis-Courmont
PulseAudio: yet another hack around the variable subsystem
I will remove CheckValue() in VLC 1.3 because it really hurts more than
it helps.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d9ec490b4275bc71c527cda0481d573bf05bdfd8
---
modules/audio_output/pulse.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index ecc563c..6c3348f 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -150,8 +150,14 @@ static void sink_list_cb(pa_context *c, const pa_sink_info *i, int eol,
i->description);
val.i_int = i->index;
text.psz_string = (char *)i->description;
+ /* FIXME: There is no way to replace a choice explicitly. */
var_Change(aout, "audio-device", VLC_VAR_DELCHOICE, &val, NULL);
var_Change(aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text);
+ /* FIXME: var_Change() can change the variable value if we remove the
+ * current value from the choice list, or if we add a choice while there
+ * was none. So force the correct value back. */
+ val.i_int = pa_stream_get_device_index(aout->sys->stream);
+ var_Change(aout, "audio-device", VLC_VAR_SETVALUE, &val, NULL);
}
static void sink_info_cb(pa_context *c, const pa_sink_info *i, int eol,
More information about the vlc-commits
mailing list