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

Thierry Foucu tfoucu
Sat Sep 18 06:01:39 CEST 2010


On Tue, Aug 17, 2010 at 11:39 AM, Thierry Foucu <tfoucu at gmail.com> wrote:

> 2010/8/16 M?ns Rullg?rd <mans at mansr.com>
>
> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
>>
>> > On date Monday 2010-08-16 17:18:51 +0200, Michael Niedermayer encoded:
>> >> On Fri, Aug 13, 2010 at 02:29:11PM -0700, Thierry Foucu wrote:
>> >> > On Fri, Aug 13, 2010 at 11:40 AM, Reimar D?ffinger <
>> Reimar.Doeffinger at gmx.de
>> >> > > wrote:
>> >> >
>> >> > > On Fri, Aug 13, 2010 at 10:00:39AM -0700, Thierry Foucu wrote:
>> >> > > > +    get_lame_version_numerical(&lame_version);
>> >> > > > +    if (lame_version.major <= 3 && lame_version.minor < 97) {
>> >> > >
>> >> > > I think that isn't quite right, it would do the wrong thing
>> >> > > for a (probably non-existent and not supported by us)
>> >> > > 2.99 version.
>> >> > >
>> >> >
>> >> > True.. Will send a new patch for this (after the follow up
>> >> > question will be answer)
>> >> >
>> >> >
>> >> > > Also do we really need to support the buggy older versions?
>> >> > >
>> >> >
>> >> >
>> >> > Up to you. I can remove the test and be done with it.
>> >> > What do the others dev think about it?
>> >>
>> >> i am in favor of such checks if and only if we have a volunteer to
>> maintain
>> >> them
>> >>
>> >> do we?
>> >
>> > I'm for adding a version check in configure, which avoids the use of
>> > an older version, as we do for other libraries (e.g. libx264,
>> > librtmp).
>>
>> How likely are old lame versions in the wild?  IOW, how old is the
>> latest bad version, and have major distros updated (to the extent they
>> ship lame at all)?
>>
>>
> Here is a patch which sets the mode based on stereo and it does not check
> the lame version.
>
> Index: libavcodec/libmp3lame.c
> ===================================================================
> --- libavcodec/libmp3lame.c (revision 24791)
> +++ libavcodec/libmp3lame.c (working copy)
> @@ -55,8 +55,7 @@
>      } 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_mode(s->gfp, s->stereo? JOINT_STEREO : MONO);
>      lame_set_brate(s->gfp, avctx->bit_rate/1000);
>      if(avctx->flags & CODEC_FLAG_QSCALE) {
>          lame_set_brate(s->gfp, 0);
>
>
>
I notice that the new configure check for 3.98.2 version now.
So, can we have this patch apply now?



>
>
>
>> --
>>
>> M?ns Rullg?rd
>> mans at mansr.com
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>>
>
>



More information about the ffmpeg-devel mailing list