summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2009-11-11 03:50:21 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2009-11-11 03:50:21 (GMT)
commit1dd3605bab059e800b70eb5c3c2fb4f175372670 (patch)
tree840ec04f90c30d5a21b25066fdca3b2b76e62a6f
parent31037231e37a6f6534ca9075159181affc46bd4e (diff)
downloadQt-1dd3605bab059e800b70eb5c3c2fb4f175372670.zip
Qt-1dd3605bab059e800b70eb5c3c2fb4f175372670.tar.gz
Qt-1dd3605bab059e800b70eb5c3c2fb4f175372670.tar.bz2
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
-rw-r--r--src/3rdparty/phonon/gstreamer/mediaobject.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
index 5713263..f312b6f 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);