From 935997d4d68d7dc142a1b5c492be64a8e87b4763 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 4 Jun 2015 19:22:45 +0200 Subject: af_lavrresample: use a new libswresample function if available It was recently added to libswresample, and it does exactly what we need. --- audio/filter/af_lavrresample.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'audio/filter/af_lavrresample.c') diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c index f5c0e33fe9..fec3927671 100644 --- a/audio/filter/af_lavrresample.c +++ b/audio/filter/af_lavrresample.c @@ -114,8 +114,12 @@ static void drop_all_output(struct af_resample *s) } static int get_out_samples(struct af_resample *s, int in_samples) { +#if LIBSWRESAMPLE_VERSION_MAJOR > 1 || LIBSWRESAMPLE_VERSION_MINOR >= 2 + return swr_get_out_samples(s->avrctx, in_samples); +#else 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 } #endif -- cgit v1.2.3