From 1693604b4daae4571069b58bdc863516b95999a6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 31 Aug 2013 02:31:13 +0200 Subject: FFMPEG/GLMediaPlayer: Fix compiler errors w/ new MingW 4.8.1: 'strsafe.h' -> don't use tchar.h; Fix compiler warning: Add missing (intptr_t) cast. --- src/jogl/native/libav/ffmpeg_dshow.c | 12 +++++++++--- src/jogl/native/libav/ffmpeg_static.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/jogl/native') diff --git a/src/jogl/native/libav/ffmpeg_dshow.c b/src/jogl/native/libav/ffmpeg_dshow.c index 8c9903d6b..4f1523a81 100644 --- a/src/jogl/native/libav/ffmpeg_dshow.c +++ b/src/jogl/native/libav/ffmpeg_dshow.c @@ -32,8 +32,12 @@ #include #include + +// dshow includes strsafe.h, hence tchar.h cannot be used +// include strsafe.h here for documentation +// #include +#include #include -#include static HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum) { @@ -58,9 +62,11 @@ static HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum) static void getBSTRChars(BSTR bstr, char *pDest, int destLen) { #ifdef UNICODE - _sntprintf(pDest, destLen, _T("%s"), bstr); + // _sntprintf(pDest, destLen, _T("%s"), bstr); + StringCbPrintfW(pDest, destLen, L"%s", bstr); #else - _sntprintf(pDest, destLen, _T("%S"), bstr); + // _sntprintf(pDest, destLen, _T("%S"), bstr); + StringCchPrintfA(pDest, destLen, "%S", bstr); #endif } diff --git a/src/jogl/native/libav/ffmpeg_static.c b/src/jogl/native/libav/ffmpeg_static.c index f079ee841..be5bc00b7 100644 --- a/src/jogl/native/libav/ffmpeg_static.c +++ b/src/jogl/native/libav/ffmpeg_static.c @@ -46,7 +46,7 @@ typedef unsigned (APIENTRYP AV_GET_VERSION)(void); JNIEXPORT jint JNICALL Java_jogamp_opengl_util_av_impl_FFMPEGStaticNatives_getAvVersion0 (JNIEnv *env, jclass clazz, jlong func) { if( 0 != func ) { - return (jint) ((AV_GET_VERSION)func)(); + return (jint) ((AV_GET_VERSION) (intptr_t) func)(); } else { return 0; } -- cgit v1.2.3