shithub: sox

Download patch

ref: ecd4253d846232d0982e479b4adf955b33a42a9f
parent: 19feae6a37cc9322f84e5cebf1d339826fb97cb6
author: cbagwell <cbagwell>
date: Sun Jul 20 23:58:20 EDT 2008

Look in new and old locations for avformat.h

--- a/configure.ac
+++ b/configure.ac
@@ -288,12 +288,14 @@
         [Don't try to use ffmpeg]))
 using_ffmpeg=no
 if test "$with_ffmpeg" != "no"; then
-    using_ffmpeg=yes
-    AC_CHECK_HEADER(ffmpeg/avformat.h,
+    AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h,
         [AC_CHECK_LIB(avutil, av_rescale_q, FFMPEG_LIBS="-lavutil $FFMPEG_LIBS", using_ffmpeg=no)
         AC_CHECK_LIB(avcodec, avcodec_decode_audio2, FFMPEG_LIBS="-lavcodec $FFMPEG_LIBS", using_ffmpeg=no, $FFMPEG_LIBS)
-        AC_CHECK_LIB(avformat, av_open_input_file, FFMPEG_LIBS="-lavformat $FFMPEG_LIBS", using_ffmpeg=no, $FFMPEG_LIBS)],
-        using_ffmpeg=no)
+        AC_CHECK_LIB(avformat, av_open_input_file, 
+                     [FFMPEG_LIBS="-lavformat $FFMPEG_LIBS"
+                      using_ffmpeg=yes],
+                     using_ffmpeg=no, $FFMPEG_LIBS)
+        break])
     if test "$with_ffmpeg" = "yes" -a "$using_ffmpeg" = "no"; then
         AC_MSG_FAILURE([cannot find ffmpeg])
     fi
--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -46,7 +46,11 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#if HAVE_LIBAVFORMAT_AVFORMAT_H
+#include <libavformat/avformat.h>
+#else
 #include <ffmpeg/avformat.h>
+#endif
 
 /* Private data for ffmpeg files */
 typedef struct {