summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-11 15:42:43 +0100
committerwm4 <wm4@nowhere>2015-02-11 16:32:40 +0100
commitd85aa35ffbd978c7ae86bf84ebf9ac7686312e8f (patch)
treef61619e8ff9db7610e3d8a21e5cb761e3e5de0d1 /audio/filter
parent8c055f873f9ec66842c08e157a943ce2c5301f55 (diff)
downloadmpv-d85aa35ffbd978c7ae86bf84ebf9ac7686312e8f.tar.bz2
mpv-d85aa35ffbd978c7ae86bf84ebf9ac7686312e8f.tar.xz
af: account for queued frames in audio position calculation
af_rubberband exposed this issue.
Diffstat (limited to 'audio/filter')
-rw-r--r--audio/filter/af.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index bde469db8b..846ebea3c3 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -747,6 +747,8 @@ double af_calc_delay(struct af_stream *s)
double delay = 0.0;
while (af) {
delay += af->delay;
+ for (int n = 0; n < af->num_out_queued; n++)
+ delay += af->out_queued[n]->samples / (double)af->data->rate;
af = af->next;
}
return delay;