From 95ddda57e2f5ac2b52fb4431e739cceba5a20722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 5 May 2009 16:38:19 +0100 Subject: [PATCH] lame: fix compilation with LAME versions < 3.98 lame_set_VBR_quality(), which takes a floating point value for the quality, has been added only in v3.98. Use lame_set_VBR_q(), which takes quality as an integer, for older LAME versions. Fixes #581341. --- configure.ac | 6 ++++++ ext/lame/gstlamemp3enc.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index e3361f1e38..4c8255c840 100644 --- a/configure.ac +++ b/configure.ac @@ -303,6 +303,12 @@ AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [ [LAME_CFLAGS="-DGSTLAME_PRESET"], [LAME_CFLAGS=""] ) + AC_TRY_COMPILE([#include ], [ + void *ptr = &lame_set_VBR_quality + ], + [LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"], + [LAME_CFLAGS="$LAME_CFLAGS"] + ) AC_SUBST(LAME_CFLAGS) AC_SUBST(LAME_LIBS) ]) diff --git a/ext/lame/gstlamemp3enc.c b/ext/lame/gstlamemp3enc.c index 51e43ae93a..f898539dae 100644 --- a/ext/lame/gstlamemp3enc.c +++ b/ext/lame/gstlamemp3enc.c @@ -67,6 +67,11 @@ #include "gstlamemp3enc.h" #include +/* lame < 3.98 */ +#ifndef HAVE_LAME_SET_VBR_QUALITY +#define lame_set_VBR_quality(flags,q) lame_set_VBR_q((flags),(int)(q)) +#endif + GST_DEBUG_CATEGORY_STATIC (debug); #define GST_CAT_DEFAULT debug