shithub: aubio

Download patch

ref: c7d444a96b456843e2774610a06879218faf6e4b
parent: 4f64069db70f820ccb42055e3a550f0bf7ab1544
author: Paul Brossier <piem@piem.org>
date: Fri Mar 17 06:32:22 EDT 2017

python/lib/moresetuptools.py: check for libswresample, prefer to libavresample

--- a/python/lib/moresetuptools.py
+++ b/python/lib/moresetuptools.py
@@ -112,7 +112,8 @@
 def add_external_deps(ext, usedouble = False):
     # loof for additional packages
     print("Info: looking for *optional* additional packages")
-    packages = ['libavcodec', 'libavformat', 'libavutil', 'libavresample',
+    packages = ['libavcodec', 'libavformat', 'libavutil',
+                'libswresample', 'libavresample',
                 'sndfile',
                 #'fftw3f',
                ]
@@ -124,9 +125,13 @@
     add_packages(packages, ext=ext)
     if 'avcodec' in ext.libraries \
             and 'avformat' in ext.libraries \
-            and 'avutil' in ext.libraries \
-            and 'avresample' in ext.libraries:
-        ext.define_macros += [('HAVE_LIBAV', 1)]
+            and 'avutil' in ext.libraries:
+        if 'swresample' in ext.libraries:
+            ext.define_macros += [('HAVE_SWRESAMPLE', 1)]
+        elif 'avresample' in ext.libraries:
+            ext.define_macros += [('HAVE_AVRESAMPLE', 1)]
+        if 'swresample' in ext.libraries or 'avresample' in ext.libraries:
+            ext.define_macros += [('HAVE_LIBAV', 1)]
     if 'sndfile' in ext.libraries:
         ext.define_macros += [('HAVE_SNDFILE', 1)]
     if 'samplerate' in ext.libraries: