summaryrefslogtreecommitdiff
path: root/libavresample/utils.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-07-29 19:22:19 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-08-04 10:28:22 -0400
commit8821ae649e61097ec57ca58472c3e4239c82913c (patch)
treef16cacb4255fd3bbbfd5271f1b793cf02dc45940 /libavresample/utils.c
parent73486e3b612aa07b94f1b5ad9c11d7450841ce1b (diff)
downloadffmpeg-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/utils.c')
-rw-r--r--libavresample/utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavresample/utils.c b/libavresample/utils.c
index 89a82b9dda..2d83372bb8 100644
--- a/libavresample/utils.c
+++ b/libavresample/utils.c
@@ -48,9 +48,8 @@ int avresample_open(AVAudioResampleContext *avr)
avr->resample_channels = FFMIN(avr->in_channels, avr->out_channels);
avr->downmix_needed = avr->in_channels > avr->out_channels;
avr->upmix_needed = avr->out_channels > avr->in_channels ||
- avr->am->matrix ||
- (avr->out_channels == avr->in_channels &&
- avr->in_channel_layout != avr->out_channel_layout);
+ (!avr->downmix_needed && (avr->am->matrix ||
+ avr->in_channel_layout != avr->out_channel_layout));
avr->mixing_needed = avr->downmix_needed || avr->upmix_needed;
/* set resampling parameters */