summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp2
-rw-r--r--src/plugins/multimedia/gstreamer/common/qgstreamermediaplayer.cpp13
2 files changed, 4 insertions, 11 deletions
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 2e504bdf8..a5b43dc32 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -591,7 +591,7 @@ void QMediaPlayer::setPlaybackRate(qreal rate)
Setting the media to a null QUrl will cause the player to discard all
information relating to the current media source and to cease all I/O operations related
- to that media.
+ to that media. Setting the media will stop the playback.
\note This function returns immediately after recording the specified source of the media.
It does not wait for the media to finish loading and does not check for errors. Listen for
diff --git a/src/plugins/multimedia/gstreamer/common/qgstreamermediaplayer.cpp b/src/plugins/multimedia/gstreamer/common/qgstreamermediaplayer.cpp
index 19fffc082..e318c14eb 100644
--- a/src/plugins/multimedia/gstreamer/common/qgstreamermediaplayer.cpp
+++ b/src/plugins/multimedia/gstreamer/common/qgstreamermediaplayer.cpp
@@ -680,7 +680,7 @@ void QGstreamerMediaPlayer::setMedia(const QUrl &content, QIODevice *stream)
decoder = QGstElement();
removeAllOutputs();
seekableChanged(false);
- playerPipeline.setInStoppedState(true);
+ Q_ASSERT(playerPipeline.inStoppedState());
if (m_duration != 0) {
m_duration = 0;
@@ -756,15 +756,8 @@ void QGstreamerMediaPlayer::setMedia(const QUrl &content, QIODevice *stream)
mediaStatusChanged(QMediaPlayer::LoadingMedia);
- if (state() == QMediaPlayer::PlayingState) {
- int ret = playerPipeline.setState(GST_STATE_PLAYING);
- if (ret == GST_STATE_CHANGE_FAILURE)
- qCWarning(qLcMediaPlayer) << "Unable to set the pipeline to the playing state.";
- } else {
- int ret = playerPipeline.setState(GST_STATE_PAUSED);
- if (!ret)
- qCWarning(qLcMediaPlayer) << "Unable to set the pipeline to the paused state.";
- }
+ if (!playerPipeline.setState(GST_STATE_PAUSED))
+ qCWarning(qLcMediaPlayer) << "Unable to set the pipeline to the paused state.";
playerPipeline.setPosition(0);
positionChanged(0);