[vlmc-devel] commit: TracksWorkflow: Apply effects (without crashing) when nothing was rendered. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Aug 29 21:38:12 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Aug 29 21:34:43 2010 +0200| [a69b95105b77fe19c7df8ba81a184e6cddbc7353] | committer: Hugo Beauzée-Luyssen 

TracksWorkflow: Apply effects (without crashing) when nothing was rendered.

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

 src/Workflow/TrackWorkflow.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 1d18810..a3db641 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -361,10 +361,19 @@ TrackWorkflow::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
         else //If there's no mixer, just use the first frame, ignore the rest. It will be cleaned by the responsible ClipWorkflow.
             ret = frames[0];
         //Now handle filters :
-        quint32     *newFrame = EffectsEngine::applyFilters( m_filters, static_cast<const Workflow::Frame*>( ret ),
+        quint32     *newFrame = EffectsEngine::applyFilters( m_filters,
+                                                             ret != NULL ? static_cast<const Workflow::Frame*>( ret ) : MainWorkflow::getInstance()->blackOutput(),
                                                              currentFrame, currentFrame * 1000.0 / m_fps );
         if ( newFrame != NULL )
-            static_cast<Workflow::Frame*>( ret )->setBuffer( newFrame );
+        {
+            if ( ret != NULL )
+                static_cast<Workflow::Frame*>( ret )->setBuffer( newFrame );
+            else //Use the m_mixerBuffer as the frame to return. Ugly but avoid another attribute.
+            {
+                m_mixerBuffer->setBuffer( newFrame );
+                ret = m_mixerBuffer;
+            }
+        }
     }
     m_lastFrame = subFrame;
     return ret;



More information about the Vlmc-devel mailing list