[FFmpeg-devel] [PATCH] AV_TIME_BASE and av_gettime()

Luca Abeni lucabe72
Sat Nov 22 14:03:08 CET 2008


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.



				Luca




More information about the ffmpeg-devel mailing list