Commit 27a87c5a authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Fixed new positioning system for ClipRenderer

Corrected screwed clipRenderer lengthMs screwed calculation
parent c6036b72
...@@ -109,7 +109,7 @@ void MetaDataWorker::getMetaData() ...@@ -109,7 +109,7 @@ void MetaDataWorker::getMetaData()
qWarning() << "Invalid FPS for media:" << m_currentMedia->getFileInfo()->absoluteFilePath(); qWarning() << "Invalid FPS for media:" << m_currentMedia->getFileInfo()->absoluteFilePath();
m_currentMedia->setFps( FPS ); m_currentMedia->setFps( FPS );
} }
m_currentMedia->setNbFrames( m_currentMedia->getLengthMS() / 1000 * m_currentMedia->getFps() ); m_currentMedia->setNbFrames( (m_currentMedia->getLengthMS() / 1000) * m_currentMedia->getFps() );
m_currentMedia->emitMetaDataComputed( m_validity ); m_currentMedia->emitMetaDataComputed( m_validity );
//Setting time for snapshot : //Setting time for snapshot :
......
...@@ -177,10 +177,8 @@ void ClipRenderer::previousFrame() ...@@ -177,10 +177,8 @@ void ClipRenderer::previousFrame()
qint64 ClipRenderer::getLengthMs() const qint64 ClipRenderer::getLengthMs() const
{ {
if ( m_clipLoaded ) if ( m_selectedMedia )
return qMax( m_end - m_begin, (qint64)0 ); return ( qRound64( (qreal)( m_end - m_begin ) / m_selectedMedia->getFps() * 1000.0 ) );
else if ( m_selectedMedia )
return m_selectedMedia->getLengthMS();
return 0; return 0;
} }
...@@ -222,7 +220,7 @@ void ClipRenderer::previewWidgetCursorChanged( qint64 newFrame ) ...@@ -222,7 +220,7 @@ void ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
if ( m_isRendering == true ) if ( m_isRendering == true )
{ {
qint64 nbSeconds = qRound64( (qreal)newFrame / m_selectedMedia->getFps() ); qint64 nbSeconds = qRound64( (qreal)newFrame / m_selectedMedia->getFps() );
m_mediaPlayer->setTime( nbSeconds / 1000 ); m_mediaPlayer->setTime( nbSeconds * 1000 );
} }
} }
...@@ -236,6 +234,7 @@ void ClipRenderer::__videoPaused() ...@@ -236,6 +234,7 @@ void ClipRenderer::__videoPaused()
void ClipRenderer::__videoStopped() void ClipRenderer::__videoStopped()
{ {
emit frameChanged( 0, MainWorkflow::Renderer );
emit stopped(); emit stopped();
} }
......
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