summaryrefslogtreecommitdiff
path: root/libavdevice/timefilter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-08 13:11:11 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-08 13:11:11 +0200
commit43c157f4a46cb76739f07782d23d1e4ff8da3253 (patch)
treef74dfcbb6a16498524fa2185ac3160cd224b5c04 /libavdevice/timefilter.c
parentd7a473926504e2acfa6ae3bead0938e1f4e03441 (diff)
parent7b556be6735371d1040c7076547b8198d9fadd34 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: af_resample: avoid conversion of identical sample formats for 1 channel avcodec: allow either planar or interleaved sample format when encoding mono adpcmenc: ensure calls to adpcm_ima_compress_sample() are in the right order timefilter: De-doxygenize normal code comments and drop silly ones gxf: Include the right header for the avpriv_frame_rate_tab declaration Conflicts: libavcodec/adpcmenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/timefilter.c')
-rw-r--r--libavdevice/timefilter.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavdevice/timefilter.c b/libavdevice/timefilter.c
index 330f26e367..343f1b1c44 100644
--- a/libavdevice/timefilter.c
+++ b/libavdevice/timefilter.c
@@ -28,8 +28,8 @@
#include "timefilter.h"
struct TimeFilter {
- /// Delay Locked Loop data. These variables refer to mathematical
- /// concepts described in: http://www.kokkinizita.net/papers/usingdll.pdf
+ // Delay Locked Loop data. These variables refer to mathematical
+ // concepts described in: http://www.kokkinizita.net/papers/usingdll.pdf
double cycle_time;
double feedback2_factor;
double feedback3_factor;
@@ -69,15 +69,12 @@ double ff_timefilter_update(TimeFilter *self, double system_time, double period)
{
self->count++;
if (self->count == 1) {
- /// init loop
self->cycle_time = system_time;
} else {
double loop_error;
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->clock_period += self->feedback3_factor * loop_error;
}