OSDN Git Service

Add ticker_abs function that returns the number of ticks to get the
authorPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 17 Jun 2002 03:08:29 +0000 (03:08 +0000)
committerPhilip Gladstone <philipjsg@users.sourceforge.net>
Mon, 17 Jun 2002 03:08:29 +0000 (03:08 +0000)
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

libav/tick.h

index 8a8e42b..e2d747e 100644 (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;
+}