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

Stefano Sabatini stefano.sabatini-lala
Mon Sep 27 19:31:13 CEST 2010


On date Monday 2010-09-27 13:43:08 +0200, Michael Niedermayer encoded:
> 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

Check in attachment.
 
> and patch ok

Applied.
-- 
FFmpeg = Fabulous Friendly Multimedia Pacific Egregious Geisha



More information about the ffmpeg-devel mailing list