static void get_default_channel_layouts(OutputStream *ost, InputStream *ist)

{

    char layout_name[256];

    AVCodecContext *enc = ost->st->codec;

    AVCodecContext *dec = ist->st->codec;



    if (!dec->channel_layout) {

        if (enc->channel_layout && dec->channels == enc->channels) {

            dec->channel_layout = enc->channel_layout;

        } else {

            dec->channel_layout = av_get_default_channel_layout(dec->channels);



            if (!dec->channel_layout) {

                av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "

                       "layout for Input Stream #%d.%d\n", ist->file_index,

                       ist->st->index);

                exit_program(1);

            }

        }

        av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                     dec->channels, dec->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for  Input Stream "

               "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);

    }

    if (!enc->channel_layout) {

        if (dec->channels == enc->channels) {

            enc->channel_layout = dec->channel_layout;

            return;

        } else {

            enc->channel_layout = av_get_default_channel_layout(enc->channels);

        }

        if (!enc->channel_layout) {

            av_log(NULL, AV_LOG_FATAL, "Unable to find default channel layout "

                   "for Output Stream #%d.%d\n", ost->file_index,

                   ost->st->index);

            exit_program(1);

        }

        av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                     enc->channels, enc->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Output Stream "

               "#%d.%d : %s\n", ost->file_index, ost->st->index, layout_name);

    }

}

static void get_default_channel_layouts(OutputStream *ost, InputStream *ist)

{

    char layout_name[256];

    AVCodecContext *enc = ost->st->codec;

    AVCodecContext *dec = ist->st->codec;



    if (!dec->channel_layout) {

        if (enc->channel_layout && dec->channels == enc->channels) {

            dec->channel_layout = enc->channel_layout;

        } else {

            dec->channel_layout = av_get_default_channel_layout(dec->channels);



            if (!dec->channel_layout) {

                av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "

                       "layout for Input Stream #%d.%d\n", ist->file_index,

                       ist->st->index);

                exit_program(1);

            }

        }

        av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                     dec->channels, dec->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for  Input Stream "

               "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name);

    }

    if (!enc->channel_layout) {

        if (dec->channels == enc->channels) {

            enc->channel_layout = dec->channel_layout;

            return;

        } else {

            enc->channel_layout = av_get_default_channel_layout(enc->channels);

        }

        if (!enc->channel_layout) {

            av_log(NULL, AV_LOG_FATAL, "Unable to find default channel layout "

                   "for Output Stream #%d.%d\n", ost->file_index,

                   ost->st->index);

            exit_program(1);

        }

        av_get_channel_layout_string(layout_name, sizeof(layout_name),

                                     enc->channels, enc->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Output Stream "

               "#%d.%d : %s\n", ost->file_index, ost->st->index, layout_name);

    }

}

static void FUNC_0(OutputStream *VAR_0, InputStream *VAR_1)

{

    char VAR_2[256];

    AVCodecContext *enc = VAR_0->st->codec;

    AVCodecContext *dec = VAR_1->st->codec;



    if (!dec->channel_layout) {

        if (enc->channel_layout && dec->channels == enc->channels) {

            dec->channel_layout = enc->channel_layout;

        } else {

            dec->channel_layout = av_get_default_channel_layout(dec->channels);



            if (!dec->channel_layout) {

                av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "

                       "layout for Input Stream #%d.%d\n", VAR_1->file_index,

                       VAR_1->st->index);

                exit_program(1);

            }

        }

        av_get_channel_layout_string(VAR_2, sizeof(VAR_2),

                                     dec->channels, dec->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for  Input Stream "

               "#%d.%d : %s\n", VAR_1->file_index, VAR_1->st->index, VAR_2);

    }

    if (!enc->channel_layout) {

        if (dec->channels == enc->channels) {

            enc->channel_layout = dec->channel_layout;

            return;

        } else {

            enc->channel_layout = av_get_default_channel_layout(enc->channels);

        }

        if (!enc->channel_layout) {

            av_log(NULL, AV_LOG_FATAL, "Unable to find default channel layout "

                   "for Output Stream #%d.%d\n", VAR_0->file_index,

                   VAR_0->st->index);

            exit_program(1);

        }

        av_get_channel_layout_string(VAR_2, sizeof(VAR_2),

                                     enc->channels, enc->channel_layout);

        av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Output Stream "

               "#%d.%d : %s\n", VAR_0->file_index, VAR_0->st->index, VAR_2);

    }

}

static void FUNC_0(OutputStream *VAR_0, InputStream *VAR_1)
{ char VAR_2[256]; AVCodecContext *enc = VAR_0->st->codec; AVCodecContext *dec = VAR_1->st->codec; if (!dec->channel_layout) { if (enc->channel_layout && dec->channels == enc->channels) { dec->channel_layout = enc->channel_layout; } else { dec->channel_layout = av_get_default_channel_layout(dec->channels); if (!dec->channel_layout) { av_log(NULL, AV_LOG_FATAL, "Unable to find default channel "
"layout for Input Stream #%d.%d\n", VAR_1->file_index,
VAR_1->st->index); exit_program(1); } } av_get_channel_layout_string(VAR_2, sizeof(VAR_2),
dec->channels, dec->channel_layout); av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for  Input Stream "
"#%d.%d : %s\n", VAR_1->file_index, VAR_1->st->index, VAR_2); } if (!enc->channel_layout) { if (dec->channels == enc->channels) { enc->channel_layout = dec->channel_layout; return; } else { enc->channel_layout = av_get_default_channel_layout(enc->channels); } if (!enc->channel_layout) { av_log(NULL, AV_LOG_FATAL, "Unable to find default channel layout "
"for Output Stream #%d.%d\n", VAR_0->file_index,
VAR_0->st->index); exit_program(1); } av_get_channel_layout_string(VAR_2, sizeof(VAR_2),
enc->channels, enc->channel_layout); av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Output Stream "
"#%d.%d : %s\n", VAR_0->file_index, VAR_0->st->index, VAR_2); } }