diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2014-06-13 19:06:30 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-14 14:36:18 +0200 |
commit | b785c62681a0a5a330b065e0754d27a313c44c8e (patch) | |
tree | 9fcafa9a2ff0fe1fa6f834c76019256b52058991 /libswresample/swresample.c | |
parent | d77815eeaac309742818f53be6cd2f4c6fa76cf1 (diff) | |
download | ffmpeg-b785c62681a0a5a330b065e0754d27a313c44c8e.tar.gz |
swr: handle initial negative sample index outside DSP function.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/swresample.c')
-rw-r--r-- | libswresample/swresample.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 7076650106..2d063cd2ce 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -541,6 +541,12 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count, tmp=out=*out_param; in = *in_param; + border = s->resampler->invert_initial_buffer(s->resample, &s->in_buffer, + &in, in_count, &s->in_buffer_index, &s->in_buffer_count); + if (border == INT_MAX) return 0; + else if (border < 0) return border; + else if (border) { buf_set(&in, &in, border); in_count -= border; s->resample_in_constraint = 0; } + do{ int ret, size, consumed; if(!s->resample_in_constraint && s->in_buffer_count){ |