[vlmc-devel] MetaDataWorker: Add a timeout when waiting for data to be ready

Hugo Beauzée-Luyssen git at videolan.org
Sun Sep 23 16:40:54 CEST 2012


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Sep 23 16:33:05 2012 +0300| [60ad44a06d0667d92bd892070d205d230b76095f] | committer: Hugo Beauzée-Luyssen

MetaDataWorker: Add a timeout when waiting for data to be ready

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=60ad44a06d0667d92bd892070d205d230b76095f
---

 src/Metadata/MetaDataWorker.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Metadata/MetaDataWorker.cpp b/src/Metadata/MetaDataWorker.cpp
index 4ef4da3..23932cd 100644
--- a/src/Metadata/MetaDataWorker.cpp
+++ b/src/Metadata/MetaDataWorker.cpp
@@ -74,7 +74,7 @@ MetaDataWorker::run()
     m_mediaPlayer->setMedia( m_media->vlcMedia() );
 
     m_mediaPlayer->play();
-    LibVLCpp::MediaPlayer::EventWaitResult res = m_mediaPlayer->waitForEvent();
+    LibVLCpp::MediaPlayer::EventWaitResult res = m_mediaPlayer->waitForEvent( 3000 );
     if ( res != LibVLCpp::MediaPlayer::Success )
     {
         qWarning() << "Got" << (res == LibVLCpp::MediaPlayer::Timeout ? "timeout" : "failure")
@@ -160,7 +160,7 @@ MetaDataWorker::computeSnapshot()
     // almost often enough for us not to care if we missed one or not. However,
     // we don't want to catch one too early.
     m_mediaPlayer->configureWaitForEvent( libvlc_MediaPlayerTimeChanged, cancel, &checkEvent );
-    LibVLCpp::MediaPlayer::EventWaitResult res = m_mediaPlayer->waitForEvent();
+    LibVLCpp::MediaPlayer::EventWaitResult res = m_mediaPlayer->waitForEvent( 3000 );
 
     if ( res != LibVLCpp::MediaPlayer::Success )
     {



More information about the Vlmc-devel mailing list