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
This commit is contained in:
Philip Gladstone 2002-06-17 03:08:29 +00:00
parent d03be26e37
commit c25fdfc683
1 changed files with 16 additions and 0 deletions

View File

@ -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;
}