History

swresample: Use channel count in rematrix initialization

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.

Marcin Gorzel committed 8 years ago

Commit 8b710ea1 parent d01d46a2 files · +4 −4Browse files

Showing the changes to libswresample (2 of 2 files). Show all

Unified · Split

2 files
  1. libswresample/rematrix.c +2 −2
  2. libswresample/x86/rematrix_init.c +2 −2
libswresample/rematrix.c+2−2
@@ -384,8 +384,8 @@ av_cold static int auto_matrix(SwrContext *s) · 383 unmodified lines
384384
385385 av_cold int swri_rematrix_init(SwrContext *s){
386386 int i, j;
387− int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout);
388− int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout);
387+ int nb_in = s->used_ch_count;
388+ int nb_out = s->out.ch_count;
389389
390390 s->mix_any_f = NULL;
391391
libswresample/x86/rematrix_init.c+2−2
@@ -33,8 +33,8 @@ D(int16, sse2) · 32 unmodified lines
3333 av_cold int swri_rematrix_init_x86(struct SwrContext *s){
3434 #if HAVE_X86ASM
3535 int mm_flags = av_get_cpu_flags();
36− int nb_in = av_get_channel_layout_nb_channels(s->in_ch_layout);
37− int nb_out = av_get_channel_layout_nb_channels(s->out_ch_layout);
36+ int nb_in = s->used_ch_count;
37+ int nb_out = s->out.ch_count;
3838 int num = nb_in * nb_out;
3939 int i,j;
4040

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t