Fix bug with time==0 being special.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Mar 2009 00:23:52 +0000 (00:23 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Mar 2009 00:23:52 +0000 (00:23 +0000)
Originally committed as revision 17843 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/timefilter.c

index 7109a0a..56d2605 100644 (file)
@@ -51,14 +51,13 @@ void ff_timefilter_destroy(TimeFilter *self)
 
 void ff_timefilter_reset(TimeFilter *self)
 {
-    self->cycle_time = 0;
     self->count      = 0;
 }
 
 double ff_timefilter_update(TimeFilter *self, double system_time, double period)
 {
     self->count++;
-    if (!self->cycle_time) {
+    if (self->count==1) {
         /// init loop
         self->cycle_time        = system_time;
     } else {