On Dec 23, 2014, at 12:41 AM, Max Kellermann <[email protected]> wrote:
> 
>> #include <libavutil/mem.h>
>> #else
>> +#include <libavutil/mem.h>
> 
> You better move this out of the #ifdef, so you can merge the two
> #include lines.

Okay, how about this.  Looks like all we want to determine is if we have the 
av_fast_malloc()
function/wrapper in libavcodec.  

Fix: always include both libavutil/mem.h and libavcodec/avcodec.h regardless of 
whether we have
av_fast_malloc or avcodec.h or not.

diff --git a/src/lib/ffmpeg/Buffer.hxx b/src/lib/ffmpeg/Buffer.hxx
index eab1be8..86573ce 100644
--- a/src/lib/ffmpeg/Buffer.hxx
+++ b/src/lib/ffmpeg/Buffer.hxx
@@ -22,16 +22,13 @@

 extern "C" {
 #include <libavutil/avutil.h>
-
-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 18, 0)
-#define HAVE_AV_FAST_MALLOC
 #include <libavutil/mem.h>
-#else
 #include <libavcodec/avcodec.h>
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 25, 0)
+
+#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 18, 0)) || \
+       (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 25, 0))
 #define HAVE_AV_FAST_MALLOC
 #endif
-#endif
 }

 #include <stddef.h>




_______________________________________________
mpd-devel mailing list
[email protected]
http://mailman.blarg.de/listinfo/mpd-devel

Reply via email to