summaryrefslogtreecommitdiffstats
path: root/src/jogl/native/libav/ffmpeg_dshow.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-08-31 02:31:13 +0200
committerSven Gothel <[email protected]>2013-08-31 02:31:13 +0200
commit1693604b4daae4571069b58bdc863516b95999a6 (patch)
tree5af580e91f569c91a6a41d69564c390bda48f893 /src/jogl/native/libav/ffmpeg_dshow.c
parentf5bc467cfa7deebabfdab6335c6c3704bc610609 (diff)
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.
Diffstat (limited to 'src/jogl/native/libav/ffmpeg_dshow.c')
-rw-r--r--src/jogl/native/libav/ffmpeg_dshow.c12
1 files changed, 9 insertions, 3 deletions
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 <stdio.h>
#include <string.h>
+
+// dshow includes strsafe.h, hence tchar.h cannot be used
+// include strsafe.h here for documentation
+// #include <tchar.h>
+#include <strsafe.h>
#include <dshow.h>
-#include <tchar.h>
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
}