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

Render preview can be unpaused again, without deadlocking this time...

parent 3a542228
......@@ -115,11 +115,16 @@ unsigned char* MainWorkflow::getOutput()
void MainWorkflow::pause()
{
qDebug() << "pausing MainWorkflow";
for ( unsigned int i = 0; i < m_trackCount; ++i )
{
if ( m_tracks[i].activated() == true )
{
qDebug() << "Pausing track workflow";
m_tracks[i]->pause();
}
}
qDebug() << "MainWorkflow is paused";
}
void MainWorkflow::nextFrame()
......
......@@ -87,7 +87,7 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
cw->getStateLock()->lockForRead();
// qDebug() << "Rendering clip";
qDebug() << "Rendering clip";
if ( cw->getState() == ClipWorkflow::Paused && pauseAfterRender == false )
{
cw->getStateLock()->unlock();
......@@ -95,7 +95,8 @@ unsigned char* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentF
//If we must pause after render, we must NOT wake the renderer thread, or it could render more than one frame
// (since this is for the next/previous frame)
//However, if this is just for a classic unpause, with just don't give a shit :)
cw->unpause( false );
qDebug() << "Unpausing clip";
cw->unpause( true );
cw->getStateLock()->lockForRead();
}
if ( cw->getState() == ClipWorkflow::Rendering )
......@@ -372,6 +373,7 @@ void TrackWorkflow::pauseClipWorkflow( ClipWorkflow* cw )
void TrackWorkflow::pause()
{
qDebug() << "Trying to acquire lock";
QReadLocker lock( m_clipsLock );
QMap<qint64, ClipWorkflow*>::iterator it = m_clips.begin();
......@@ -394,11 +396,9 @@ void TrackWorkflow::pause()
}
if ( cw->getState() != ClipWorkflow::Paused )
{
qDebug() << "Unlocking";
qDebug() << "pausing clip workflow";
cw->getStateLock()->unlock();
qDebug() << "Pausing clip workflow";
pauseClipWorkflow( cw );
qDebug() << "Paused clip workflow";
}
else
{
......
......@@ -82,6 +82,7 @@ void* RenderPreviewWidget::lock( void* datas )
{
RenderPreviewWidget* self = reinterpret_cast<RenderPreviewWidget*>( datas );
qDebug() << self->m_oneFrameOnly << "<<<<<<<<";
if ( self->m_oneFrameOnly < 2 )
{
// qDebug() << "\nQuerying new picture";
......@@ -159,7 +160,7 @@ void RenderPreviewWidget::togglePlayPause( bool forcePause )
{
if ( m_paused == true && forcePause == false )
{
// qDebug() << "Unpausing";
qDebug() << "Unpausing";
m_mediaPlayer->play();
//This will automaticly unpause... no worries
// m_mainWorkflow->pause();
......
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