[FFmpeg-devel] [PATCH] libavfilter-soc: Make overlay handle still images

Vitor Sessak vitor1001
Fri May 8 11:47:36 CEST 2009


Martin Storsj? wrote:
> On Fri, 8 May 2009, Vitor Sessak wrote:
> 
>> I like it.
> 
> Great!
> 
>>> +    if (!over->pics[0][0] || !over->pics[1][0]) {
>>> +        /* The first time through, pull a frame from each input */
>>> +        if (!over->pics[0][0] &&
>>> avfilter_request_frame(link->src->inputs[0]))
>>                ^^^^^^^^^^^^^^^^
>>> +            return AVERROR_EOF;
>>> +        if (!over->pics[1][0] &&
>>> avfilter_request_frame(link->src->inputs[1]))
>>                ^^^^^^^^^^^^^^^^
>>> +            return AVERROR_EOF;
>> Those checks are useless (you can assert(!over->pics[0][0] &&
>> !over->pics[1][0]) after the if() if you wanted to double-check).
> 
> Actually, there's a use for them. Imagine that there's a frame available 
> in input 0, but none at all in input 1. 

Is there any way the if (!over->pics[0][0] || !over->pics[1][0]) can be 
triggered other than in the first time request_frame() is called? If no, 
"!over->pics[1][0]" and "!over->pics[0][0]" are always true. Note that 
if one of the inputs each EOF, it will stay at EOF. Note also that the 
poll_frame mechanism guarantees that there is either an available frame 
or EOF for each input.

-Vitor



More information about the ffmpeg-devel mailing list