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

Martin Storsjö martin
Fri May 8 11:58:16 CEST 2009

On Fri, 8 May 2009, Vitor Sessak wrote:

> > 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.

I guess that's true in principle, but what if request_frame() still is 
called (for some unknown reason, haven't checked through the rest of the 
framework to see if there's something stopping this from happening) after 
the first call which returned EOF?

I'd say this is a small cost for extra robustness in the individual filter 
(if the checks are removed and request_frame() is called multiple times, 
it would start leaking memory and invalidating assertions in start_frame() 
and whatnot), but if you still think it is unnecessary, I'll remove it.

// Martin

More information about the ffmpeg-devel mailing list