swr: special case for empty channels in rematrix.
authorNicolas George <nicolas.george@normalesup.org>
Mon, 20 Feb 2012 22:55:28 +0000 (23:55 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Wed, 7 Mar 2012 22:56:00 +0000 (23:56 +0100)
Speed += 10% overall for pan=stereo:FL=FL+FR from wav to null.

libswresample/rematrix.c

index da817e1..e588fe9 100644 (file)
@@ -280,6 +280,9 @@ 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 * (s->int_sample_fmt == AV_SAMPLE_FMT_FLT ? sizeof(float) : sizeof(int16_t)));
+            break;
         case 1:
             in_i= s->matrix_ch[out_i][1];
             if(mustcopy || s->matrix[out_i][in_i]!=1.0){