diff options
author | wm4 <wm4@nowhere> | 2015-06-04 19:22:45 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-04 19:22:45 +0200 |
commit | 935997d4d68d7dc142a1b5c492be64a8e87b4763 (patch) | |
tree | c4c3c068584530d149b72e2c155bd3004a8f3f00 /audio | |
parent | 2dc46423d6c794b0b840f939afdc3e3cd5125480 (diff) |
af_lavrresample: use a new libswresample function if available
It was recently added to libswresample, and it does exactly what we
need.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_lavrresample.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 |