From efec9ac8a9a05e309e8f46f74a24e0278fc7a997 Mon Sep 17 00:00:00 2001 From: James Darnley Date: Wed, 15 Sep 2010 22:10:13 +0000 Subject: [PATCH] Allow float values for libmp3lame quality. Patch by James Darnley, james D darnley A gmail Originally committed as revision 25128 to svn://svn.ffmpeg.org/ffmpeg/trunk --- configure | 2 +- libavcodec/libmp3lame.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure b/configure index d15be7019c..25c657327f 100755 --- a/configure +++ b/configure @@ -2714,7 +2714,7 @@ enabled libdirac && add_cflags $(pkg-config --cflags dirac) && require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac) enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm -enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame +enabled libmp3lame && require libmp3lame lame/lame.h hip_decode_init -lmp3lame enabled libnut && require libnut libnut.h nut_demuxer_init -lnut enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 1d74d6d59d..92b4024a0e 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -61,7 +61,8 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx) if(avctx->flags & CODEC_FLAG_QSCALE) { lame_set_brate(s->gfp, 0); lame_set_VBR(s->gfp, vbr_default); - lame_set_VBR_q(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA); + /* requires lame 3.98 or later */ + lame_set_VBR_quality(s->gfp, avctx->global_quality/(float)FF_QP2LAMBDA); } lame_set_bWriteVbrTag(s->gfp,0); lame_set_disable_reservoir(s->gfp, avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR ? 0 : 1);