summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qsoundeffect_pulse_p.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/audio/qsoundeffect_pulse_p.cpp')
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index bbaf405b6..075e639a8 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -58,7 +58,7 @@
#include <private/qaudiohelpers_p.h>
#include <private/qmediaresourcepolicy_p.h>
#include <private/qmediaresourceset_p.h>
-
+#include <QAudioDeviceInfo>
#include <unistd.h>
//#define QT_PA_DEBUG
@@ -360,6 +360,12 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
this, &QSoundEffectPrivate::handleAvailabilityChanged);
}
+QSoundEffectPrivate::QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent)
+ : QSoundEffectPrivate(parent)
+{
+ m_sinkName = audioDevice.deviceName();
+}
+
void QSoundEffectPrivate::handleAvailabilityChanged(bool available)
{
m_resourcesAvailable = available;
@@ -1005,8 +1011,9 @@ void QSoundEffectPrivate::createPulseStream()
}
m_pulseStream = stream;
- if (pa_stream_connect_playback(m_pulseStream, nullptr, nullptr,
- PA_STREAM_START_CORKED, nullptr, nullptr) < 0) {
+ if (pa_stream_connect_playback(m_pulseStream,
+ m_sinkName.isEmpty() ? nullptr : m_sinkName.toLatin1().constData(),
+ nullptr, PA_STREAM_START_CORKED, nullptr, nullptr) < 0) {
qWarning("QSoundEffect(pulseaudio): Failed to connect stream, error = %s",
pa_strerror(pa_context_errno(pulseDaemon()->context())));
}