[FFmpeg-devel] [PATCH] Move av_open_input_file probe loop to its own method

Michael Niedermayer michaelni
Wed Mar 24 01:22:57 CET 2010


On Tue, Mar 23, 2010 at 06:43:15PM -0400, Micah F. Galizia wrote:
> On 10-03-23 10:57 AM, Michael Niedermayer wrote:
>> On Mon, Mar 22, 2010 at 08:41:44PM -0400, Micah F. Galizia wrote:
>>> On 10-03-21 01:04 PM, Michael Niedermayer wrote:
>>>> On Sat, Mar 20, 2010 at 05:14:40PM -0400, Micah F. Galizia wrote:
>>>> [..]
>>>>> Sorry,the last one has a memory leak -- probe_buffer9.diff corrects it.
>>>>>
>>>>> --
>>>>> Micah F. Galizia
>>>>> micahgalizia at gmail.com
>>>>>
>>>>> "The mark of an immature man is that he wants to die nobly for a cause,
>>>>> while the mark of the mature man is that he wants to live humbly for
>>>>> one."
>>>>>    --W. Stekel
>>>>
>>>>>    utils.c |    8 ++++++--
>>>>>    1 file changed, 6 insertions(+), 2 deletions(-)
>>>>> e3511efa72382199d1a4855b4a761ad0964c0ead  probe_buffer9.diff
>>>>
>>>>> Index: libavformat/utils.c
>>>>> ===================================================================
>>>>> --- libavformat/utils.c	(revision 22608)
>>>>> +++ libavformat/utils.c	(working copy)
>>>>> @@ -478,7 +478,8 @@
>>>>>            return AVERROR(EINVAL);
>>>>>        }
>>>>>
>>>>> -    for(probe_size= PROBE_BUF_MIN; probe_size<=max_probe_size&&   
>>>>> !*fmt&&
>>>>>   ret>= 0; probe_size<<=1){
>>>>> +    for(probe_size= PROBE_BUF_MIN; probe_size<=max_probe_size&&   
>>>>> !*fmt&&
>>>>>   ret>= 0;
>>>>> +        probe_size = FFMIN(probe_size<<1, max_probe_size)){
>>>>
>>>> hmm, this doesnt behave reasonable at all, the check is never false and
>>>> theres lots of dead code after the loop and you duplicate this inside 
>>>> the
>>>> loop
>>>> incorrectly without a goto fail where a break should do i think
>>>
>>> I'm not sure I understand all of what your saying or agree that the code 
>>> is
>>> dead. Also, I dont see why a using a goto and adding a fail label is
>>> preferred to returning an error, which will do the same job (with less 
>>> code
>>> in this case).
>>
>> i possibly was looking at an outdated piece of code from my local tree
>> which made my comment partial nonsense
>>
>> the error code though is wrong as stefano said
>
> Corrected in version 11.
>
> Thanks again!
> -- 
> Micah F. Galizia
> micahgalizia at gmail.com
>
> "The mark of an immature man is that he wants to die nobly for a cause, 
> while the mark of the mature man is that he wants to live humbly for one."  
>  --W. Stekel

>  utils.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 57036f1186a35d5d3cf57cef7ce695f8f896cb5b  probe_buffer11.diff

should be ok if tested

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100324/cb5ed462/attachment.pgp>



More information about the ffmpeg-devel mailing list