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

Michael Niedermayer michaelni at gmx.at
Sat Aug 6 20:26:01 CEST 2011


On Sat, Aug 06, 2011 at 01:29:18PM +0200, Stefano Sabatini wrote:
> 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 };
> ?

what would you do when the input to the filter chain uses a timebase
that has units that arent representable in the sample rate ?
mpeg-ps / ts are examples with their 90khz timebase

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/20110806/597c59dc/attachment.asc>


More information about the ffmpeg-devel mailing list