summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-04 19:08:40 +0200
committerwm4 <wm4@nowhere>2015-06-04 19:08:40 +0200
commit2dc46423d6c794b0b840f939afdc3e3cd5125480 (patch)
tree2db174251a772735850be7cf2d26a69ae1773d7e /audio/filter
parentc277c17a930f2df025722405f6c10d4df4f23c99 (diff)
downloadmpv-2dc46423d6c794b0b840f939afdc3e3cd5125480.tar.bz2
mpv-2dc46423d6c794b0b840f939afdc3e3cd5125480.tar.xz
af_lavrresample: change output samples calculation
This is better, because now we call swr_get_delay() with the output samplerate, instead of with the input samplerate and then multiplying it with the ratio and rounding it up.
Diffstat (limited to 'audio/filter')
-rw-r--r--audio/filter/af_lavrresample.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
index 64c3d06acd..f5c0e33fe9 100644
--- a/audio/filter/af_lavrresample.c
+++ b/audio/filter/af_lavrresample.c
@@ -114,8 +114,8 @@ static void drop_all_output(struct af_resample *s)
}
static int get_out_samples(struct af_resample *s, int in_samples)
{
- return av_rescale_rnd(get_delay(s) + in_samples,
- s->ctx.out_rate, s->ctx.in_rate, AV_ROUND_UP);
+ return av_rescale_rnd(in_samples, s->ctx.out_rate, s->ctx.in_rate, AV_ROUND_UP)
+ + swr_get_delay(s->avrctx, s->ctx.out_rate);
}
#endif