[FFmpeg-cvslog] swr: skip memset(0) in rematrix when the array is known to be already 0

Michael Niedermayer git at videolan.org
Sat Jun 9 02:46:23 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun  9 02:06:58 2012 +0200| [a5c634935891ed8a45603bfa676d053d3e6a8a04] | committer: Michael Niedermayer

swr: skip memset(0) in rematrix when the array is known to be already 0

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5c634935891ed8a45603bfa676d053d3e6a8a04
---

 libswresample/rematrix.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index 9624627..5fa77ce 100644
--- a/libswresample/rematrix.c
+++ b/libswresample/rematrix.c
@@ -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];



More information about the ffmpeg-cvslog mailing list