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 <christian.stromme@qt.io>
This commit is contained in:
Yoann Lopes
2016-07-25 14:59:18 +02:00
parent 026aec5079
commit 69cc0fb330

View File

@@ -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);
}
}
}