summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/gstreamer
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-10-01 16:10:22 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-10-01 16:10:22 (GMT)
commit30d9101ecabeb0778c829c3578f1fcf5ec276a8c (patch)
treed6d67506c2bae71bf967845ff503e02dd41372ae /src/3rdparty/phonon/gstreamer
parent6ee282013b82b5f46fa972296b801eab55c614c1 (diff)
parent984fe9ebfc6d9582d21bcf1d09cb0578fd163f54 (diff)
downloadQt-30d9101ecabeb0778c829c3578f1fcf5ec276a8c.zip
Qt-30d9101ecabeb0778c829c3578f1fcf5ec276a8c.tar.gz
Qt-30d9101ecabeb0778c829c3578f1fcf5ec276a8c.tar.bz2
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/3rdparty/phonon/gstreamer')
-rw-r--r--src/3rdparty/phonon/gstreamer/mediaobject.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
index 13f9734..5dcbd42 100644
--- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp
+++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
@@ -369,6 +369,11 @@ bool MediaObject::createPipefromURL(const QUrl &url)
if (!m_datasource)
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);
+
// Link data source into pipeline
gst_bin_add(GST_BIN(m_pipeline), m_datasource);
if (!gst_element_link(m_datasource, m_decodebin)) {
@@ -904,8 +909,21 @@ void MediaObject::setSource(const MediaSource &source)
case MediaSource::Disc: // CD tracks can be specified by setting the url in the following way uri=cdda:4
{
- QUrl cdurl(QLatin1String("cdda://"));
- if (createPipefromURL(cdurl))
+ QUrl url;
+ switch (source.discType()) {
+ case Phonon::Cd:
+ url = QUrl(QLatin1String("cdda://"));
+ break;
+ case Phonon::Dvd:
+ url = QUrl(QLatin1String("dvd://"));
+ break;
+ case Phonon::Vcd:
+ url = QUrl(QLatin1String("vcd://"));
+ break;
+ default:
+ break;
+ }
+ if (!url.isEmpty() && createPipefromURL(url))
m_loading = true;
else
setError(tr("Could not open media source."));