summaryrefslogtreecommitdiffstats
path: root/libaf/af_equalizer.c
diff options
context:
space:
mode:
authoruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:50 +0000
committeruau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-01 06:52:50 +0000
commitd7f6cb23dec483f538239eb42e21c321713c976e (patch)
treea5a87950b4cdae8d0b4e9a6df202000fd4825615 /libaf/af_equalizer.c
parentde034ce87fdf632b48563e5764f19d66120550a8 (diff)
downloadmpv-d7f6cb23dec483f538239eb42e21c321713c976e.tar.bz2
mpv-d7f6cb23dec483f538239eb42e21c321713c976e.tar.xz
A/V sync: take audio filter buffers into account
Substract the delay caused by filter buffering when calculating currently playing audio position. This matters for af_scaletempo which buffers significant and varying amounts of data. For other current filters the effect is normally insignificant. Instead of the old time-based filter delay field (which was ignored) this version stores the per-filter delay in units of bytes input read without corresponding output. This allows the current scaletempo behavior where other filters before and after it can see the same nominal samplerate even though the real duration of the data varies; in this case the other filters can not know the delay they're causing in terms of real time. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24928 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af_equalizer.c')
-rw-r--r--libaf/af_equalizer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libaf/af_equalizer.c b/libaf/af_equalizer.c
index 9eb09a8188..5a92090d32 100644
--- a/libaf/af_equalizer.c
+++ b/libaf/af_equalizer.c
@@ -106,7 +106,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg)
bp2(s->a[k],s->b[k],F[k]/((float)af->data->rate),Q);
// Calculate how much this plugin adds to the overall time delay
- af->delay += 2000.0/((float)af->data->rate);
+ af->delay = 2 * af->data->nch * af->data->bps;
// Calculate gain factor to prevent clipping at output
for(k=0;k<AF_NCH;k++)