diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2009-11-11 13:50:21 +1000 |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2009-11-12 15:39:37 +1000 |
commit | 5edc0f87fbad652a8399a43d0520301ed37baaef (patch) | |
tree | 410cf3748d1530962230671c6a9a3ceac0476014 /src/3rdparty/phonon/gstreamer | |
parent | 132ad441481e676cb4e502797c0a4fc833152175 (diff) | |
download | qt4-tools-5edc0f87fbad652a8399a43d0520301ed37baaef.tar.gz |
reduce the speed of CD drive to 2X while playing CD audio to limit CD
drive noise
Integrated KDE changes 1029492, 1030905 by nlecureuil
Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'src/3rdparty/phonon/gstreamer')
-rw-r--r-- | src/3rdparty/phonon/gstreamer/mediaobject.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 5713263be7..f312b6f8f1 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -374,9 +374,21 @@ bool MediaObject::createPipefromURL(const QUrl &url) return false; // Set the device for MediaSource::Disc - QByteArray mediaDevice = QFile::encodeName(m_source.deviceName()); - if (!mediaDevice.isEmpty()) - g_object_set (m_datasource, "device", mediaDevice.constData(), (const char*)NULL); + if (m_source.type() == MediaSource::Disc) { + + if (g_object_class_find_property (G_OBJECT_GET_CLASS (m_datasource), "device")) { + QByteArray mediaDevice = QFile::encodeName(m_source.deviceName()); + if (!mediaDevice.isEmpty()) + g_object_set (G_OBJECT (m_datasource), "device", mediaDevice.constData(), (const char*)NULL); + } + + // Also Set optical disc speed to 2X for Audio CD + if (m_source.discType() == Phonon::Cd + && (g_object_class_find_property (G_OBJECT_GET_CLASS (m_datasource), "read-speed"))) { + g_object_set (G_OBJECT (m_datasource), "read-speed", 2, (const char*)NULL); + m_backend->logMessage(QString("new device speed : 2X"), Backend::Info, this); + } + } // Link data source into pipeline gst_bin_add(GST_BIN(m_pipeline), m_datasource); |