diff options
Diffstat (limited to 'src/3rdparty/phonon/gstreamer/audiooutput.cpp')
-rw-r--r-- | src/3rdparty/phonon/gstreamer/audiooutput.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/gstreamer/audiooutput.cpp b/src/3rdparty/phonon/gstreamer/audiooutput.cpp index 138a7e4..641ff6b 100644 --- a/src/3rdparty/phonon/gstreamer/audiooutput.cpp +++ b/src/3rdparty/phonon/gstreamer/audiooutput.cpp @@ -42,7 +42,6 @@ AudioOutput::AudioOutput(Backend *backend, QObject *parent) static int count = 0; m_name = "AudioOutput" + QString::number(count++); if (m_backend->isValid()) { - g_set_application_name(qApp->applicationName().toUtf8()); m_audioBin = gst_bin_new (NULL); gst_object_ref (GST_OBJECT (m_audioBin)); gst_object_sink (GST_OBJECT (m_audioBin)); @@ -137,11 +136,19 @@ bool AudioOutput::setOutputDevice(int newDevice) bool success = false; const QList<AudioDevice> deviceList = m_backend->deviceManager()->audioOutputDevices(); - if (m_audioSink && newDevice >= 0 && newDevice < deviceList.size()) { + int deviceIdx = -1; + for (int i=0; i<deviceList.size(); i++) { + if (deviceList.at(i).id == newDevice) { + deviceIdx = i; + break; + } + } + + if (m_audioSink && deviceIdx >= 0) { // Save previous state GstState oldState = GST_STATE(m_audioSink); const QByteArray oldDeviceValue = GstHelper::property(m_audioSink, "device"); - const QByteArray deviceId = deviceList.at(newDevice).gstId; + const QByteArray deviceId = deviceList.at(deviceIdx).gstId; m_device = newDevice; // We test if the device can be opened by checking if it can go from NULL to READY state |