Signed-off-by: Vittorio Giovara <vittorio.giov...@gmail.com> --- libavresample/utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/libavresample/utils.c b/libavresample/utils.c index 5e4a9f3ac3..cadfd5474f 100644 --- a/libavresample/utils.c +++ b/libavresample/utils.c @@ -46,8 +46,10 @@ int avresample_open(AVAudioResampleContext *avr) /* whitelist allowed channel orders */ if ( (avr->in_ch_layout.order != AV_CHANNEL_ORDER_NATIVE && + avr->in_ch_layout.order != AV_CHANNEL_ORDER_AMBISONIC && avr->in_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC) || (avr->out_ch_layout.order != AV_CHANNEL_ORDER_NATIVE && + avr->out_ch_layout.order != AV_CHANNEL_ORDER_AMBISONIC && avr->out_ch_layout.order != AV_CHANNEL_ORDER_UNSPEC)) { av_log(avr, AV_LOG_ERROR, "Input or ouput channel order is not supported.\n"); @@ -73,6 +75,14 @@ int avresample_open(AVAudioResampleContext *avr) av_channel_layout_default(&avr->out_ch_layout, avr->out_ch_layout.nb_channels); } + if (( avr->in_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC || + avr->out_ch_layout.order == AV_CHANNEL_ORDER_AMBISONIC) && + av_channel_layout_compare(&avr->in_ch_layout, &avr->out_ch_layout)) { + av_log(avr, AV_LOG_ERROR, + "Resampling to/from ambisonic channel layouts is not supported.\n"); + return AVERROR(ENOSYS); + } + /* set channel mixing parameters */ #if FF_API_OLD_CHANNEL_LAYOUT if (avr->in_channel_layout) { -- 2.13.1 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel