OSDN Git Service

swresample/resample: do not rebuild filter when sample_delta is zero
authorMuhammad Faiz <mfcc64@gmail.com>
Fri, 2 Dec 2016 20:05:49 +0000 (03:05 +0700)
committerMuhammad Faiz <mfcc64@gmail.com>
Sat, 3 Dec 2016 18:32:26 +0000 (01:32 +0700)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
libswresample/resample.c

index e65a57a..71dffb9 100644 (file)
@@ -449,7 +449,7 @@ static int rebuild_filter_bank_with_compensation(ResampleContext *c)
 static int set_compensation(ResampleContext *c, int sample_delta, int compensation_distance){
     int ret;
 
-    if (compensation_distance) {
+    if (compensation_distance && sample_delta) {
         ret = rebuild_filter_bank_with_compensation(c);
         if (ret < 0)
             return ret;