summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/phonon/gstreamer/mediaobject.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
index 74fc1b4..13f9734 100644
--- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp
+++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp
@@ -965,11 +965,15 @@ void MediaObject::getStreamInfo()
gint64 titleCount;
GstFormat format = gst_format_get_by_nick("track");
if (gst_element_query_duration (m_pipeline, &format, &titleCount)) {
- int oldAvailableTitles = m_availableTitles;
- m_availableTitles = (int)titleCount;
- if (m_availableTitles != oldAvailableTitles) {
- emit availableTitlesChanged(m_availableTitles);
- m_backend->logMessage(QString("Available titles changed: %0").arg(m_availableTitles), Backend::Info, this);
+ //check if returned format is still "track",
+ //gstreamer sometimes returns the total time, if tracks information is not available.
+ if (qstrcmp(gst_format_get_name(format), "track") == 0) {
+ int oldAvailableTitles = m_availableTitles;
+ m_availableTitles = (int)titleCount;
+ if (m_availableTitles != oldAvailableTitles) {
+ emit availableTitlesChanged(m_availableTitles);
+ m_backend->logMessage(QString("Available titles changed: %0").arg(m_availableTitles), Backend::Info, this);
+ }
}
}