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