[FFmpeg-cvslog] r17841 - in trunk/libavformat: timefilter.c timefilter.h

michael subversion
Fri Mar 6 01:14:47 CET 2009


Author: michael
Date: Fri Mar  6 01:14:44 2009
New Revision: 17841

Log:
Merge ff_timefilter_read() and ff_timefilter_update(), this simplifies API and
avoids calling them in the wrong order.

Modified:
   trunk/libavformat/timefilter.c
   trunk/libavformat/timefilter.h

Modified: trunk/libavformat/timefilter.c
==============================================================================
--- trunk/libavformat/timefilter.c	Fri Mar  6 01:09:14 2009	(r17840)
+++ trunk/libavformat/timefilter.c	Fri Mar  6 01:14:44 2009	(r17841)
@@ -53,7 +53,7 @@ void ff_timefilter_reset(TimeFilter *sel
     self->cycle_time = 0;
 }
 
-void ff_timefilter_update(TimeFilter *self, double system_time, double period)
+double ff_timefilter_update(TimeFilter *self, double system_time, double period)
 {
     if (!self->cycle_time) {
         /// init loop
@@ -68,9 +68,5 @@ void ff_timefilter_update(TimeFilter *se
         self->cycle_time        += self->feedback2_factor * loop_error;
         self->integrator2_state += self->feedback3_factor * loop_error / period;
     }
-}
-
-double ff_timefilter_read(TimeFilter *self)
-{
     return self->cycle_time;
 }

Modified: trunk/libavformat/timefilter.h
==============================================================================
--- trunk/libavformat/timefilter.h	Fri Mar  6 01:09:14 2009	(r17840)
+++ trunk/libavformat/timefilter.h	Fri Mar  6 01:14:44 2009	(r17841)
@@ -68,22 +68,10 @@ TimeFilter * ff_timefilter_new(double fe
  * at (or as close as possible to) the moment the device hardware interrupt
  * occured (or any other event the device clock raises at the beginning of a
  * cycle).
- */
-void ff_timefilter_update(TimeFilter *self, double system_time, double period);
-
-/**
- * Retrieve the filtered time
- *
- * The returned value represents the filtered time, in seconds, of the
- * beginning of the current cycle as updated by the last call to
- * ff_timefilter_update()
- *
- * This is the value that should be used for timestamping.
  *
- * Warning: you must call ff_timefilter_update() before this, otherwise the
- * result is undetermined.
+ * @return the filtered time, in seconds
  */
-double ff_timefilter_read(TimeFilter *);
+double ff_timefilter_update(TimeFilter *self, double system_time, double period);
 
 /**
  * Reset the filter




More information about the ffmpeg-cvslog mailing list