[vlmc-devel] VLCMediaPlayer: Fix error events processing.
Hugo Beauzée-Luyssen
git at videolan.org
Sun Sep 23 16:31:36 CEST 2012
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Sep 23 16:24:56 2012 +0300| [79b5886d1e2c0d4a8f6d16a1ba9516f272222784] | committer: Hugo Beauzée-Luyssen
VLCMediaPlayer: Fix error events processing.
Also this will avoid to flood the event callback for totally unrelated
events... It could also have caused a crash if the callback expected a
string value for instance.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=79b5886d1e2c0d4a8f6d16a1ba9516f272222784
---
src/LibVLCpp/VLCMediaPlayer.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/LibVLCpp/VLCMediaPlayer.cpp b/src/LibVLCpp/VLCMediaPlayer.cpp
index 2ebb07d..80a3889 100644
--- a/src/LibVLCpp/VLCMediaPlayer.cpp
+++ b/src/LibVLCpp/VLCMediaPlayer.cpp
@@ -97,13 +97,13 @@ MediaPlayer::checkForWaitedEvents(const libvlc_event_t *event)
{
QMutexLocker lock( &m_mutex );
- // Use the user provided callback to check if this event suits him.
- // This is intented to filter out some events, such as multiple length changed
- // with a value of 0
- if ( m_eventsCallback != NULL && m_eventsCallback( this, event ) == false )
- return ;
if ( m_eventsExpected.contains( event->type ) == true )
{
+ // Use the user provided callback to check if this event suits him.
+ // This is intented to filter out some events, such as multiple length changed
+ // with a value of 0
+ if ( m_eventsCallback != NULL && m_eventsCallback( this, event ) == false )
+ return ;
m_eventReceived = event->type;
m_waitCond.wakeAll();
}
More information about the Vlmc-devel
mailing list