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

Baptiste Coudurier baptiste.coudurier
Fri Apr 13 12:28:03 CEST 2007


Benoit Fouet wrote:
> M?ns Rullg?rd wrote:
>> 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
> it seems so:
>
> [...]
> 
> +        if (codec_identified[st->index]) {
> +            av_read_frame_flush(ic);
> +            av_seek_frame(ic, st->index, 0.0, 0);
> +            url_fseek(&ic->pb, ic->data_offset, SEEK_SET);
> +        }

Btw, what if stream is not seakable ? Code should close and reopen the
file in this case, like av_open_input_file, no ?

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-cvslog mailing list