ref: 549928e2effb60a1afa7ccd174e17ce5cdd5674d
parent: eb999827d93a5bd1571ed59e5aff63aa7e26886f
author: Paul Brossier <[email protected]>
date: Tue Dec 10 03:30:42 EST 2013
wscript: make sure all libav libraries are installed to build source_avcodec Signed-off-by: Paul Brossier <[email protected]>
--- a/src/io/source.c
+++ b/src/io/source.c
@@ -23,9 +23,9 @@
#include "fvec.h"
#include "fmat.h"
#include "io/source.h"
-#ifdef HAVE_AVCODEC
+#ifdef HAVE_LIBAV
#include "io/source_avcodec.h"
-#endif /* HAVE_AVCODEC */
+#endif /* HAVE_LIBAV */
#ifdef __APPLE__
#include "io/source_apple_audio.h"
#endif /* __APPLE__ */
@@ -52,7 +52,7 @@
aubio_source_t * new_aubio_source(char_t * uri, uint_t samplerate, uint_t hop_size) {
aubio_source_t * s = AUBIO_NEW(aubio_source_t);
-#if HAVE_AVCODEC
+#if HAVE_LIBAV
s->source = (void *)new_aubio_source_avcodec(uri, samplerate, hop_size);
if (s->source) {
s->s_do = (aubio_source_do_t)(aubio_source_avcodec_do);
@@ -63,7 +63,7 @@
s->s_del = (del_aubio_source_t)(del_aubio_source_avcodec);
return s;
}
-#endif /* HAVE_AVCODEC */
+#endif /* HAVE_LIBAV */
#ifdef __APPLE__
s->source = (void *)new_aubio_source_apple_audio(uri, samplerate, hop_size);
if (s->source) {
--- a/src/io/source_avcodec.c
+++ b/src/io/source_avcodec.c
@@ -21,7 +21,7 @@
#include "config.h"
-#ifdef HAVE_AVCODEC
+#ifdef HAVE_LIBAV
#include <sndfile.h>
#include <libavcodec/avcodec.h>
@@ -402,4 +402,4 @@
AUBIO_FREE(s);
}
-#endif /* HAVE_SNDFILE */
+#endif /* HAVE_LIBAV */
--- a/wscript
+++ b/wscript
@@ -213,6 +213,12 @@
args = '--cflags --libs', uselib_store = 'AVUTIL', mandatory = False)
ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
args = '--cflags --libs', uselib_store = 'AVRESAMPLE', mandatory = False)
+ if all ( 'HAVE_' + i in ctx.env.define_key
+ for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
+ ctx.define('HAVE_LIBAV', 1)
+ ctx.msg('Checking for all libav libraries', 'yes')
+ else:
+ ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
# use memcpy hacks
if (ctx.options.enable_memcpy == True):