Commit 7e592379 authored by Michael Niedermayer's avatar Michael Niedermayer

resample: Fix boundary handling with fragments.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8b11ae8a
......@@ -294,11 +294,11 @@ int swri_resample(ResampleContext *c, int16_t *dst, const int16_t *src, int *con
int sample_index= index >> c->phase_shift;
FELEM2 val=0;
if(sample_index < 0){
for(i=0; i<c->filter_length; i++)
val += src[FFABS(sample_index + i) % src_size] * filter[i];
}else if(sample_index + c->filter_length > src_size){
if(sample_index + c->filter_length > src_size || -sample_index >= src_size){
break;
}else if(sample_index < 0){
for(i=0; i<c->filter_length; i++)
val += src[FFABS(sample_index + i)] * filter[i];
}else if(c->linear){
FELEM2 v2=0;
for(i=0; i<c->filter_length; i++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment