[vlmc-devel] ClipRenderer: Render previousFrames better

Rohit Yadav git at videolan.org
Fri Mar 9 21:33:59 CET 2012


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Sat Mar 10 02:16:08 2012 +0530| [991cfe4b97c8b8650ff8fd0050ff3267be93c872] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=991cfe4b97c8b8650ff8fd0050ff3267be93c872
---

 src/Renderer/ClipRenderer.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index 92e1cd6..9346a06 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -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();
     }
 }
 



More information about the Vlmc-devel mailing list