Commit 24e26e3f authored by philipjsg's avatar philipjsg

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@692 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 41772bb1
...@@ -39,3 +39,19 @@ static inline int ticker_tick(Ticker *tick, int num) ...@@ -39,3 +39,19 @@ static inline int ticker_tick(Ticker *tick, int num)
#endif #endif
return n; 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