Commit c25fdfc6 authored by Philip Gladstone's avatar Philip Gladstone

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
parent d03be26e
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment