GStreamer: don't try to seek when it's not supported.

This eliminates warnings on the console.

Change-Id: I6a0509dba4a0f7ec6fad33f8803be746f425a616
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
Yoann Lopes
2014-03-20 19:19:10 +01:00
committed by The Qt Project
parent dcf11bba3c
commit 60ba0afbde

View File

@@ -327,7 +327,7 @@ void QGstreamerPlayerSession::setPlaybackRate(qreal rate)
#endif #endif
if (!qFuzzyCompare(m_playbackRate, rate)) { if (!qFuzzyCompare(m_playbackRate, rate)) {
m_playbackRate = rate; m_playbackRate = rate;
if (m_playbin) { if (m_playbin && m_seekable) {
gst_element_seek(m_playbin, rate, GST_FORMAT_TIME, gst_element_seek(m_playbin, rate, GST_FORMAT_TIME,
GstSeekFlags(GST_SEEK_FLAG_FLUSH), GstSeekFlags(GST_SEEK_FLAG_FLUSH),
GST_SEEK_TYPE_NONE,0, GST_SEEK_TYPE_NONE,0,
@@ -877,7 +877,7 @@ bool QGstreamerPlayerSession::seek(qint64 ms)
qDebug() << Q_FUNC_INFO << ms; qDebug() << Q_FUNC_INFO << ms;
#endif #endif
//seek locks when the video output sink is changing and pad is blocked //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)); ms = qMax(ms,qint64(0));
gint64 position = ms * 1000000; gint64 position = ms * 1000000;
bool isSeeking = gst_element_seek(m_playbin, bool isSeeking = gst_element_seek(m_playbin,