]> git.sesse.net Git - ffmpeg/commitdiff
swr: move dst_size == 0 handling outside DSP function.
authorRonald S. Bultje <rsbultje@gmail.com>
Sat, 28 Jun 2014 12:00:05 +0000 (08:00 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Jun 2014 13:30:01 +0000 (15:30 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/resample.c

index 81dec7df69aa340b0b7fd835918cf420edc675dc..ffb03f034e2f98548d7f981ac01b016db7bd2370 100644 (file)
@@ -297,10 +297,14 @@ static int swri_resample(ResampleContext *c,
         int delta_n = (delta_frac + c->dst_incr - 1) / c->dst_incr;
 
         dst_size = FFMIN(dst_size, delta_n);
-        if (!c->linear) {
-            *consumed = c->dsp.resample_common[fn_idx](c, dst, src, dst_size, update_ctx);
+        if (dst_size > 0) {
+            if (!c->linear) {
+                *consumed = c->dsp.resample_common[fn_idx](c, dst, src, dst_size, update_ctx);
+            } else {
+                *consumed = c->dsp.resample_linear[fn_idx](c, dst, src, dst_size, update_ctx);
+            }
         } else {
-            *consumed = c->dsp.resample_linear[fn_idx](c, dst, src, dst_size, update_ctx);
+            *consumed = 0;
         }
     }