diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-30 13:49:21 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-30 13:49:21 (GMT) |
commit | 00f7426f3906361fb5addb36e428648eee5e2983 (patch) | |
tree | c299b0f6f323ea2f37161cfdf5b2fb33bbe35673 /src/3rdparty/phonon/gstreamer/audiooutput.cpp | |
parent | 429b747d492ef038c2ed58a9a72060d951721252 (diff) | |
parent | ae305abfdb795b472b2b9d200bf3b11af00d7d1f (diff) | |
download | Qt-00f7426f3906361fb5addb36e428648eee5e2983.zip Qt-00f7426f3906361fb5addb36e428648eee5e2983.tar.gz Qt-00f7426f3906361fb5addb36e428648eee5e2983.tar.bz2 |
Merge remote branch 'origin/4.7' into 4.7
Conflicts:
src/3rdparty/phonon/ds9/iodevicereader.cpp
Diffstat (limited to 'src/3rdparty/phonon/gstreamer/audiooutput.cpp')
-rw-r--r-- | src/3rdparty/phonon/gstreamer/audiooutput.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/3rdparty/phonon/gstreamer/audiooutput.cpp b/src/3rdparty/phonon/gstreamer/audiooutput.cpp index 641ff6b..f3137b2 100644 --- a/src/3rdparty/phonon/gstreamer/audiooutput.cpp +++ b/src/3rdparty/phonon/gstreamer/audiooutput.cpp @@ -125,6 +125,7 @@ void AudioOutput::setVolume(qreal newVolume) bool AudioOutput::setOutputDevice(int newDevice) { m_backend->logMessage(Q_FUNC_INFO + QString::number(newDevice), Backend::Info, this); + if (newDevice == m_device) return true; @@ -135,20 +136,11 @@ bool AudioOutput::setOutputDevice(int newDevice) } bool success = false; - const QList<AudioDevice> deviceList = m_backend->deviceManager()->audioOutputDevices(); - 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) { + if (m_audioSink && newDevice >= 0) { // Save previous state GstState oldState = GST_STATE(m_audioSink); const QByteArray oldDeviceValue = GstHelper::property(m_audioSink, "device"); - const QByteArray deviceId = deviceList.at(deviceIdx).gstId; + const QByteArray deviceId = m_backend->deviceManager()->gstId(newDevice); m_device = newDevice; // We test if the device can be opened by checking if it can go from NULL to READY state @@ -170,7 +162,7 @@ bool AudioOutput::setOutputDevice(int newDevice) deviceId, Backend::Info, this); } - // Note the stopped state should not really be neccessary, but seems to be required to + // Note the stopped state should not really be necessary, but seems to be required to // properly reset after changing the audio state if (root()) { QMetaObject::invokeMethod(root(), "setState", Qt::QueuedConnection, Q_ARG(State, StoppedState)); |