diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-04 02:49:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-04 02:49:48 +0200 |
commit | c62fea75747de132d69cdf8504ab6c8af26fa307 (patch) | |
tree | aa43d49d22eff48477167fd9aa359637015b7185 /libavresample/utils.c | |
parent | 8f6d36b3cb8e3afc6cfa3abb1582ec4d71a3e1ee (diff) | |
parent | fbc0b8659967ea54a8472b5f795270d38bb085dd (diff) | |
download | ffmpeg-c62fea75747de132d69cdf8504ab6c8af26fa307.tar.gz |
Merge commit 'fbc0b8659967ea54a8472b5f795270d38bb085dd'
* commit 'fbc0b8659967ea54a8472b5f795270d38bb085dd':
lavr: Do not change the sample format for mono audio
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavresample/utils.c')
-rw-r--r-- | libavresample/utils.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavresample/utils.c b/libavresample/utils.c index 48874d6103..f4eb66684e 100644 --- a/libavresample/utils.c +++ b/libavresample/utils.c @@ -101,16 +101,10 @@ int avresample_open(AVAudioResampleContext *avr) av_get_sample_fmt_name(avr->internal_sample_fmt)); } - /* treat all mono as planar for easier comparison */ - if (avr->in_channels == 1) - avr->in_sample_fmt = av_get_planar_sample_fmt(avr->in_sample_fmt); - if (avr->out_channels == 1) - avr->out_sample_fmt = av_get_planar_sample_fmt(avr->out_sample_fmt); - /* we may need to add an extra conversion in order to remap channels if the output format is not planar */ if (avr->use_channel_map && !avr->mixing_needed && !avr->resample_needed && - !av_sample_fmt_is_planar(avr->out_sample_fmt)) { + !ff_sample_fmt_is_planar(avr->out_sample_fmt, avr->out_channels)) { avr->internal_sample_fmt = av_get_planar_sample_fmt(avr->out_sample_fmt); } @@ -119,7 +113,7 @@ int avresample_open(AVAudioResampleContext *avr) avr->in_convert_needed = avr->in_sample_fmt != avr->internal_sample_fmt; else avr->in_convert_needed = avr->use_channel_map && - !av_sample_fmt_is_planar(avr->out_sample_fmt); + !ff_sample_fmt_is_planar(avr->out_sample_fmt, avr->out_channels); if (avr->resample_needed || avr->mixing_needed || avr->in_convert_needed) avr->out_convert_needed = avr->internal_sample_fmt != avr->out_sample_fmt; |