diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2014-06-28 08:00:05 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-28 15:30:01 +0200 |
commit | ddb7b4435a84bcc53018eb802fec675f75d242c7 (patch) | |
tree | dcdaaab15eba50ba75240edcba54dd797fbb3060 /libswresample | |
parent | cc923727226b2e99500efca778883d5fb813d348 (diff) | |
download | ffmpeg-ddb7b4435a84bcc53018eb802fec675f75d242c7.tar.gz |
swr: move dst_size == 0 handling outside DSP function.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r-- | libswresample/resample.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c index 81dec7df69..ffb03f034e 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; } } |