[FFmpeg-devel] [PATCH] Allow setting mode MONO in libmp3lame if the library is greater than 3.97

Reimar Döffinger Reimar.Doeffinger
Fri Aug 13 09:10:43 CEST 2010


On Thu, Aug 12, 2010 at 10:33:02PM -0700, Thierry Foucu wrote:
> Hi,
> 
> for a while we are using lame 3.97+ in mono and stereo mode in mencoder, and
> I noticed that ffmpeg sets always the mode to JOINT_STEREO.
> 
> The patch will check lame version and if greater then 3.97, it will set the
> mode to MONO or JOINT_STEREO

Why is there any need to set it to mono?
I don't think it is possible to encode a single channel as JOINT_STEREO
except by duplicating a channel, which is something that doesn't really
belong in a encoder library...

> ===================================================================
> --- libavcodec/libmp3lame.c (revision 24791)
> +++ libavcodec/libmp3lame.c (working copy)
> @@ -55,8 +55,18 @@
>      } 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_version_t lame_version;

In addition to the warning, this will break compilation with at least
gcc 2.95.



More information about the ffmpeg-devel mailing list