[Ffmpeg-cvslog] r8715 - in trunk/libavformat: asf.c utils.c

Måns Rullgård mans
Fri Apr 13 12:15:07 CEST 2007


Benoit Fouet wrote:
> Hi Baptiste,
>
> Baptiste Coudurier wrote:
>> Hi
>>
>> benoit wrote:
>>
>>> Author: benoit
>>> Date: Thu Apr 12 10:11:33 2007
>>> New Revision: 8715
>>>
>>> Modified:
>>>    trunk/libavformat/asf.c
>>>    trunk/libavformat/utils.c
>>>
>>> Log:
>>>
>>> DVR-MS probe audio format
>>> patch by John Donaghy \ johnfdonaghy chez gmail dot com /
>>> Original thread:
>>> date: 03/13/2007 04:56 PM
>>> subject: [Ffmpeg-devel] [PATCH] DVR-MS probe audio format - was DVR-MS bug
>>> (MP2 decoding)
>>>
>>> [...]
>>>
>>> +static int set_codec_from_probe_data(AVStream *st, AVProbeData *pd, int
>>> score)
>>> +{
>>> +    AVInputFormat *fmt;
>>> +    fmt = av_probe_input_format2(pd, 1, &score);
>>> +
>>> +    if (fmt) {
>>> +        if (strncmp(fmt->name, "mp3", 3) == 0)
>>> +            st->codec->codec_id = CODEC_ID_MP3;
>>> +        else if (strncmp(fmt->name, "ac3", 3) == 0)
>>> +            st->codec->codec_id = CODEC_ID_AC3;
>>> +    }
>>> +    return fmt;
>>> +}
>>>
>>
>> utils.c:1661: warning: return makes integer from pointer without a cast
>
> what is prefered ?
> casting the return, or change function return type and table type ?

Casting a pointer to int is almost always wrong.

What is the function supposed to return?  If it is meant to return an
integer indicating whether a format was found, use !!fmt.  That still
doesn't seem quite right though, as only mp3 and ac3 cause any action
to be taken.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-cvslog mailing list