From 2a7c2e695b7551669f1727d6945f68ff57064e96 Mon Sep 17 00:00:00 2001 From: Michael Goddard Date: Fri, 20 Apr 2012 15:54:39 +1000 Subject: [PATCH] Make sure the audio/video availability information changes atomically. So there's a consistent picture of the stream availability. Change-Id: Id7ea166353c0151fcc11105a1e233e9fe8df9cc6 Reviewed-by: Dmytro Poplavskiy --- .../mediaplayer/qgstreamerplayersession.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index ed395feb..7f48738c 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -1384,12 +1384,16 @@ void QGstreamerPlayerSession::getStreamsInfo() } - if (haveAudio != m_audioAvailable) { - m_audioAvailable = haveAudio; + bool emitAudioChanged = (haveAudio != m_audioAvailable); + bool emitVideoChanged = (haveVideo != m_videoAvailable); + + m_audioAvailable = haveAudio; + m_videoAvailable = haveVideo; + + if (emitAudioChanged) { emit audioAvailableChanged(m_audioAvailable); } - if (haveVideo != m_videoAvailable) { - m_videoAvailable = haveVideo; + if (emitVideoChanged) { emit videoAvailableChanged(m_videoAvailable); }