GStreamer: don't try to seek when it's not supported.
authorYoann Lopes <yoann.lopes@digia.com>
Thu, 20 Mar 2014 18:19:10 +0000 (19:19 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 21 Mar 2014 18:16:03 +0000 (19:16 +0100)
This eliminates warnings on the console.

Change-Id: I6a0509dba4a0f7ec6fad33f8803be746f425a616
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp

index da61201..f5b4be7 100644 (file)
@@ -327,7 +327,7 @@ void QGstreamerPlayerSession::setPlaybackRate(qreal rate)
 #endif
     if (!qFuzzyCompare(m_playbackRate, rate)) {
         m_playbackRate = rate;
-        if (m_playbin) {
+        if (m_playbin && m_seekable) {
             gst_element_seek(m_playbin, rate, GST_FORMAT_TIME,
                              GstSeekFlags(GST_SEEK_FLAG_FLUSH),
                              GST_SEEK_TYPE_NONE,0,
@@ -877,7 +877,7 @@ bool QGstreamerPlayerSession::seek(qint64 ms)
     qDebug() << Q_FUNC_INFO << ms;
 #endif
     //seek locks when the video output sink is changing and pad is blocked
-    if (m_playbin && !m_pendingVideoSink && m_state != QMediaPlayer::StoppedState) {
+    if (m_playbin && !m_pendingVideoSink && m_state != QMediaPlayer::StoppedState && m_seekable) {
         ms = qMax(ms,qint64(0));
         gint64  position = ms * 1000000;
         bool isSeeking = gst_element_seek(m_playbin,