+ } else if (map_type == 2) {
+ int ambisonic_order = ff_sqrt(channels) - 1;
+ if (channels != (ambisonic_order + 1) * (ambisonic_order + 1)) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Channel mapping 2 is only specified for channel counts"
+ " which can be written as (n + 1)^2 for nonnegative integer n\n");
+ return AVERROR_INVALIDDATA;
+ }
+ layout = 0;