summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-11 15:42:43 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-12 09:53:27 +0900
commitabf1fc9a77d6d33132ffd046dcca13e14629740f (patch)
tree85e36f96adb28509ffb4ebd5355bff3989c5872b
parentda8e573b456ccd8aedce910d72afe935bb00a321 (diff)
downloadmpv-abf1fc9a77d6d33132ffd046dcca13e14629740f.tar.bz2
mpv-abf1fc9a77d6d33132ffd046dcca13e14629740f.tar.xz
af: account for queued frames in audio position calculation
af_rubberband exposed this issue. (cherry picked from commit d85aa35ffbd978c7ae86bf84ebf9ac7686312e8f)
-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 dc534efa5b..32e49002f0 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -743,6 +743,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;