From c25fdfc683ce539e317b113909ae5f2493867d86 Mon Sep 17 00:00:00 2001 From: Philip Gladstone Date: Mon, 17 Jun 2002 03:08:29 +0000 Subject: Add ticker_abs function that returns the number of ticks to get the supplied frame (or sample) number. This is not the same as ticker_tick Originally committed as revision 692 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libav/tick.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libav') diff --git a/libav/tick.h b/libav/tick.h index 8a8e42b818..e2d747e336 100644 --- a/libav/tick.h +++ b/libav/tick.h @@ -39,3 +39,19 @@ static inline int ticker_tick(Ticker *tick, int num) #endif return n; } + +static inline INT64 ticker_abs(Ticker *tick, int num) +{ + INT64 n = (INT64) num * tick->div; + INT64 value = (INT64) num * tick->mod; + + if (value > 0) { + n += (value / tick->inrate); + value = value % tick->inrate; + if (value > 0) { + /* value -= tick->inrate; */ + n++; + } + } + return n; +} -- cgit v1.2.3