mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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:
parent
d03be26e37
commit
c25fdfc683
16
libav/tick.h
16
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user