From acdec68b25aa99f6ae466100f112002b74b695dd Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 5 Jul 2017 12:51:45 +0200 Subject: PulseAudio: allow to specify the pulseaudio server string Currently we call pa_context_connect() with an empty server string. This works fine if we only want to connect to the default pulseaudio server, but we may want to specify the server string on systems with custom configuration. Add a new environment variable: QT_PULSE_SERVER_STRING which allows to specify the server string passed to pa_context_connect(). Change-Id: I6805ff5e941d13bc91d306e5df3ab5d04a8a90af Reviewed-by: Christian Stromme --- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/multimedia/audio') diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index 1e9204598..76cb657e3 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -190,7 +190,10 @@ private Q_SLOTS: pa_context_set_state_callback(m_context, context_state_callback, this); - if (pa_context_connect(m_context, 0, (pa_context_flags_t)0, 0) < 0) { + const QByteArray srvStrEnv = qgetenv("QT_PULSE_SERVER_STRING"); + const char *srvStr = srvStrEnv.isNull() ? 0 : srvStrEnv.constData(); + + if (pa_context_connect(m_context, srvStr, (pa_context_flags_t)0, 0) < 0) { qWarning("PulseAudioService: pa_context_connect() failed"); pa_context_unref(m_context); unlock(); -- cgit v1.2.1