diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-07-29 19:22:19 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-08-04 10:28:22 -0400 |
commit | 8821ae649e61097ec57ca58472c3e4239c82913c (patch) | |
tree | f16cacb4255fd3bbbfd5271f1b793cf02dc45940 /libavresample/audio_mix.c | |
parent | 73486e3b612aa07b94f1b5ad9c11d7450841ce1b (diff) | |
download | ffmpeg-8821ae649e61097ec57ca58472c3e4239c82913c.tar.gz |
lavr: fix handling of custom mix matrices
Adds some validation for changing parameters after setting the matrix and
fixes a bug in the conversion path setup.
Diffstat (limited to 'libavresample/audio_mix.c')
-rw-r--r-- | libavresample/audio_mix.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c index 2c2a356844..e8ab2e3ee7 100644 --- a/libavresample/audio_mix.c +++ b/libavresample/audio_mix.c @@ -314,7 +314,15 @@ int ff_audio_mix_init(AVAudioResampleContext *avr) } /* build matrix if the user did not already set one */ - if (!avr->am->matrix) { + if (avr->am->matrix) { + if (avr->am->coeff_type != avr->mix_coeff_type || + avr->am->in_layout != avr->in_channel_layout || + avr->am->out_layout != avr->out_channel_layout) { + av_log(avr, AV_LOG_ERROR, + "Custom matrix does not match current parameters\n"); + return AVERROR(EINVAL); + } + } else { int i, j; char in_layout_name[128]; char out_layout_name[128]; |