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

Solved position problem when starting to playback a splitted clip.

parent 74dd5c54
......@@ -88,6 +88,7 @@ void ClipWorkflow::initialize( bool preloading /*= false*/ )
void ClipWorkflow::pauseAfterPlaybackStarted()
{
adjustBegin();
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( pauseAfterPlaybackStarted() ) );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( initializedMediaPlayer() ), Qt::DirectConnection );
......@@ -96,6 +97,7 @@ void ClipWorkflow::pauseAfterPlaybackStarted()
void ClipWorkflow::loadingComplete()
{
adjustBegin();
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( loadingComplete() ) );
setState( Ready );
}
......@@ -106,6 +108,11 @@ void ClipWorkflow::initializedMediaPlayer()
setState( Ready );
}
void ClipWorkflow::adjustBegin()
{
m_mediaPlayer->setTime( m_clip->getBegin() / m_clip->getParent()->getFps() * 1000 );
}
bool ClipWorkflow::isReady() const
{
QReadLocker lock( m_stateLock );
......
......@@ -166,6 +166,7 @@ class ClipWorkflow : public QObject
private:
void setState( State state );
void checkSynchronisation( State newState );
void adjustBegin();
private:
Clip* m_clip;
......
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