From 104d5120c9754ffe9ca6fbd532d24abc98ef4155 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Tue, 4 Nov 2008 17:42:37 +0100
Subject: [PATCH] configure.ac: check for avcodec_decode_audio2()

Disable the ffmpeg decoder plugin if avcodec_decode_audio2() is not
available.
---
 configure.ac | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index 2e1632e74..bc12d0900 100644
--- a/configure.ac
+++ b/configure.ac
@@ -755,6 +755,14 @@ if test x$enable_ffmpeg = xyes; then
 		enable_ffmpeg=no)
 fi
 
+if test x$enable_ffmpeg = xyes; then
+	old_LIBS=$LIBS
+	LIBS="$LIBS $FFMPEG_LIBS"
+	AC_CHECK_LIB(avcodec, avcodec_decode_audio2,,
+		enable_ffmpeg=no)
+	LIBS=$old_LIBS
+fi
+
 if test x$enable_ffmpeg = xyes; then
 	# prior to ffmpeg svn12865, you had to specify include files
 	# without path prefix