summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartosz Golaszewski <brgl@bgdev.pl>2017-07-05 12:51:45 +0200
committerBartosz Golaszewski <brgl@bgdev.pl>2017-07-12 09:27:44 +0000
commitacdec68b25aa99f6ae466100f112002b74b695dd (patch)
tree14969fb09d023d066d367aaa462233a5e6922ada
parent1b10f8774cd118ec5a5c9e16d2ab4999a4daa9f6 (diff)
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 <christian.stromme@qt.io>
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp5
1 files changed, 4 insertions, 1 deletions
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();