[FFmpeg-devel] [PATCH 1/2] swr: move dst_size == 0 handling outside DSP function.

Ronald S. Bultje rsbultje at gmail.com
Sat Jun 28 14:00:05 CEST 2014


---
 libswresample/resample.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 81dec7d..ffb03f0 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -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;
         }
     }
 
-- 
1.8.5.5



More information about the ffmpeg-devel mailing list