History

swr/auto_matrix: add clean layout function

Michael Niedermayer committed 14 years ago

Commit c8ffab01 parent ebc854e1 file · +9 −1Browse files

Unified · Split

libswresample/rematrix.c+9−1
@@ -102,6 +102,11 @@ static int even(int64_t layout){ · 101 unmodified lines
102102 return 0;
103103 }
104104
105+static int clean_layout(SwrContext *s, int64_t layout){
106+
107+ return layout;
108+}
109+
105110 static int sane_layout(int64_t layout){
106111 if(!(layout & AV_CH_LAYOUT_SURROUND)) // at least 1 front speaker
107112 return 0;
@@ -123,16 +128,19 @@ static int auto_matrix(SwrContext *s) · 15 unmodified lines
123128 {
124129 int i, j, out_i;
125130 double matrix[64][64]={{0}};
126− int64_t unaccounted, in_ch_layout = s->in_ch_layout, out_ch_layout = s->out_ch_layout;
131+ int64_t unaccounted, in_ch_layout, out_ch_layout;
127132 double maxcoef=0;
128133 char buf[128];
129134 const int matrix_encoding = s->matrix_encoding;
130135
136+ in_ch_layout = clean_layout(s, s->in_ch_layout);
131137 if(!sane_layout(in_ch_layout)){
132138 av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
133139 av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
134140 return AVERROR(EINVAL);
135141 }
142+
143+ out_ch_layout = clean_layout(s, s->out_ch_layout);
136144 if(!sane_layout(out_ch_layout)){
137145 av_get_channel_layout_string(buf, sizeof(buf), -1, s->out_ch_layout);
138146 av_log(s, AV_LOG_ERROR, "Output channel layout '%s' is not supported\n", buf);

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