diff options
-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 |