[FFmpeg-devel] [PATCH 1/4] lavfi: add flush callback.

Michael Niedermayer michaelni at gmx.at
Fri Jun 29 17:56:12 CEST 2012


On Fri, Jun 29, 2012 at 05:05:20PM +0200, Nicolas George wrote:
> Le duodi 12 messidor, an CCXX, Michael Niedermayer a écrit :
> > a filters request_frame() gets called be the next filter.
> > in case the next filter is a sink that sink can call a static
> > flush function
> > 
> > ret = request_frame()
> > if(ret == EOF)
> >     flush()
> > 
> > This should be alot simpler and require no API changes
> 
> I am afraid you are missing part of the problem: how does that piece of code
> above get reached? With buffersink, this is done by calling
> av_buffersink_get_buffer_ref() or one of its derivatives. But not all sinks
> are buffersinks, and not all sinks are known by the application. I believe
> it is a design goal to be able to write "ffmpeg -filter_complex XXX" and
> have some sinks in XXX, such a statistics gathering sinks.
> 
> Unfortunately, there is currently no way for EOF to reach those sinks.
> 
> That is the problem I am trying to address with this patch. There are other
> solutions, I thought of some of them (I can expose them if people want), and
> this one was the one I found had the best API change vs elegance compromise.

Hmm, i see the problem, iam not sure i like the solution ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120629/e742661a/attachment.asc>


More information about the ffmpeg-devel mailing list