[vlmc-devel] VLCSource: Cludgy hack to remove the last use of EventWaiter

Hugo Beauzée-Luyssen git at videolan.org
Thu Mar 24 13:22:27 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 21 19:52:37 2016 +0100| [8570aece549b9951d9d722ed221bf54f5de12d0e] | committer: Hugo Beauzée-Luyssen

VLCSource: Cludgy hack to remove the last use of EventWaiter

> https://code.videolan.org/videolan/vlmc/commit/8570aece549b9951d9d722ed221bf54f5de12d0e
---

 src/Backend/VLC/VLCSource.cpp | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/Backend/VLC/VLCSource.cpp b/src/Backend/VLC/VLCSource.cpp
index 7e20599..4393c2a 100644
--- a/src/Backend/VLC/VLCSource.cpp
+++ b/src/Backend/VLC/VLCSource.cpp
@@ -20,7 +20,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#include "EventWaiter.h"
 #include "VLCBackend.h"
 #include "VLCSource.h"
 #include "VLCVmemRenderer.h"
@@ -99,28 +98,14 @@ VLCSource::isParsed() const
     return m_isParsed;
 }
 
-static bool
-checkTimeChanged( const libvlc_event_t* event )
-{
-    Q_ASSERT( event->type == libvlc_MediaPlayerPositionChanged );
-    return ( event->u.media_player_position_changed.new_position > 0.2f );
-}
-
 bool
 VLCSource::computeSnapshot( VmemRenderer* renderer )
 {
     Q_ASSERT( m_snapshot == NULL );
-    LibVLCpp::MediaPlayer*  mediaPlayer = renderer->mediaPlayer();
     {
-        EventWaiter ew( mediaPlayer, false );
-        ew.add( libvlc_MediaPlayerPositionChanged );
-        ew.setValidationCallback( &checkTimeChanged );
         renderer->setTime( m_length / 3 );
-        if ( ew.wait( 3000 ) != EventWaiter::Success )
-        {
-            delete renderer;
-            return false;
-        }
+        //FIXME: This is bad and you should feel bad.
+        QThread::usleep( 500000 );
     }
     m_snapshot = renderer->waitSnapshot();
     delete renderer;



More information about the Vlmc-devel mailing list