aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorNicolas George <nicola.george@normalesup.org>2008-08-01 07:23:29 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-08-01 07:23:29 +0000
commitafffd357b0a24b39ede5a9471a45c1829d998f3e (patch)
treef119ca728df346cd185eb02acd9304c3d546a140 /libavcodec/libmp3lame.c
parent014d2f0509d97fae5fe7a3640046ad354ee0b9c5 (diff)
downloadffmpeg-afffd357b0a24b39ede5a9471a45c1829d998f3e.tar.gz
Use compression level to set mp3lame quality option.
Patch by Nicolas George nicolas george normalesup org Original thread: [PATCH] libmp3lame: set noise shaping & psychoacoustic algorithms quality Date: 07/31/2008 03:53 PM Originally committed as revision 14494 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index ab22038276..bccff00b0e 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -50,8 +50,11 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
lame_set_in_samplerate(s->gfp, avctx->sample_rate);
lame_set_out_samplerate(s->gfp, avctx->sample_rate);
lame_set_num_channels(s->gfp, avctx->channels);
- /* lame 3.91 dies on quality != 5 */
- lame_set_quality(s->gfp, 5);
+ if(avctx->compression_level == FF_COMPRESSION_DEFAULT) {
+ lame_set_quality(s->gfp, 5);
+ } else {
+ lame_set_quality(s->gfp, avctx->compression_level);
+ }
/* lame 3.91 doesn't work in mono */
lame_set_mode(s->gfp, JOINT_STEREO);
lame_set_brate(s->gfp, avctx->bit_rate/1000);