Commit 02cb2840 authored by Vincent Carrubba's avatar Vincent Carrubba

We finally discovered where was this fu****g memory corruption bug, thx to...

We finally discovered where was this fu****g memory corruption bug, thx to Chouquette, I want also thanks my mother, my father and "Bernardmy pony
parent eff9451d
......@@ -58,6 +58,8 @@ WorkflowRenderer::WorkflowRenderer() :
m_condMutex = new QMutex;
m_waitCond = new QWaitCondition;
m_renderFrame = new unsigned char[VIDEOHEIGHT * VIDEOWIDTH * Pixel::NbComposantes];
//Workflow part
connect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ),
Timeline::getInstance()->tracksView()->tracksCursor(), SLOT( setCursorPos( qint64 ) ), Qt::QueuedConnection );
......@@ -93,10 +95,9 @@ void* WorkflowRenderer::lock( void* datas )
if ( self->m_stopping == false )
{
const LightVideoFrame* ret = self->m_mainWorkflow->getSynchroneOutput();
self->m_lastFrame = ret;
memcpy( self->m_renderFrame, (*ret)->frame.octets, (*ret)->nboctets );
}
//A kitten just died here too :'(
return (*(self->m_lastFrame))->frame.octets;
return (self->m_renderFrame);
}
void WorkflowRenderer::unlock( void* datas )
......@@ -151,7 +152,6 @@ void WorkflowRenderer::startPreview()
m_isRendering = true;
m_paused = false;
m_stopping = false;
m_lastFrame = NULL;
}
void WorkflowRenderer::setPosition( float newPos )
......
......@@ -72,7 +72,7 @@ class WorkflowRenderer : public GenericRenderer
bool m_stopping;
private:
const LightVideoFrame* m_lastFrame;
unsigned char* m_renderFrame;
QStack<Actions> m_actions;
QReadWriteLock* m_actionsLock;
bool m_pauseAsked;
......
......@@ -36,7 +36,7 @@ ClipWorkflow::ClipWorkflow( Clip::Clip* clip ) :
m_initFlag( false ),
m_fullSpeedRender( false )
{
m_frame = new LightVideoFrame( VIDEOHEIGHT * VIDEOWIDTH * 4 );
m_frame = new LightVideoFrame( VIDEOHEIGHT * VIDEOWIDTH * Pixel::NbComposantes );
// m_backBuffer = new unsigned char[VIDEOHEIGHT * VIDEOWIDTH * 4];
m_stateLock = new QReadWriteLock;
m_requiredStateLock = new QMutex;
......
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