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:
@@ -606,19 +606,19 @@ void QGstreamerPlayerControl::popAndNotifyState()
|
|||||||
QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatusStack.pop();
|
QMediaPlayer::MediaStatus oldMediaStatus = m_mediaStatusStack.pop();
|
||||||
|
|
||||||
if (m_stateStack.isEmpty()) {
|
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) {
|
if (m_mediaStatus != oldMediaStatus) {
|
||||||
#ifdef DEBUG_PLAYBIN
|
#ifdef DEBUG_PLAYBIN
|
||||||
qDebug() << "Media status changed:" << m_mediaStatus;
|
qDebug() << "Media status changed:" << m_mediaStatus;
|
||||||
#endif
|
#endif
|
||||||
emit mediaStatusChanged(m_mediaStatus);
|
emit mediaStatusChanged(m_mediaStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_currentState != oldState) {
|
||||||
|
#ifdef DEBUG_PLAYBIN
|
||||||
|
qDebug() << "State changed:" << m_currentState;
|
||||||
|
#endif
|
||||||
|
emit stateChanged(m_currentState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user