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

Solved bug when starting to render a clip at non zero position

parent 6f118a3d
......@@ -86,8 +86,12 @@ void ClipWorkflow::loadingComplete()
void ClipWorkflow::adjustBegin()
{
if ( m_clip->getParent()->getFileType() == Media::Video || m_clip->getParent()->getFileType() == Media::Audio )
m_mediaPlayer->setTime( m_clip->getBegin() / m_clip->getParent()->getFps() * 1000 );
if ( m_clip->getParent()->getFileType() == Media::Video ||
m_clip->getParent()->getFileType() == Media::Audio )
{
m_mediaPlayer->setTime( m_clip->getBegin() /
m_clip->getParent()->getFps() * 1000 );
}
}
bool ClipWorkflow::isEndReached() const
......
......@@ -151,9 +151,9 @@ void* TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
{
cw->getStateLock()->unlock();
cw->initialize();
cw->waitForCompleteInit();
if ( start != currentFrame || cw->getClip()->getBegin() != 0 ) //Clip was not started as its real begining
adjustClipTime( currentFrame, start, cw );
cw->waitForCompleteInit();
return cw->getOutput( ClipWorkflow::Pop );
}
else if ( cw->getState() == ClipWorkflow::EndReached )
......@@ -454,7 +454,6 @@ void TrackWorkflow::clear()
void TrackWorkflow::adjustClipTime( qint64 currentFrame, qint64 start, ClipWorkflow* cw )
{
qDebug() << "Adjusting clip time.";
qint64 nbMs = ( currentFrame - start ) / cw->getClip()->getParent()->getFps() * 1000;
qint64 beginInMs = cw->getClip()->getBegin() / cw->getClip()->getParent()->getFps() * 1000;
qint64 startFrame = beginInMs + nbMs;
......
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