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

Micah F. Galizia micahgalizia
Tue Mar 9 02:29:40 CET 2010


On 10-03-07 07:42 PM, M?ns Rullg?rd wrote:
> Stefano Sabatini<stefano.sabatini-lala at poste.it>  writes:
>
>> On date Sunday 2010-03-07 12:48:45 -0500, MIcah Galizia encoded:
>>> On 10-03-07 05:52 AM, Stefano Sabatini wrote:
>>>> On date Saturday 2010-03-06 19:02:07 -0500, Micah F. Galizia encoded:
>>>>> On 10-03-06 06:17 PM, Michael Niedermayer wrote:
>> [...]
>>>>>> should be ok if tested
>>>>>
>>>>> I tested it in plain old ffmpeg, and with my shoutcast changes.
>>>>
>>>> Please test with make test, I tried it and it failed in
>>>> regtest-pbmpipe.
>>>>
>>>> cat pbmpipe.lavf.err
>>>> /home/stefano/src/ffmpeg.git/./tests/data/lavf/pbmpipe.pbm: Error while opening file
>>>
>>> Thank you.  The attached patch fixes it.  The problem was that after
>>> the initial probe in av_open_input_file (with no actual probe data),
>>> I was setting the input format to NULL in ff_probe_input_buffer.
>>> Now all regression tests pass (make test).
>>>
>>> Also, I have improved the commenting in internal.h.
>>>
>>> Thanks again!
>>
>> Patch applied, thanks for the fish.
>
> This broke ea-cdata on FATE.

Actually, it would have broken on any probe score lower than 25 for a 
file smaller than 1MB.  The problem was that the old probe loop would 
reset the file position each time before calling get_buffer. As a 
result, get_buffer would never return AVERROR_EOF, so this wasn't ever a 
situation that needed to be handled.

The modified probe just reads on from where it left off in the previous 
probe, so eventually, the end of file is reached before reaching 
PROBE_BUF_MAX, so it would just return an error.  It has been updated 
now to lower the required probe score when the end of file is reached in 
addition to when PROBE_BUF_MAX is reached.

Thanks again, and sorry for breaking FATE!
-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: probe_buffer5.diff
Type: text/x-diff
Size: 5674 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100308/2de2755e/attachment.diff>



More information about the ffmpeg-devel mailing list