From 69cc0fb330c5ab74afb9d0bd087c64d4004ca9dd Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Mon, 25 Jul 2016 14:59:18 +0200 Subject: [PATCH] GStreamer: emit mediaStatus changes before state changes This makes sure all mediaStatus changes are emitted, even when some action is done on the media player as a result of a state change. Task-number: QTBUG-49578 Change-Id: I60153cd8e1d665797a25549ab81afcfb553ce2cc Reviewed-by: Christian Stromme --- .../mediaplayer/qgstreamerplayercontrol.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp index 4846353a..b4879293 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp @@ -606,19 +606,19 @@ void QGstreamerPlayerControl::popAndNotifyState() QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatusStack.pop(); if (m_stateStack.isEmpty()) { - if (m_currentState != oldState) { -#ifdef DEBUG_PLAYBIN - qDebug() << "State changed:" << m_currentState; -#endif - emit stateChanged(m_currentState); - } - if (m_mediaStatus != oldMediaStatus) { #ifdef DEBUG_PLAYBIN qDebug() << "Media status changed:" << m_mediaStatus; #endif emit mediaStatusChanged(m_mediaStatus); } + + if (m_currentState != oldState) { +#ifdef DEBUG_PLAYBIN + qDebug() << "State changed:" << m_currentState; +#endif + emit stateChanged(m_currentState); + } } }