diff options
author | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-01 06:52:50 +0000 |
---|---|---|
committer | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-01 06:52:50 +0000 |
commit | d7f6cb23dec483f538239eb42e21c321713c976e (patch) | |
tree | a5a87950b4cdae8d0b4e9a6df202000fd4825615 /libaf/af_resample.c | |
parent | de034ce87fdf632b48563e5764f19d66120550a8 (diff) | |
download | mpv-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_resample.c')
-rw-r--r-- | libaf/af_resample.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libaf/af_resample.c b/libaf/af_resample.c index e1bed4976b..57e2d39321 100644 --- a/libaf/af_resample.c +++ b/libaf/af_resample.c @@ -254,7 +254,7 @@ static int control(struct af_instance_s* af, int cmd, void* arg) } // Set multiplier and delay - af->delay = (double)(1000*L/2)/((double)n->rate); + af->delay = 0; // not set correctly, but shouldn't be too large anyway af->mul = (double)s->up / s->dn; return rv; } |