diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-10-01 16:10:22 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-10-01 16:10:22 (GMT) |
commit | 30d9101ecabeb0778c829c3578f1fcf5ec276a8c (patch) | |
tree | d6d67506c2bae71bf967845ff503e02dd41372ae /src/3rdparty/phonon | |
parent | 6ee282013b82b5f46fa972296b801eab55c614c1 (diff) | |
parent | 984fe9ebfc6d9582d21bcf1d09cb0578fd163f54 (diff) | |
download | Qt-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')
-rw-r--r-- | src/3rdparty/phonon/gstreamer/mediaobject.cpp | 22 |
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.")); |