Commit 7e52fcb4 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Timeline: Fix a floating point exception in the timecode generation.

Thanks to Sebastien Rannou who reported the issue.
parent 390a4194
......@@ -197,18 +197,22 @@ void PreviewRuler::updateTimecode( qint64 frames /*= -1*/ )
if ( m_renderer->getLength() > 0 )
{
int fps = (int)m_renderer->getFps();
if ( frames == -1 )
frames = m_renderer->getCurrentFrame();
int h = frames / fps / 60 / 60;
frames -= h * fps * 60 * 60;
if ( fps > 0 )
{
if ( frames == -1 )
frames = m_renderer->getCurrentFrame();
int m = frames / fps / 60;
frames -= m * fps * 60;
int h = frames / fps / 60 / 60;
frames -= h * fps * 60 * 60;
int s = frames / fps;
frames -= s * fps;
int m = frames / fps / 60;
frames -= m * fps * 60;
emit timeChanged( h, m, s, frames );
int s = frames / fps;
frames -= s * fps;
emit timeChanged( h, m, s, 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