[vlmc-devel] commit: WorkflowRenderer: Fix crash when restarting playback after adding a new effect. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sat Jul 31 17:36:01 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Jul 30 20:53:44 2010 +0200| [186d8edcfcb0a641025c7ead8e332720aa40cee4] | committer: Hugo Beauzée-Luyssen 

WorkflowRenderer: Fix crash when restarting playback after adding a new effect.

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

 src/Renderer/WorkflowRenderer.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 127d596..0e0cb9f 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -120,9 +120,6 @@ WorkflowRenderer::setupRenderer( quint32 width, quint32 height, double fps )
     sprintf( buffer, ":imem-data=%"PRId64, (intptr_t)m_esHandler );
     m_media->addOption( buffer );
     m_media->addOption( ":text-renderer dummy" );
-
-    QReadLocker     lock( m_effectsLock );
-    EffectsEngine::initEffects( m_effects, width, height );
 }
 
 int
@@ -239,6 +236,9 @@ void        WorkflowRenderer::startPreview()
         m_outputFps = outputFps();
         setupRenderer( m_width, m_height, m_outputFps );
     }
+    QReadLocker     lock( m_effectsLock );
+    EffectsEngine::initEffects( m_effects, m_width, m_height );
+
     //Deactivating vlc's keyboard inputs.
     m_mediaPlayer->setKeyInput( false );
     m_mediaPlayer->setMedia( m_media );
@@ -394,7 +394,7 @@ void
 WorkflowRenderer::appendEffect( Effect *effect, qint64 start, qint64 end )
 {
     EffectInstance  *effectInstance = effect->createInstance();
-    if ( m_isRendering == true )
+    if ( isRendering() == true )
         effectInstance->init( m_width, m_height );
     QWriteLocker    lock( m_effectsLock );
     m_effects.push_back( new EffectsEngine::EffectHelper( effectInstance, start, end ) );



More information about the Vlmc-devel mailing list