summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-13 00:38:35 +0200
committerwm4 <wm4@nowhere>2013-05-13 00:39:07 +0200
commit279f4b59dc08950a90379ef5905736167c79a438 (patch)
treedd00ee2e8fe1ae2476e3350574ed364c593b4da0 /configure
parent35c8f7b6082871d690c4355d5173dde939bf60ec (diff)
downloadmpv-279f4b59dc08950a90379ef5905736167c79a438.tar.bz2
mpv-279f4b59dc08950a90379ef5905736167c79a438.tar.xz
audio: fix compilation with older libavresample versions
The libavresample version of the current Libav stable release lacks the avresample_set_channel_mapping() function. (FFmpeg's libswresample seems to be fine, because they added swr_set_channel_mapping() first.) Add a cheap/slow workaround to do channel reordering on our own. We don't use the recently removed MPlayer code (see commit 586b75a), because that is not generic enough. The functionality should be the same as with full-featured libavresample, and any differences are bugs. It's probably slower, though.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure b/configure
index 83db6cc188..2a3f1d2fab 100755
--- a/configure
+++ b/configure
@@ -2639,15 +2639,25 @@ echores "yes"
_resampler=no
+_avresample=no
+_avresample_has_set_channel_mapping=no
+
echocheck "libavresample >= 1.0.0"
if test "$_disable_avresample" = no ; then
if pkg_config_add "libavresample >= 1.0.0" ; then
_resampler=yes
+ _avresample=yes
def_resampler='#define CONFIG_LIBAVRESAMPLE'
fi
fi
echores "$_resampler"
+if test "$_avresample" = yes ; then
+ echocheck "libavresample avresample_set_channel_mapping() API"
+ statement_check libavresample/avresample.h 'avresample_set_channel_mapping(NULL, NULL)' && _avresample_has_set_channel_mapping=yes
+ echores "$_avresample_has_set_channel_mapping"
+fi
+
if test "$_resampler" = no ; then
echocheck "libswresample >= 0.15.100"
@@ -2658,10 +2668,17 @@ if test "$_resampler" = no ; then
echores "$_resampler"
fi
+
if test "$_resampler" = no ; then
die "No resampler found. Install libavresample or libswresample (FFmpeg)."
fi
+if test "$_avresample_has_set_channel_mapping" = yes ; then
+ def_avresample_has_set_channel_mapping='#define HAVE_AVRESAMPLE_SET_CHANNEL_MAPPING 1'
+else
+ def_avresample_has_set_channel_mapping='#define HAVE_AVRESAMPLE_SET_CHANNEL_MAPPING 0'
+fi
+
echocheck "libavutil QP API"
_avutil_has_qp_api=no
@@ -3307,6 +3324,7 @@ $def_xv
/* FFmpeg */
$def_encoding
$def_resampler
+$def_avresample_has_set_channel_mapping
$def_fast_64bit
$def_pthreads