Rematrixing supports up to 64 channels. However, there is only a limited number of channel layouts defined. Since the in/out channel count is currently obtained from the channel layout, for undefined layouts (e.g. for 9, 10, 11 channels etc.) the rematrixing fails. This patch changes rematrix init methods to use in (used) and out channel count directly instead of computing it from channel layout.
Unified · Split
| @@ -384,8 +384,8 @@ av_cold static int auto_matrix(SwrContext *s) · 383 unmodified lines | |||
| 384 | 384 | ||
| 385 | av_cold int swri_rematrix_init(SwrContext *s){ | 385 | av_cold int swri_rematrix_init(SwrContext *s){ |
| 386 | int i, j; | 386 | int i, j; |
| 387 | int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); | 387 | int nb_in = s->used_ch_count; |
| 388 | int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); | 388 | int nb_out = s->out.ch_count; |
| 389 | 389 | ||
| 390 | s->mix_any_f = NULL; | 390 | s->mix_any_f = NULL; |
| 391 | 391 | ||
| @@ -33,8 +33,8 @@ D(int16, sse2) · 32 unmodified lines | |||
| 33 | av_cold int swri_rematrix_init_x86(struct SwrContext *s){ | 33 | av_cold int swri_rematrix_init_x86(struct SwrContext *s){ |
| 34 | #if HAVE_X86ASM | 34 | #if HAVE_X86ASM |
| 35 | int mm_flags = av_get_cpu_flags(); | 35 | int mm_flags = av_get_cpu_flags(); |
| 36 | int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout); | 36 | int nb_in = s->used_ch_count; |
| 37 | int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout); | 37 | int nb_out = s->out.ch_count; |
| 38 | int num = nb_in * nb_out; | 38 | int num = nb_in * nb_out; |
| 39 | int i,j; | 39 | int i,j; |
| 40 | 40 | ||