[vlmc-devel] commit: MainWorkflow: Reducing current frame locking scope while computing a frame. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Sep 14 22:27:05 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Sep 14 18:06:06 2010 +0200| [0a41a5598cb7880ae1822a6dc9763d74f2884837] | committer: Hugo Beauzée-Luyssen 

MainWorkflow: Reducing current frame locking scope while computing a frame.

This prevents a deadlock when the render is in trouble (ie the
videoclipworkflow takes too long to return from getOutput)

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

 src/Workflow/MainWorkflow.cpp |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index 9df6b6b..602a68f 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -114,10 +114,17 @@ MainWorkflow::getOutput( Workflow::TrackType trackType, bool paused )
 
     if ( m_renderStarted == true )
     {
-        QReadLocker         lock2( m_currentFrameLock );
+        qint64              currentFrame;
+        qint64              subFrame;
 
-        Workflow::OutputBuffer  *ret = m_tracks[trackType]->getOutput( m_currentFrame[Workflow::VideoTrack],
-                                                                        m_currentFrame[trackType], paused );
+        {
+            QReadLocker         lock2( m_currentFrameLock );
+            currentFrame = m_currentFrame[Workflow::VideoTrack];
+            subFrame = m_currentFrame[trackType];
+        }
+
+        Workflow::OutputBuffer  *ret = m_tracks[trackType]->getOutput( currentFrame,
+                                                                       subFrame, paused );
         if ( trackType == Workflow::VideoTrack )
         {
             if ( ret == NULL )



More information about the Vlmc-devel mailing list