[FFmpeg-devel] [PATCH] AV_TIME_BASE and av_gettime()
Sat Nov 22 22:36:29 CET 2008
On Sat, Nov 22, 2008 at 07:17:00PM +0100, Stefano Sabatini wrote:
> On date Saturday 2008-11-22 13:03:08 +0000, Luca Abeni encoded:
> > Hi,
> > Stefano Sabatini wrote:
> > > On date Friday 2008-11-21 08:53:27 +0100, Luca Abeni encoded:
> > > [...]
> > >> This looks good, and is a nice improvement respect to the current state
> > >> of things...
> > >> Just one comment: I think you are assuming AV_TIME_BASE == 1000000 (since
> > >> you are comparing next_pts with the result of av_gettime()). This is the
> > >> case now, but in the future the AV_TIME_BASE value can change (I know this
> > >> is a problem, because I did the same mistake in the past, and I've been
> > >> asked to fix it :)
> > >> I am not ffmpeg.c maintainer (so, I think Michael's approval is needed),
> > >> but I think the patch should be applied (after fixing the
> > >> AV_TIME_BASE -> microseconds conversion).
> > >
> > > Check the patch attached.
> > Sorry, I probably described the problem in a confusing way... What I
> > wanted to say is that you should do something like
> > int64_t pts = av_rescale(ist->next_pts, 1000000, AV_TIME_BASE);
> > instead of
> > nt64_t pts = ist->next_pts;
> > I do not think that defining a new av_gettime2() function just for this
> > purpose is a good idea.
> Mmh... yes I agree.
> Check the patch, I also changed the name pts -> next, I think it's
> less prone to confusion since "pts" may be confused with the meaning
> of pts in ist->next_pts (which uses another time unit).
so the patch contains 3 unrelated changes now ...
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel