Showing the changes to libswresample (1 of 1 file). Show all
Unified · Split
| @@ -102,6 +102,11 @@ static int even(int64_t layout){ · 101 unmodified lines | |||
| 102 | return 0; | 102 | return 0; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | static int clean_layout(SwrContext *s, int64_t layout){ | ||
| 106 | |||
| 107 | return layout; | ||
| 108 | } | ||
| 109 | |||
| 105 | static int sane_layout(int64_t layout){ | 110 | static int sane_layout(int64_t layout){ |
| 106 | if(!(layout & AV_CH_LAYOUT_SURROUND)) // at least 1 front speaker | 111 | if(!(layout & AV_CH_LAYOUT_SURROUND)) // at least 1 front speaker |
| 107 | return 0; | 112 | return 0; |
| @@ -123,16 +128,19 @@ static int auto_matrix(SwrContext *s) · 15 unmodified lines | |||
| 123 | { | 128 | { |
| 124 | int i, j, out_i; | 129 | int i, j, out_i; |
| 125 | double matrix[64][64]={{0}}; | 130 | 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; |
| 127 | double maxcoef=0; | 132 | double maxcoef=0; |
| 128 | char buf[128]; | 133 | char buf[128]; |
| 129 | const int matrix_encoding = s->matrix_encoding; | 134 | const int matrix_encoding = s->matrix_encoding; |
| 130 | 135 | ||
| 136 | in_ch_layout = clean_layout(s, s->in_ch_layout); | ||
| 131 | if(!sane_layout(in_ch_layout)){ | 137 | if(!sane_layout(in_ch_layout)){ |
| 132 | av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout); | 138 | av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout); |
| 133 | av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf); | 139 | av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf); |
| 134 | return AVERROR(EINVAL); | 140 | return AVERROR(EINVAL); |
| 135 | } | 141 | } |
| 142 | |||
| 143 | out_ch_layout = clean_layout(s, s->out_ch_layout); | ||
| 136 | if(!sane_layout(out_ch_layout)){ | 144 | if(!sane_layout(out_ch_layout)){ |
| 137 | av_get_channel_layout_string(buf, sizeof(buf), -1, s->out_ch_layout); | 145 | av_get_channel_layout_string(buf, sizeof(buf), -1, s->out_ch_layout); |
| 138 | av_log(s, AV_LOG_ERROR, "Output channel layout '%s' is not supported\n", buf); | 146 | av_log(s, AV_LOG_ERROR, "Output channel layout '%s' is not supported\n", buf); |