Fix for compilation with newer ffmpeg library
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 16 May 2010 19:41:49 +0000 (19:41 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 16 May 2010 19:41:49 +0000 (19:41 +0000)
Error was cased by undefined UINT64_C in stdint.h for c++
programs. As I understand from ffmpeg mailing list the simpliest
solution is to define __STDC_CONSTANT_MACROS before including
ffmpeg libraries. There already was some amout of such definitions in
the code and I've tested this with newer and older ffmpeg
libraries -- this should work and should be safe, but maybe
there is better way of fixing this problem.

intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
intern/audaspace/intern/AUD_C-API.cpp
intern/audaspace/intern/AUD_FileFactory.cpp

index f67c819ff1016089f8fbd6b496b5d577a4813948..8e71c97baec891829df9d24bcb333d8ea730f14c 100644 (file)
@@ -23,6 +23,9 @@
  * ***** END LGPL LICENSE BLOCK *****
  */
 
+// needed for INT64_C
+#define __STDC_CONSTANT_MACROS
+
 #include "AUD_FFMPEGFactory.h"
 #include "AUD_FFMPEGReader.h"
 #include "AUD_Buffer.h"
index 32cfd2098b0c5be8c165d28295eba2d881ce1008..8740f62c9a79a45fbb447b74a2a5d9dfbb6947fe 100644 (file)
 #include <cstring>
 #include <cmath>
 
+#ifdef WITH_FFMPEG
+// needed for INT64_C
+#define __STDC_CONSTANT_MACROS
+#endif
+
 #include "AUD_NULLDevice.h"
 #include "AUD_I3DDevice.h"
 #include "AUD_FileFactory.h"
@@ -62,6 +67,7 @@
 #include "AUD_JackDevice.h"
 #endif
 
+
 #ifdef WITH_FFMPEG
 extern "C" {
 #include <libavformat/avformat.h>
index b63390803b193f7ffd6b98dcf9a03d7198095829..5888479a0bad4b8effc86ed2b06c5a903181e760 100644 (file)
@@ -29,6 +29,9 @@
 #include <cstring>
 
 #ifdef WITH_FFMPEG
+// needed for INT64_C
+#define __STDC_CONSTANT_MACROS
+
 #include "AUD_FFMPEGReader.h"
 #endif
 #ifdef WITH_SNDFILE