From 4bcd9000baf27241c52931365c91a42c5ae2f83c Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Wed, 24 Apr 2019 09:46:42 +0200 Subject: Gstreamer: Don't reset pipeline to GST_STATE_NULL when EndOfStream In case of EOS the state of the pipeline currently is changed to GST_STATE_NULL, which releases some resources and it might take some time to restart the playback. If the media should be played few times, there could be a gap between EOS and new play which can be heard. Suggesting to set the state to GST_STATE_PAUSED instead. If there is a need to release resources, empty QMediaContent should be set to the media player. Change-Id: Ifa5c886abfbea037fd395b7336a5590001d4a7f7 Fixes: QTBUG-75314 Reviewed-by: Andy Shaw --- src/gsttools/qgstreamerplayersession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gsttools/qgstreamerplayersession.cpp b/src/gsttools/qgstreamerplayersession.cpp index 9858f61c9..1e099fc89 100644 --- a/src/gsttools/qgstreamerplayersession.cpp +++ b/src/gsttools/qgstreamerplayersession.cpp @@ -1886,7 +1886,7 @@ void QGstreamerPlayerSession::endOfMediaReset() m_renderer->stopRenderer(); flushVideoProbes(); - gst_element_set_state(m_pipeline, GST_STATE_NULL); + gst_element_set_state(m_pipeline, GST_STATE_PAUSED); QMediaPlayer::State oldState = m_state; m_pendingState = m_state = QMediaPlayer::StoppedState; -- cgit v1.2.3