[FFmpeg-cvslog] r14494 - trunk/libavcodec/libmp3lame.c

benoit subversion
Fri Aug 1 09:23:30 CEST 2008


Author: benoit
Date: Fri Aug  1 09:23:29 2008
New Revision: 14494

Log:
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


Modified:
   trunk/libavcodec/libmp3lame.c

Modified: trunk/libavcodec/libmp3lame.c
==============================================================================
--- trunk/libavcodec/libmp3lame.c	(original)
+++ trunk/libavcodec/libmp3lame.c	Fri Aug  1 09:23:29 2008
@@ -50,8 +50,11 @@ static av_cold int MP3lame_encode_init(A
     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);




More information about the ffmpeg-cvslog mailing list