[vlmc-devel] commit: VideoClipWorkflow: Avoid using an invalid fps for computation. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sat Jul 31 17:36:02 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sat Jul 31 19:21:14 2010 +0200| [b0ca843aa067eeb05741d9e99658ddadf0f95f3f] | committer: Hugo Beauzée-Luyssen 

VideoClipWorkflow: Avoid using an invalid fps for computation.

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

 src/Workflow/VideoClipWorkflow.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Workflow/VideoClipWorkflow.cpp b/src/Workflow/VideoClipWorkflow.cpp
index 1f52c9a..37cb519 100644
--- a/src/Workflow/VideoClipWorkflow.cpp
+++ b/src/Workflow/VideoClipWorkflow.cpp
@@ -23,6 +23,7 @@
 #include "Clip.h"
 #include "EffectInstance.h"
 #include "MainWorkflow.h"
+#include "Media.h"
 #include "StackedBuffer.hpp"
 #include "VideoClipWorkflow.h"
 #include "VLCMedia.h"
@@ -97,7 +98,7 @@ VideoClipWorkflow::initVlcOutput()
     m_vlcMedia->addOption( buffer );
     sprintf( buffer, ":sout-transcode-height=%i", m_height );
     m_vlcMedia->addOption( buffer );
-    sprintf( buffer, ":sout-transcode-fps=%f", (float)Clip::DefaultFPS );
+    sprintf( buffer, ":sout-transcode-fps=%f", clip()->getMedia()->fps() );
     m_vlcMedia->addOption( buffer );
 
     QReadLocker     lock( m_effectsLock );
@@ -169,7 +170,7 @@ VideoClipWorkflow::unlock( VideoClipWorkflow *cw, void *buffer, int width,
     {
         QWriteLocker    lock( cw->m_effectsLock );
         EffectsEngine::applyEffects( cw->m_effects, frame, cw->m_renderedFrame,
-                                     cw->m_renderedFrame * 1000.0 / (double)Clip::DefaultFPS );
+                                     cw->m_renderedFrame * 1000.0 / cw->clip()->getMedia()->fps() );
     }
     {
         QMutexLocker    lock( cw->m_renderedFrameMutex );
@@ -236,7 +237,7 @@ VideoClipWorkflow::setTime( qint64 time )
 {
     {
         QMutexLocker    lock( m_renderedFrameMutex );
-        m_renderedFrame = time / 1000 * Clip::DefaultFPS;
+        m_renderedFrame = time / 1000 * clip()->getMedia()->fps();
     }
     ClipWorkflow::setTime( time );
 }



More information about the Vlmc-devel mailing list