Commit 49d6e8f5 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Avoid black output, return the last rendered frame.

parent fb0a0cce
......@@ -27,7 +27,8 @@
#include "Clip.h"
VideoClipWorkflow::VideoClipWorkflow( Clip *clip ) :
ClipWorkflow( clip )
ClipWorkflow( clip ),
m_lastRenderedFrame( NULL )
{
for ( unsigned int i = 0; i < VideoClipWorkflow::nbBuffers; ++i )
{
......@@ -92,7 +93,11 @@ VideoClipWorkflow::getOutput( ClipWorkflow::GetMode mode )
QMutexLocker lock2( m_computedBuffersMutex );
if ( preGetOutput() == false )
{
if ( m_lastRenderedFrame != NULL )
return new StackedBuffer( m_lastRenderedFrame, NULL, false );
return NULL;
}
if ( isEndReached() == true )
return NULL;
::StackedBuffer<LightVideoFrame*>* buff;
......@@ -101,6 +106,7 @@ VideoClipWorkflow::getOutput( ClipWorkflow::GetMode mode )
else if ( mode == ClipWorkflow::Get )
buff = new StackedBuffer( m_computedBuffers.head(), NULL, false );
postGetOutput();
m_lastRenderedFrame = buff->get();
return buff;
}
......
......@@ -64,6 +64,7 @@ class VideoClipWorkflow : public ClipWorkflow
private:
QQueue<LightVideoFrame*> m_computedBuffers;
QQueue<LightVideoFrame*> m_availableBuffers;
LightVideoFrame *m_lastRenderedFrame;
static void lock( VideoClipWorkflow* clipWorkflow, void** pp_ret,
int size );
static void unlock( VideoClipWorkflow* clipWorkflow, void* buffer,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment