[vlmc-devel] ClipWorkflow: Be more strict about which state is valid after initializing

Hugo Beauzée-Luyssen git at videolan.org
Sun Jan 26 22:08:43 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Jan 26 23:07:05 2014 +0200| [ebe482357a5628dcc8b4089c084526bb77612ee1] | committer: Hugo Beauzée-Luyssen

ClipWorkflow: Be more strict about which state is valid after initializing

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

 src/Workflow/ClipWorkflow.cpp |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Workflow/ClipWorkflow.cpp b/src/Workflow/ClipWorkflow.cpp
index f96ff1f..f38fec1 100644
--- a/src/Workflow/ClipWorkflow.cpp
+++ b/src/Workflow/ClipWorkflow.cpp
@@ -136,8 +136,7 @@ ClipWorkflow::stopRenderer()
         //Set a specific state to avoid operation (getOutput beeing called actually, as it
         //would freeze the render waiting for a frame) while the stopping process occurs.
         m_state = Stopping;
-        m_initWaitCond->wakeAll();
-        m_renderWaitCond->wakeAll();
+
         m_mediaPlayer->stop();
         m_mediaPlayer->disconnect();
         MemoryPool<LibVLCpp::MediaPlayer>::getInstance()->release( m_mediaPlayer );
@@ -145,6 +144,9 @@ ClipWorkflow::stopRenderer()
         delete m_vlcMedia;
         m_state = Stopped;
         flushComputedBuffers();
+
+        m_initWaitCond->wakeAll();
+        m_renderWaitCond->wakeAll();
     }
 }
 
@@ -170,7 +172,7 @@ ClipWorkflow::waitForCompleteInit()
     {
         m_initWaitCond->wait( m_stateLock );
 
-        if ( m_state == ClipWorkflow::Error )
+        if ( m_state != ClipWorkflow::Rendering )
             return false;
     }
     return true;



More information about the Vlmc-devel mailing list