]> git.sesse.net Git - ffmpeg/blobdiff - libswresample/rematrix.c
dvdsubenc: switch to av_assert
[ffmpeg] / libswresample / rematrix.c
index aa66487cd5fd4693d0cf141fe94eb9e049e21082..26e76a2ed822f87ab9e8d36f1404ace00796d41d 100644 (file)
@@ -125,6 +125,7 @@ static int auto_matrix(SwrContext *s)
     double matrix[64][64]={{0}};
     int64_t unaccounted= s->in_ch_layout & ~s->out_ch_layout;
     double maxcoef=0;
+    char buf[128];
 
     memset(s->matrix, 0, sizeof(s->matrix));
     for(i=0; i<64; i++){
@@ -133,11 +134,13 @@ static int auto_matrix(SwrContext *s)
     }
 
     if(!sane_layout(s->in_ch_layout)){
-        av_log(s, AV_LOG_ERROR, "Input channel layout isnt supported\n");
+        av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
+        av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
         return AVERROR(EINVAL);
     }
     if(!sane_layout(s->out_ch_layout)){
-        av_log(s, AV_LOG_ERROR, "Output channel layout isnt supported\n");
+        av_get_channel_layout_string(buf, sizeof(buf), -1, s->out_ch_layout);
+        av_log(s, AV_LOG_ERROR, "Output channel layout '%s' is not supported\n", buf);
         return AVERROR(EINVAL);
     }
 
@@ -305,9 +308,9 @@ int swri_rematrix_init(SwrContext *s){
             for (j = 0; j < nb_in; j++)
                 ((int*)s->native_matrix)[i * nb_in + j] = lrintf(s->matrix[i][j] * 32768);
         *((int*)s->native_one) = 32768;
-        s->mix_1_1_f = copy_s16;
-        s->mix_2_1_f = sum2_s16;
-        s->mix_any_f = get_mix_any_func_s16(s);
+        s->mix_1_1_f = (mix_1_1_func_type*)copy_s16;
+        s->mix_2_1_f = (mix_2_1_func_type*)sum2_s16;
+        s->mix_any_f = (mix_any_func_type*)get_mix_any_func_s16(s);
     }else if(s->midbuf.fmt == AV_SAMPLE_FMT_FLTP){
         s->native_matrix = av_mallocz(nb_in * nb_out * sizeof(float));
         s->native_one    = av_mallocz(sizeof(float));
@@ -315,9 +318,9 @@ int swri_rematrix_init(SwrContext *s){
             for (j = 0; j < nb_in; j++)
                 ((float*)s->native_matrix)[i * nb_in + j] = s->matrix[i][j];
         *((float*)s->native_one) = 1.0;
-        s->mix_1_1_f = copy_float;
-        s->mix_2_1_f = sum2_float;
-        s->mix_any_f = get_mix_any_func_float(s);
+        s->mix_1_1_f = (mix_1_1_func_type*)copy_float;
+        s->mix_2_1_f = (mix_2_1_func_type*)sum2_float;
+        s->mix_any_f = (mix_any_func_type*)get_mix_any_func_float(s);
     }else if(s->midbuf.fmt == AV_SAMPLE_FMT_DBLP){
         s->native_matrix = av_mallocz(nb_in * nb_out * sizeof(double));
         s->native_one    = av_mallocz(sizeof(double));
@@ -325,9 +328,9 @@ int swri_rematrix_init(SwrContext *s){
             for (j = 0; j < nb_in; j++)
                 ((double*)s->native_matrix)[i * nb_in + j] = s->matrix[i][j];
         *((double*)s->native_one) = 1.0;
-        s->mix_1_1_f = copy_double;
-        s->mix_2_1_f = sum2_double;
-        s->mix_any_f = get_mix_any_func_double(s);
+        s->mix_1_1_f = (mix_1_1_func_type*)copy_double;
+        s->mix_2_1_f = (mix_2_1_func_type*)sum2_double;
+        s->mix_any_f = (mix_any_func_type*)get_mix_any_func_double(s);
     }else
         av_assert0(0);
     //FIXME quantize for integeres
@@ -358,7 +361,7 @@ int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mus
     int off = 0;
 
     if(s->mix_any_f) {
-        s->mix_any_f(out->ch, in->ch, s->native_matrix, len);
+        s->mix_any_f(out->ch, (const uint8_t **)in->ch, s->native_matrix, len);
         return 0;
     }