[vlmc-devel] commit: Renderer: Fix win32 rendering, due to badly formated sprintf. ( Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Mon Mar 15 10:40:38 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Mon Mar 15 10:40:18 2010 +0100| [70eaa352a5451c3c224775c8a55c1540ddf93a5e] | committer: Hugo Beauzee-Luyssen 

Renderer: Fix win32 rendering, due to badly formated sprintf.

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

 CMakeLists.txt                    |    2 ++
 src/Renderer/WorkflowRenderer.cpp |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9af575c..6851c6c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,8 @@ IF(WIN32)
     # Building in release for WIN32
     set(CMAKE_BUILD_TYPE "Release")
     SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
+    # Use mingw's sprintf instead of windows's
+    ADD_DEFINITIONS( -D__USE_MINGW_ANSI_STDIO=1 )
 ENDIF(WIN32)
 
 # Optionally allow embedding libvlc into the binary as
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index ba33aa4..fdba92c 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -23,6 +23,8 @@
 #include <QtDebug>
 #include <QThread>
 #include <QWaitCondition>
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
 
 #include "WorkflowRenderer.h"
 #include "timeline/Timeline.h"
@@ -93,10 +95,10 @@ WorkflowRenderer::setupRenderer( quint32 width, quint32 height, double fps )
     //Clean any previous render.
     memset( m_renderVideoFrame, 0, m_width * m_height * Pixel::NbComposantes );
 
-    sprintf( videoString, "width=%i:height=%i:dar=%s:fps=%s:data=%lld:codec=%s:cat=2:caching=0",
+    sprintf( videoString, "width=%i:height=%i:dar=%s:fps=%s:data=%" PRId64 ":codec=%s:cat=2:caching=0",
              width, height, "16/9", "30/1",
              (qint64)m_videoEsHandler, "RV24" );
-    sprintf( audioParameters, "data=%lld:cat=1:codec=f32l:samplerate=%u:channels=%u:caching=0",
+    sprintf( audioParameters, "data=%"PRId64":cat=1:codec=f32l:samplerate=%u:channels=%u:caching=0",
              (qint64)m_audioEsHandler, m_rate, m_nbChannels );
     strcpy( inputSlave, ":input-slave=imem://" );
     strcat( inputSlave, audioParameters );



More information about the Vlmc-devel mailing list