[FFmpeg-devel] compile issues under mingw-cross-env

Reimar Döffinger Reimar.Doeffinger
Sat Jul 10 23:47:04 CEST 2010


On Sat, Jul 10, 2010 at 10:22:01PM +0100, M?ns Rullg?rd wrote:
> Ramiro Polla <ramiro.polla at gmail.com> writes:
> 
> > On Sat, Jul 10, 2010 at 6:14 PM, Reimar D?ffinger
> > <Reimar.Doeffinger at gmx.de> wrote:
> >> However, I am quite convinced that all uses (except in ffsever) of
> >> strcasecmp in FFmpeg are just plain _wrong_ and will break things
> >> if a calling application uses setlocale.
> >> For example, with TR_tr locale,
> >> if (!strcasecmp(m->elems[j].key, "provider_name"))
> >> will not match provIder_name.
> >> I seriously doubt this can be considered correct behaviour,
> >
> > So are we going to have av_strcasecmp()? =)
> 
> http://git.mansr.com/?p=ffmpeg.mru;a=commitdiff;h=0dc41ad1923

That is quite funny in this context, by using tolower it still
has exactly the same issues.
av_strcasecmp_ascii
with
while (1) {
    int delta = *s - *d;
    if (!*s || (delta &&
        (delta != 'a' - 'A' || *s < 'a' || *s > 'z') &&
        (delta != 'A' - 'a' || *s < 'A' || *s > 'Z')))
        return delta;
    s++; d++;
}
should avoid it and would be faster.



More information about the ffmpeg-devel mailing list