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

Fixing a bug introduced in last commit.

parent 451be079
...@@ -93,6 +93,7 @@ bool TrackWorkflow::checkNextClip( qint64 currentFrame ) ...@@ -93,6 +93,7 @@ bool TrackWorkflow::checkNextClip( qint64 currentFrame )
else if ( next.key() == currentFrame ) else if ( next.key() == currentFrame )
{ {
//It should have been initialized now, however, this ain't very safe :/ //It should have been initialized now, however, this ain't very safe :/
//TODO: remove this.
Q_ASSERT( next.value()->isReady() ); Q_ASSERT( next.value()->isReady() );
// qDebug() << "Switching current clip workflow"; // qDebug() << "Switching current clip workflow";
//Using it as the current clip from now on. //Using it as the current clip from now on.
...@@ -138,10 +139,7 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame ) ...@@ -138,10 +139,7 @@ unsigned char* TrackWorkflow::getOutput( qint64 currentFrame )
else else
{ {
if ( clipsRemaining == false ) if ( clipsRemaining == false )
{
// qDebug() << "End of track";
return NULL; return NULL;
}
} }
return ret; return ret;
} }
...@@ -153,8 +151,6 @@ void TrackWorkflow::setPosition( float pos ) ...@@ -153,8 +151,6 @@ void TrackWorkflow::setPosition( float pos )
const QMap<qint64, ClipWorkflow*>::iterator end = m_clips.end(); const QMap<qint64, ClipWorkflow*>::iterator end = m_clips.end();
QMap<qint64, ClipWorkflow*>::iterator next = end; QMap<qint64, ClipWorkflow*>::iterator next = end;
if ( m_mediaPlayer->isPlaying() == false )
return ;
QWriteLocker lock( m_currentLock ); QWriteLocker lock( m_currentLock );
if ( frame > m_length ) if ( frame > m_length )
{ {
...@@ -185,13 +181,13 @@ void TrackWorkflow::setPosition( float pos ) ...@@ -185,13 +181,13 @@ void TrackWorkflow::setPosition( float pos )
next = it; next = it;
if ( next != m_clips.begin() ) if ( next != m_clips.begin() )
{ {
qDebug() << "Next clip isn't the first one"; // qDebug() << "Next clip isn't the first one";
next = next - 1; //Since the iterator must point to the previous video next = next - 1; //Since the iterator must point to the previous video
} }
else else
{ {
next = end; next = end;
qDebug() << "Next clip is the first of the track"; // qDebug() << "Next clip is the first of the track";
} }
// in order to checkNextClip() to work. // in order to checkNextClip() to work.
it = end; it = end;
......
...@@ -83,6 +83,11 @@ class TrackWorkflow : public QObject ...@@ -83,6 +83,11 @@ class TrackWorkflow : public QObject
QMutex* m_condMutex; QMutex* m_condMutex;
QReadWriteLock* m_currentLock; QReadWriteLock* m_currentLock;
QWaitCondition* m_waitCondition; QWaitCondition* m_waitCondition;
/**
* This is the MediaPlayer that the clipworkflow
* will be using to process its render.
* It is never used internally.
*/
LibVLCpp::MediaPlayer* m_mediaPlayer; LibVLCpp::MediaPlayer* m_mediaPlayer;
/** /**
* \brief The track length in frames. * \brief The track length in frames.
......
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