mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
af_lavrresample: use a new libswresample function if available
It was recently added to libswresample, and it does exactly what we need.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user