Mercurial > libavcodec.hg
changeset 7457:3c616a62a446 libavcodec
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
author | benoit |
---|---|
date | Fri, 01 Aug 2008 07:23:29 +0000 |
parents | 211cca1e3f39 |
children | eb63aa50bf85 |
files | libmp3lame.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libmp3lame.c Thu Jul 31 19:51:19 2008 +0000 +++ b/libmp3lame.c Fri Aug 01 07:23:29 2008 +0000 @@ -50,8 +50,11 @@ 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);