shithub: sox

Download patch

ref: 7e33bc7700b12ac5f1fac2ab0dc92ac281d7fdcc
parent: ea405f02c7390df7012c2d93e8480f5520e4752e
author: idigdoug <idigdoug>
date: Wed Dec 2 06:06:28 EST 2009

Skip compiling ffmpeg.c if !HAVE_FFMPEG. Skip compiling wavpack.c if !HAVE_WAVPACK_H && !HAVE_WAVPACK. If HAVE_WAVPACK_H is set, look for <wavpack.h> (source location), otherwise look for <wavpack/wavpack.h> (installed location). Does not affect existing code, but allows MSVC compiles to more easily build against the wavpack source distribution.

--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -42,6 +42,8 @@
 
 #include "sox_i.h"
 
+#ifdef HAVE_FFMPEG
+
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
@@ -500,3 +502,5 @@
 
   return &handler;
 }
+
+#endif /* HAVE_FFMPEG */
--- a/src/wavpack.c
+++ b/src/wavpack.c
@@ -16,8 +16,19 @@
  */
 
 #include "sox_i.h"
-#include "wavpack/wavpack.h"
 
+#ifdef HAVE_WAVPACK_H
+#define HAVE_WAVPACK 1
+#endif
+
+#ifdef HAVE_WAVPACK
+
+#ifdef HAVE_WAVPACK_H
+#include <wavpack.h>
+#else
+#include <wavpack/wavpack.h>
+#endif
+
 typedef struct {
   WavpackContext * codec;
   size_t first_block_size;
@@ -177,3 +188,5 @@
   };
   return &handler;
 }
+
+#endif /* HAVE_WAVPACK */