Browse code

swr: fix buf_set() so it works with input == output

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/05/20 00:45:41
Showing 1 changed files
... ...
@@ -394,7 +394,7 @@ static void buf_set(AudioData *out, AudioData *in, int count){
394 394
         for(ch=0; ch<out->ch_count; ch++)
395 395
             out->ch[ch]= in->ch[ch] + count*out->bps;
396 396
     }else{
397
-        for(ch=0; ch<out->ch_count; ch++)
397
+        for(ch=out->ch_count-1; ch>=0; ch--)
398 398
             out->ch[ch]= in->ch[0] + (ch + count*out->ch_count) * out->bps;
399 399
     }
400 400
 }