Commit 15937877 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Corrected crash when reaching end of a render.

An EndReached ClipWorkflow now returns a black output, to avoid displaying the same frame too long when approaching end of a clip
parent 0f93a967
......@@ -131,8 +131,6 @@ void WorkflowRenderer::stopPreview()
void WorkflowRenderer::startPreview()
{
char buff[128];
m_mediaPlayer->setMedia( m_media );
//Workflow part
......@@ -151,8 +149,6 @@ void WorkflowRenderer::startPreview()
connect( m_mainWorkflow, SIGNAL( positionChanged( float ) ), this, SLOT( __positionChanged( float ) ) );
m_mainWorkflow->startRender();
sprintf( buff, ":fake-duration=%lli", m_mainWorkflow->getLength() / FPS * 1000 );
m_media->addOption( buff );
m_mediaPlayer->play();
m_isRendering = true;
m_paused = false;
......
......@@ -61,6 +61,8 @@ unsigned char* ClipWorkflow::getOutput()
{
QMutexLocker lock( m_renderLock );
if ( isEndReached() == true )
return NULL;
return m_buffer;
}
......@@ -97,11 +99,10 @@ void ClipWorkflow::unlock( ClipWorkflow* cw )
cw->m_renderWaitCond->wake();
cw->emit renderComplete( cw );
// qDebug() << ">>>Entering condwait";
cw->m_waitCond->wait( cw->m_condMutex );
// qDebug() << "<<<Leaving condwait";
cw->m_stateLock->lockForWrite();
cw->m_state = Rendering;
if ( cw->m_state == Sleeping )
cw->m_state = Rendering;
cw->m_stateLock->unlock();
}
else
......@@ -270,7 +271,6 @@ void ClipWorkflow::setState( State state )
{
{
QWriteLocker lock( m_stateLock );
// qDebug() << "Changing from state" << m_state << "to state" << state;
m_state = state;
}
checkSynchronisation( state );
......@@ -278,7 +278,6 @@ void ClipWorkflow::setState( State state )
void ClipWorkflow::queryStateChange( State newState )
{
// qDebug() << "Querying state change to" << newState;
QMutexLocker lock( m_requiredStateLock );
m_requiredState = newState;
}
......
Supports Markdown
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