[vlmc-devel] ClipWorkflow: Trigger pause/unpause unconditionally

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


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Mar 15 23:26:22 2016 +0100| [67e7f156d035a79e91633eccb4e9a858aaeba04b] | committer: Hugo Beauzée-Luyssen

ClipWorkflow: Trigger pause/unpause unconditionally

libvlc already keeps a state internally, we don't need to do it (badly)
ourselves

> https://code.videolan.org/videolan/vlmc/commit/67e7f156d035a79e91633eccb4e9a858aaeba04b
---

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

diff --git a/src/Workflow/ClipWorkflow.cpp b/src/Workflow/ClipWorkflow.cpp
index 4c9afc8..5a125bc 100644
--- a/src/Workflow/ClipWorkflow.cpp
+++ b/src/Workflow/ClipWorkflow.cpp
@@ -140,12 +140,7 @@ ClipWorkflow::setTime( qint64 time )
     vlmcDebug() << "Setting ClipWorkflow" << m_clipHelper->uuid() << "time:" << time;
     m_renderer->setTime( time );
     resyncClipWorkflow();
-    QWriteLocker    lock( m_stateLock );
-    if ( m_state == ClipWorkflow::Paused )
-    {
-        m_renderer->playPause();
-        m_state = ClipWorkflow::UnpauseRequired;
-    }
+    m_renderer->setPause( false );
 }
 
 bool
@@ -168,15 +163,7 @@ ClipWorkflow::postGetOutput()
 {
     //If we're running out of computed buffers, refill our stack.
     if ( getNbComputedBuffers() < getMaxComputedBuffers() / 3 )
-    {
-        QWriteLocker        lock( m_stateLock );
-        if ( m_state == ClipWorkflow::Paused )
-        {
-            m_state = ClipWorkflow::UnpauseRequired;
-            //This will act like an "unpause";
-            m_renderer->playPause();
-        }
-    }
+        m_renderer->setPause( false );
 }
 
 void
@@ -186,9 +173,7 @@ ClipWorkflow::commonUnlock()
     //no one is available : we would spawn a new buffer, thus modifying the number of available buffers
     if ( getNbComputedBuffers() >= getMaxComputedBuffers() )
     {
-        QWriteLocker lock( m_stateLock );
-        m_state = ClipWorkflow::PauseRequired;
-        m_renderer->playPause();
+        m_renderer->setPause( true );
     }
 }
 



More information about the Vlmc-devel mailing list