summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-09 02:06:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-09 02:43:10 +0200
commita5c634935891ed8a45603bfa676d053d3e6a8a04 (patch)
treebf1cedf70cdf1511522f1cf7ef80d974c4ffe013 /libswresample
parent75d900d52edb281eb4ab4989800e75abe7555937 (diff)
downloadffmpeg-a5c634935891ed8a45603bfa676d053d3e6a8a04.tar.gz
swr: skip memset(0) in rematrix when the array is known to be already 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/rematrix.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index 96246275b2..5fa77ce5f9 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];