]> git.sesse.net Git - ffmpeg/commitdiff
swr: skip memset(0) in rematrix when the array is known to be already 0
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 9 Jun 2012 00:06:58 +0000 (02:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 9 Jun 2012 00:43:10 +0000 (02:43 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/rematrix.c

index 96246275b20c1b711da5ac6d22854beab131ced1..5fa77ce5f9fae619e20a170b15c9c23d9a5c9c56 100644 (file)
@@ -362,7 +362,8 @@ int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mus
     for(out_i=0; out_i<out->ch_count; out_i++){
         switch(s->matrix_ch[out_i][0]){
         case 0:
-            memset(out->ch[out_i], 0, len * av_get_bytes_per_sample(s->int_sample_fmt));
+            if(mustcopy)
+                memset(out->ch[out_i], 0, len * av_get_bytes_per_sample(s->int_sample_fmt));
             break;
         case 1:
             in_i= s->matrix_ch[out_i][1];