diff options
author | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-06-17 03:08:29 +0000 |
---|---|---|
committer | Philip Gladstone <philipjsg@users.sourceforge.net> | 2002-06-17 03:08:29 +0000 |
commit | c25fdfc683ce539e317b113909ae5f2493867d86 (patch) | |
tree | 6c82fbd6e0e6bbacb5e4e663359632da693cb402 | |
parent | d03be26e37e943a1e7bae2ebc8378fccc496dc78 (diff) | |
download | ffmpeg-c25fdfc683ce539e317b113909ae5f2493867d86.tar.gz |
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
-rw-r--r-- | libav/tick.h | 16 |
1 files changed, 16 insertions, 0 deletions
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; +} |