Commit ab5c2836 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

This time, it should work. (No really, I mean it !)

parent 5392c2be
......@@ -93,7 +93,7 @@ void ClipWorkflow::lock( ClipWorkflow* cw, void** pp_ret )
// else
// {
*pp_ret = cw->m_buffer;
qDebug() << "Clip workflow locking <<<<<<<<<<<<<<<<<<<<<<<<<<";
// qDebug() << "Clip workflow locking <<<<<<<<<<<<<<<<<<<<<<<<<<";
// }
}
......
......@@ -127,7 +127,7 @@ void MainWorkflow::pause()
{
QMutexLocker lock( m_renderMutex );
qDebug() << "Pausing.......................";
qDebug() << "MainWorkflow Pausing Started >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n";
m_nbTracksToPause = 0;
for ( unsigned int i = 0; i < m_trackCount; ++i )
{
......@@ -137,7 +137,7 @@ void MainWorkflow::pause()
m_tracks[i]->pause();
}
}
qDebug() << "Pausing completed <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n";
qDebug() << "MainWorkflow Pausing asked completed <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n";
}
void MainWorkflow::nextFrame()
......
......@@ -342,13 +342,13 @@ void TrackWorkflow::pauseClipWorkflow( ClipWorkflow* cw )
cw->getState() == ClipWorkflow::EndReached )
{
qDebug() << "Pausing a sleeping, ready or EndReached ClipWorkflow, state =" << cw->getState();
qDebug() << "getting condwait lock";
cw->getSleepMutex()->lock();
cw->queryStateChange( ClipWorkflow::Pausing );
cw->getStateLock()->unlock();
qDebug() << "Unlocked state mutex";
qDebug() << "Realeasing condwait lock";
cw->getSleepMutex()->unlock();
cw->getStateLock()->unlock();
qDebug() << "Waiting for sleep mutex";
QMutexLocker lock( cw->getSleepMutex() );
qDebug() << "Got sleep mutex";
cw->queryStateChange( ClipWorkflow::Pausing );
cw->wake();
}
else if ( cw->getState() == ClipWorkflow::Rendering )
......@@ -415,6 +415,7 @@ void TrackWorkflow::pause()
//This should never be used.
//TODO: remove this in a few revision (wrote on July 16 2009 )
qDebug() << "Asking to pause in an already paused state";
cw->getStateLock()->unlock();
}
}
qDebug() << "End of loop";
......
......@@ -29,7 +29,8 @@
WorkflowRenderer::WorkflowRenderer( MainWorkflow* mainWorkflow ) :
m_mainWorkflow( mainWorkflow ),
m_framePlayed( false )
m_framePlayed( false ),
m_pauseAsked( false )
{
m_actionsLock = new QReadWriteLock;
m_media = new LibVLCpp::Media( "fake://" );
......@@ -126,6 +127,9 @@ void WorkflowRenderer::checkActions()
{
case Pause:
qDebug() << "Pausing WorkflowRenderer mediaPlayer";
if ( m_pauseAsked == true )
continue ;
m_pauseAsked = true;
m_mediaPlayer->pause();
//This will also pause the MainWorkflow via a signal/slot
break ;
......@@ -186,12 +190,16 @@ void WorkflowRenderer::previousFrame()
void WorkflowRenderer::pauseMainWorkflow()
{
qDebug() << "In pause callback";
if ( m_paused == true )
return ;
m_mainWorkflow->pause();
}
void WorkflowRenderer::mainWorkflowPaused()
{
qDebug() << "MAIN WORKFLOW PAUSED<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";
m_paused = true;
m_pauseAsked = false;
emit paused();
}
......
......@@ -77,6 +77,7 @@ class WorkflowRenderer : public GenericRenderer
bool m_framePlayed;
QStack<Actions> m_actions;
QReadWriteLock* m_actionsLock;
bool m_pauseAsked;
public slots:
void mainWorkflowPaused();
......
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