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

Solving a little bug that maked the position slider move, even in paused mode.

parent 5f1eb6dd
......@@ -294,11 +294,8 @@ void ClipWorkflow::reinitialize()
void ClipWorkflow::pause()
{
qDebug() << "Pausing clip workflow";
setState( Pausing );
qDebug() << "State set to Pausing";
m_mediaPlayer->pause();
qDebug() << "Pause asked";
QMutexLocker lock( m_requiredStateLock );
m_requiredState = ClipWorkflow::None;
......@@ -340,7 +337,6 @@ LibVLCpp::MediaPlayer* ClipWorkflow::getMediaPlayer()
void ClipWorkflow::pausedMediaPlayer()
{
setState( Paused );
qDebug() << "Clip workflow is paused";
emit paused();
}
......
......@@ -130,7 +130,8 @@ void MainWorkflow::getOutput()
break ;
}
}
nextFrame();
if ( m_paused == false )
nextFrame();
}
}
......@@ -277,6 +278,7 @@ void MainWorkflow::trackPaused()
m_nbTracksToPause.fetchAndAddAcquire( -1 );
if ( m_nbTracksToPause <= 0 )
{
m_paused = true;
emit mainWorkflowPaused();
}
}
......@@ -286,6 +288,7 @@ void MainWorkflow::trackUnpaused()
m_nbTracksToUnpause.fetchAndAddAcquire( -1 );
if ( m_nbTracksToUnpause <= 0 )
{
m_paused = false;
emit mainWorkflowUnpaused();
}
}
......@@ -318,9 +321,7 @@ unsigned char* MainWorkflow::getSynchroneOutput()
{
m_synchroneRenderWaitConditionMutex->lock();
getOutput();
qDebug() << "Waiting for synchrone output";
m_synchroneRenderWaitCondition->wait( m_synchroneRenderWaitConditionMutex );
qDebug() << "And got it";
m_synchroneRenderWaitConditionMutex->unlock();
if ( m_synchroneRenderingBuffer == NULL )
return MainWorkflow::blackOutput;
......
......@@ -112,6 +112,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
unsigned char* m_synchroneRenderingBuffer;
QWaitCondition* m_synchroneRenderWaitCondition;
QMutex* m_synchroneRenderWaitConditionMutex;
bool m_paused;
public slots:
void clipMoved( QUuid, int, int, qint64 );
......
......@@ -156,7 +156,6 @@ void TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
}
else
{
qDebug() << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Unexpected state while rendering";
cw->getStateLock()->unlock();
}
}
......@@ -167,7 +166,6 @@ void TrackWorkflow::preloadClip( ClipWorkflow* cw )
if ( cw->getState() == ClipWorkflow::Stopped )
{
qDebug() << "Preloading clip";
cw->getStateLock()->unlock();
cw->initialize();
return ;
......@@ -328,7 +326,6 @@ void TrackWorkflow::pause()
{
cw->getStateLock()->unlock();
m_nbClipToPause.fetchAndAddAcquire( 1 );
qDebug() << "Track is asking clip to pause. state lock unlocked";
cw->pause();
}
else
......
......@@ -87,11 +87,6 @@ void* WorkflowRenderer::lock( void* datas )
{
WorkflowRenderer* self = reinterpret_cast<WorkflowRenderer*>( datas );
//If renderer is stopping, don't ask for another frame:
// if ( self->m_isRendering == false )
// return self->m_lastFrame;
qDebug() << "WorkflowRenderer::lock()";
void* ret = self->m_mainWorkflow->getSynchroneOutput();
self->m_lastFrame = static_cast<unsigned char*>( ret );
return ret;
......@@ -190,11 +185,9 @@ void WorkflowRenderer::mainWorkflowPaused()
{
m_paused = true;
m_pauseAsked = false;
qDebug() << "mainworkflow is paused 1";
{
QMutexLocker lock( m_condMutex );
}
qDebug() << "mainworkflow is paused 2";
m_waitCond->wakeAll();
emit paused();
}
......@@ -280,7 +273,6 @@ void WorkflowRenderer::__videoPlaying()
unpauseMainWorkflow();
else
{
qDebug() << "Emmiting signal playing without mainworkflow";
m_paused = false;
m_pausedMediaPlayer = false;
emit playing();
......
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