Commit 991cfe4b authored by Rohit Yadav's avatar Rohit Yadav

ClipRenderer: Render previousFrames better

This patch tries to solve bug #71, implements a less ugly previousFrame() for rendering clip
Sets time to current time minus interval of rendering two frames and renders next frame.
parent e752139e
......@@ -23,6 +23,7 @@
#include <QtDebug>
#include <QtGlobal>
#include <QtCore/qmath.h>
#include "Clip.h"
#include "ClipRenderer.h"
......@@ -179,8 +180,10 @@ ClipRenderer::previousFrame()
{
if ( m_paused == false )
togglePlayPause( true );
qint64 interval = static_cast<qint64>( (1.0f / m_mediaPlayer->getFps()) * 1000.0f );
/* FIXME: Implement a better way to render previous frame */
qint64 interval = static_cast<qint64>( qCeil(1000.0f * 2.0f / m_mediaPlayer->getFps()) );
m_mediaPlayer->setTime( m_mediaPlayer->getTime() - interval );
m_mediaPlayer->nextFrame();
}
}
......
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