[FFmpeg-cvslog] timefilter: allow to evaluate at other times.
Nicolas George
git at videolan.org
Wed Apr 4 15:23:30 CEST 2012
ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sun Mar 4 12:17:02 2012 +0100| [8a9ae37feef5b09332222045a3d9ad948cdcc445] | committer: Nicolas George
timefilter: allow to evaluate at other times.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a9ae37feef5b09332222045a3d9ad948cdcc445
---
libavdevice/timefilter.c | 5 +++++
libavdevice/timefilter.h | 9 +++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c
index 8451466..a423fc0 100644
--- a/libavdevice/timefilter.c
+++ b/libavdevice/timefilter.c
@@ -83,6 +83,11 @@ double ff_timefilter_update(TimeFilter *self, double system_time, double period)
return self->cycle_time;
}
+double ff_timefilter_eval(TimeFilter *self, double delta)
+{
+ return self->cycle_time + self->clock_period * delta;
+}
+
#ifdef TEST
#include "libavutil/lfg.h"
#define LFG_MAX ((1LL << 32) - 1)
diff --git a/libavdevice/timefilter.h b/libavdevice/timefilter.h
index 33862f6..6662959 100644
--- a/libavdevice/timefilter.h
+++ b/libavdevice/timefilter.h
@@ -82,6 +82,15 @@ TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, dou
double ff_timefilter_update(TimeFilter *self, double system_time, double period);
/**
+ * Evaluate the filter at a specified time
+ *
+ * @param delta difference between the requested time and the current time
+ * (last call to ff_timefilter_update).
+ * @return the filtered time
+ */
+double ff_timefilter_eval(TimeFilter *self, double delta);
+
+/**
* Reset the filter
*
* This function should mainly be called in case of XRUN.
More information about the ffmpeg-cvslog
mailing list