[FFmpeg-devel] [PATCH] Move link_dpad and link_spad macros from avfilter.c to internal.h, so

Michael Niedermayer michaelni
Mon Sep 27 13:43:08 CEST 2010


On Mon, Sep 27, 2010 at 03:19:00AM +0200, Stefano Sabatini wrote:
> On date Monday 2010-09-27 02:12:03 +0200, Michael Niedermayer encoded:
> > On Mon, Sep 27, 2010 at 01:49:35AM +0200, Stefano Sabatini wrote:
> [...]
> > > I guess the main reason of the current design is to simplify the
> > > operation of filter auto-insertion, check avfilter_insert_filter().
> > > 
> > > Allowing the filter to know the input and output index pads (rather
> > > than the corresponding pointers) is convenient, e.g. it allows to
> > > directly do:
> > > 
> > > src->outputs[link->srcpad] = new_lnk;
> > > new_lnk->srcpad = link->srcpad;
> > > 
> > > rather than having to iterate through all the src->outputs in
> > > order to find the one which is equal to the pointer pointed by
> > > link->srcpad.
> > > 
> > > for (padidx = 0; i < src->output_count; padidx++)
> > >     if (src->output_pads[padidx] == link->srcpad) {
> > >         link->srcpad = NULL;
> > >         src->outputs[padidx] = new_lnk;
> > >         new_lnk->srcpad = src->output_pads[padidx];    
> > >         break;
> > >     }
> > 
> >  index == pointer - src->output_pads
> 
> Updated.
[..]
> @@ -128,20 +124,22 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
>  int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
>                             unsigned in, unsigned out)
>  {
> +    int dstpad_idx = link->dstpad - link->dst->input_pads;

its off topic but i like that name the existing ones should be renamed for
consistency and readability as well

and patch ok

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100927/b1559bca/attachment.pgp>



More information about the ffmpeg-devel mailing list