[FFmpeg-devel] [PATCH] avfilter/showcqt: BASEFREQ and ENDFREQ cast to double

Muhammad Faiz mfcc64 at gmail.com
Mon Nov 30 17:05:57 CET 2015


On Mon, Nov 30, 2015 at 10:52 PM, Nicolas George <george at nsup.org> wrote:
> Le decadi 10 frimaire, an CCXXIV, Muhammad Faiz a écrit :
>> -    if (s->basefreq != BASEFREQ || s->endfreq != ENDFREQ) {
>> +    if (s->basefreq != (double) BASEFREQ || s->endfreq != (double) ENDFREQ) {
>
> Looks wrong to me. Since s->basefreq is double and operands are always
> converted to the largest type before comparison, the cast would be implicit.
> And BASEFREQ and ENDFREQ are double anyway.
>
> The problem, if any, is somewhere else.
>

double basefreq = BASEFREQ, endfreq = ENDFREQ;
if (basefreq == BASEFREQ && endfreq == ENDFREQ)
    printf("equal\n");
else
    printf("inequal\n");

I try with gcc -std=c89 / -std=c99 on mingw 32-bit
the result is inequal.


More information about the ffmpeg-devel mailing list