static av_cold int output_configure(AACContext *ac,
                            enum ChannelPosition che_pos[4][MAX_ELEM_ID],
                            enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
                            int channel_config, enum OCStatus oc_type)
{
    AVCodecContext *avctx = ac->avctx;
    int i, type, channels = 0, ret;
    if (new_che_pos != che_pos)
    memcpy(che_pos, new_che_pos, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));
    if (channel_config) {
        for (i = 0; i < tags_per_config[channel_config]; i++) {
            if ((ret = che_configure(ac, che_pos,
                                     aac_channel_layout_map[channel_config - 1][i][0],
                                     aac_channel_layout_map[channel_config - 1][i][1],
                                     &channels)))
                return ret;
        }
        memset(ac->tag_che_map, 0,       4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
        avctx->channel_layout = aac_channel_layout[channel_config - 1];
    } else {
        for (i = 0; i < MAX_ELEM_ID; i++) {
            for (type = 0; type < 4; type++) {
                if ((ret = che_configure(ac, che_pos, type, i, &channels)))
                    return ret;
            }
        }
        memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));
        avctx->channel_layout = 0;
    }
    avctx->channels = channels;
    ac->output_configured = oc_type;
    return 0;
}
['static av_cold int output_configure(AACContext *ac,\n                            enum ChannelPosition che_pos[4][MAX_ELEM_ID],\n                            enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],\n                            int channel_config, enum OCStatus oc_type)\n{\n    AVCodecContext *avctx = ac->avctx;\n    int i, type, channels = 0, ret;\n    if (new_che_pos != che_pos)\n    memcpy(che_pos, new_che_pos, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));\n    if (channel_config) {\n        for (i = 0; i < tags_per_config[channel_config]; i++) {\n            if ((ret = che_configure(ac, che_pos,\n                                     aac_channel_layout_map[channel_config - 1][i][0],\n                                     aac_channel_layout_map[channel_config - 1][i][1],\n                                     &channels)))\n                return ret;\n        }\n        memset(ac->tag_che_map, 0,       4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));\n        avctx->channel_layout = aac_channel_layout[channel_config - 1];\n    } else {\n        for (i = 0; i < MAX_ELEM_ID; i++) {\n            for (type = 0; type < 4; type++) {\n                if ((ret = che_configure(ac, che_pos, type, i, &channels)))\n                    return ret;\n            }\n        }\n        memcpy(ac->tag_che_map, ac->che, 4 * MAX_ELEM_ID * sizeof(ac->che[0][0]));\n        avctx->channel_layout = 0;\n    }\n    avctx->channels = channels;\n    ac->output_configured = oc_type;\n    return 0;\n}']