[FFmpeg-devel] [PATCH 3/3] lavfi: fix doxygen doc for AVFilterLink.time_base

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Aug 6 13:29:18 CEST 2011


On date Thursday 2011-08-04 19:44:22 +0200, Michael Niedermayer encoded:
> On Thu, Aug 04, 2011 at 06:54:07PM +0200, Stefano Sabatini wrote:
> > On date Thursday 2011-08-04 15:47:02 +0300, Mina Nagy Zaki encoded:
> > > time_base is only applicable to video as the timebase for audio
> > > is defined as 1/sample_rate
> > > ---
> > >  libavfilter/avfilter.h |    5 +++--
> > >  1 files changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> > > index 9e7a4cd..bf2d2b5 100644
> > > --- a/libavfilter/avfilter.h
> > > +++ b/libavfilter/avfilter.h
> > > @@ -646,11 +646,12 @@ struct AVFilterLink {
> > >      AVFilterBufferRef *out_buf;
> > >  
> > >      /**
> > > -     * Define the time base used by the PTS of the frames/samples
> > > -     * which will pass through this link.
> > > +     * Define the time base used by the PTS of the frames which
> > > +     * will pass through this link.
> > >       * During the configuration stage, each filter is supposed to
> > >       * change only the output timebase, while the timebase of the
> > >       * input link is assumed to be an unchangeable property.
> > > +     * This is applicable only to video links.
> > >       */
> > >      AVRational time_base;
> > 
> > Looks sane to me. I discussed this with Mina, and we came to the
> > conclusion that the timebase information for audio frames is carried
> > out by the samplerate set in the link, so you have:
> > 
> > time = pts * 1/samplerate
> > 
> > and thus time_base looks just redundant.
> > 
> > Please comment on this (Michael?), I'll apply in a few days if I see
> > no comments.
> 
> for common code it would be easier if timebase is valid for non video
> types

What about removing sample_rate from link, and use time_base instead:
   if (audio)
       time_base = (AVRational) { 1, sample_rate };
?
-- 
FFmpeg = Foolish and Free Martial Puritan Ecumenical Generator


More information about the ffmpeg-devel mailing list