aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/timefilter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-03-06 00:47:16 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-03-06 00:47:16 +0000
commit2e51dedd24203ef1631d1dfcc68543e8f693a80b (patch)
tree81a959bc8e0f35a0ff1f95b1fc0b250ebeb9ec69 /libavformat/timefilter.c
parent32284910277308ea3236edf5bf523cffc857cb12 (diff)
downloadffmpeg-2e51dedd24203ef1631d1dfcc68543e8f693a80b.tar.gz
Better name for integrator2_state.
Originally committed as revision 17846 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/timefilter.c')
-rw-r--r--libavformat/timefilter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/timefilter.c b/libavformat/timefilter.c
index 6873ad7b55..3657222acd 100644
--- a/libavformat/timefilter.c
+++ b/libavformat/timefilter.c
@@ -31,14 +31,14 @@ struct TimeFilter {
double cycle_time;
double feedback2_factor;
double feedback3_factor;
- double integrator2_state;
+ double clock_period;
int count;
};
TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, double feedback3_factor)
{
TimeFilter *self = av_mallocz(sizeof(TimeFilter));
- self->integrator2_state = clock_period;
+ self->clock_period = clock_period;
self->feedback2_factor = feedback2_factor;
self->feedback3_factor = feedback3_factor;
return self;
@@ -62,13 +62,13 @@ double ff_timefilter_update(TimeFilter *self, double system_time, double period)
self->cycle_time = system_time;
} else {
double loop_error;
- self->cycle_time+= self->integrator2_state * period;
+ self->cycle_time += self->clock_period * period;
/// calculate loop error
loop_error = system_time - self->cycle_time;
/// update loop
self->cycle_time += FFMAX(self->feedback2_factor, 1.0/(self->count)) * loop_error;
- self->integrator2_state += self->feedback3_factor * loop_error / period;
+ self->clock_period += self->feedback3_factor * loop_error / period;
}
return self->cycle_time;
}