[vlmc-devel] VideoClipWorkflow: Don't wait forever when waiting for a frame.

Hugo Beauzée-Luyssen git at videolan.org
Sun Feb 16 23:12:20 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Feb 16 23:50:32 2014 +0200| [1dfaf298ea090d48c1187432aa172996101fd48b] | committer: Hugo Beauzée-Luyssen

VideoClipWorkflow: Don't wait forever when waiting for a frame.

Instead put the clip workflow in error state

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

 src/Workflow/ClipWorkflow.h        |    2 ++
 src/Workflow/VideoClipWorkflow.cpp |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index 3608e13..ac98dc2 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -271,6 +271,8 @@ class   ClipWorkflow : public EffectUser
         void                    mediaPlayerPaused();
         void                    mediaPlayerUnpaused();
         void                    resyncClipWorkflow();
+
+    protected slots:
         void                    errorEncountered();
 
     signals:
diff --git a/src/Workflow/VideoClipWorkflow.cpp b/src/Workflow/VideoClipWorkflow.cpp
index 46279ed..c69cdab 100644
--- a/src/Workflow/VideoClipWorkflow.cpp
+++ b/src/Workflow/VideoClipWorkflow.cpp
@@ -27,6 +27,7 @@
 #include "SettingsManager.h"
 #include "VideoClipWorkflow.h"
 #include "VLCMedia.h"
+#include "VlmcDebug.h"
 #include "Workflow/Types.h"
 
 #include <QMutexLocker>
@@ -131,7 +132,12 @@ VideoClipWorkflow::getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame )
         return NULL;
     if ( getNbComputedBuffers() == 0 )
     {
-        m_renderWaitCond->wait( m_renderLock );
+        if ( m_renderWaitCond->wait( m_renderLock, 50 ) == false )
+        {
+            vlmcWarning() << "Clip workflow" << m_clipHelper->uuid() << "Timed out while waiting for a frame";
+            errorEncountered();
+            return NULL;
+        }
         if ( shouldRender() == false )
             return NULL;
     }



More information about the Vlmc-devel mailing list