From 30b2611ed3102c53a8aa96c71acf5dadb69997c8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Aug 2016 11:52:11 +0200 Subject: swresample: Skip over dither steps if dithering scale is 0 Signed-off-by: Michael Niedermayer --- libswresample/dither.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libswresample/dither.c') diff --git a/libswresample/dither.c b/libswresample/dither.c index 76f8ccf2c6..64068d35b6 100644 --- a/libswresample/dither.c +++ b/libswresample/dither.c @@ -102,6 +102,11 @@ av_cold int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AV if (out_fmt == AV_SAMPLE_FMT_S32 && s->dither.output_sample_bits) scale *= 1<<(32-s->dither.output_sample_bits); + if (scale == 0) { + s->dither.method = 0; + return 0; + } + s->dither.ns_pos = 0; s->dither.noise_scale= scale; s->dither.ns_scale = scale; -- cgit v1.2.3