From 55a5ec258f53fc7a4bdbea200d096bd5d46625d4 Mon Sep 17 00:00:00 2001
From: Aleksoid1978
Date: Wed, 19 Oct 2016 11:38:12 +0300
Subject: [PATCH] fix swr_set_matrix()
---
libswresample/rematrix.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index 1af2498..4721063 100644
|
a
|
b
|
int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
|
| 68 | 68 | if (!s || s->in_convert) // s needs to be allocated but not initialized |
| 69 | 69 | return AVERROR(EINVAL); |
| 70 | 70 | memset(s->matrix, 0, sizeof(s->matrix)); |
| | 71 | memset(s->matrix_flt, 0, sizeof(s->matrix_flt)); |
| 71 | 72 | nb_in = av_get_channel_layout_nb_channels(s->user_in_ch_layout); |
| 72 | 73 | nb_out = av_get_channel_layout_nb_channels(s->user_out_ch_layout); |
| 73 | 74 | for (out = 0; out < nb_out; out++) { |
| 74 | 75 | for (in = 0; in < nb_in; in++) |
| 75 | | s->matrix[out][in] = matrix[in]; |
| 76 | | if (s->int_sample_fmt == AV_SAMPLE_FMT_FLTP) |
| 77 | | for (in = 0; in < nb_in; in++) |
| 78 | | s->matrix_flt[out][in] = matrix[in]; |
| | 76 | s->matrix_flt[out][in] = s->matrix[out][in] = matrix[in]; |
| 79 | 77 | matrix += stride; |
| 80 | 78 | } |
| 81 | 79 | s->rematrix_custom = 1; |