void av_dump_format(AVFormatContext *ic, int index,

                    const char *url, int is_output)

{

    int i;

    uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;

    if (ic->nb_streams && !printed)

        return;



    av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",

           is_output ? "Output" : "Input",

           index,

           is_output ? ic->oformat->name : ic->iformat->name,

           is_output ? "to" : "from", url);

    dump_metadata(NULL, ic->metadata, "  ");



    if (!is_output) {

        av_log(NULL, AV_LOG_INFO, "  Duration: ");

        if (ic->duration != AV_NOPTS_VALUE) {

            int hours, mins, secs, us;

            int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);

            secs  = duration / AV_TIME_BASE;

            us    = duration % AV_TIME_BASE;

            mins  = secs / 60;

            secs %= 60;

            hours = mins / 60;

            mins %= 60;

            av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,

                   (100 * us) / AV_TIME_BASE);

        } else {

            av_log(NULL, AV_LOG_INFO, "N/A");

        }

        if (ic->start_time != AV_NOPTS_VALUE) {

            int secs, us;

            av_log(NULL, AV_LOG_INFO, ", start: ");

            secs = ic->start_time / AV_TIME_BASE;

            us   = llabs(ic->start_time % AV_TIME_BASE);

            av_log(NULL, AV_LOG_INFO, "%d.%06d",

                   secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));

        }

        av_log(NULL, AV_LOG_INFO, ", bitrate: ");

        if (ic->bit_rate)

            av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", (int64_t)ic->bit_rate / 1000);

        else

            av_log(NULL, AV_LOG_INFO, "N/A");

        av_log(NULL, AV_LOG_INFO, "\n");

    }



    for (i = 0; i < ic->nb_chapters; i++) {

        AVChapter *ch = ic->chapters[i];

        av_log(NULL, AV_LOG_INFO, "    Chapter #%d:%d: ", index, i);

        av_log(NULL, AV_LOG_INFO,

               "start %f, ", ch->start * av_q2d(ch->time_base));

        av_log(NULL, AV_LOG_INFO,

               "end %f\n", ch->end * av_q2d(ch->time_base));



        dump_metadata(NULL, ch->metadata, "    ");

    }



    if (ic->nb_programs) {

        int j, k, total = 0;

        for (j = 0; j < ic->nb_programs; j++) {

            AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,

                                                  "name", NULL, 0);

            av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", ic->programs[j]->id,

                   name ? name->value : "");

            dump_metadata(NULL, ic->programs[j]->metadata, "    ");

            for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {

                dump_stream_format(ic, ic->programs[j]->stream_index[k],

                                   index, is_output);

                printed[ic->programs[j]->stream_index[k]] = 1;

            }

            total += ic->programs[j]->nb_stream_indexes;

        }

        if (total < ic->nb_streams)

            av_log(NULL, AV_LOG_INFO, "  No Program\n");

    }



    for (i = 0; i < ic->nb_streams; i++)

        if (!printed[i])

            dump_stream_format(ic, i, index, is_output);



    av_free(printed);

}

void av_dump_format(AVFormatContext *ic, int index,

                    const char *url, int is_output)

{

    int i;

    uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL;

    if (ic->nb_streams && !printed)

        return;



    av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",

           is_output ? "Output" : "Input",

           index,

           is_output ? ic->oformat->name : ic->iformat->name,

           is_output ? "to" : "from", url);

    dump_metadata(NULL, ic->metadata, "  ");



    if (!is_output) {

        av_log(NULL, AV_LOG_INFO, "  Duration: ");

        if (ic->duration != AV_NOPTS_VALUE) {

            int hours, mins, secs, us;

            int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);

            secs  = duration / AV_TIME_BASE;

            us    = duration % AV_TIME_BASE;

            mins  = secs / 60;

            secs %= 60;

            hours = mins / 60;

            mins %= 60;

            av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", hours, mins, secs,

                   (100 * us) / AV_TIME_BASE);

        } else {

            av_log(NULL, AV_LOG_INFO, "N/A");

        }

        if (ic->start_time != AV_NOPTS_VALUE) {

            int secs, us;

            av_log(NULL, AV_LOG_INFO, ", start: ");

            secs = ic->start_time / AV_TIME_BASE;

            us   = llabs(ic->start_time % AV_TIME_BASE);

            av_log(NULL, AV_LOG_INFO, "%d.%06d",

                   secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));

        }

        av_log(NULL, AV_LOG_INFO, ", bitrate: ");

        if (ic->bit_rate)

            av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", (int64_t)ic->bit_rate / 1000);

        else

            av_log(NULL, AV_LOG_INFO, "N/A");

        av_log(NULL, AV_LOG_INFO, "\n");

    }



    for (i = 0; i < ic->nb_chapters; i++) {

        AVChapter *ch = ic->chapters[i];

        av_log(NULL, AV_LOG_INFO, "    Chapter #%d:%d: ", index, i);

        av_log(NULL, AV_LOG_INFO,

               "start %f, ", ch->start * av_q2d(ch->time_base));

        av_log(NULL, AV_LOG_INFO,

               "end %f\n", ch->end * av_q2d(ch->time_base));



        dump_metadata(NULL, ch->metadata, "    ");

    }



    if (ic->nb_programs) {

        int j, k, total = 0;

        for (j = 0; j < ic->nb_programs; j++) {

            AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,

                                                  "name", NULL, 0);

            av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", ic->programs[j]->id,

                   name ? name->value : "");

            dump_metadata(NULL, ic->programs[j]->metadata, "    ");

            for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {

                dump_stream_format(ic, ic->programs[j]->stream_index[k],

                                   index, is_output);

                printed[ic->programs[j]->stream_index[k]] = 1;

            }

            total += ic->programs[j]->nb_stream_indexes;

        }

        if (total < ic->nb_streams)

            av_log(NULL, AV_LOG_INFO, "  No Program\n");

    }



    for (i = 0; i < ic->nb_streams; i++)

        if (!printed[i])

            dump_stream_format(ic, i, index, is_output);



    av_free(printed);

}

            secs = ic->start_time / AV_TIME_BASE;             av_log(NULL, AV_LOG_INFO, "%d.%06d",                    secs, (int) av_rescale(us, 1000000, AV_TIME_BASE));
void FUNC_0(AVFormatContext *VAR_0, int VAR_1,

                    const char *VAR_2, int VAR_3)

{

    int VAR_4;

    uint8_t *printed = VAR_0->nb_streams ? av_mallocz(VAR_0->nb_streams) : NULL;

    if (VAR_0->nb_streams && !printed)

        return;



    av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",

           VAR_3 ? "Output" : "Input",

           VAR_1,

           VAR_3 ? VAR_0->oformat->name : VAR_0->iformat->name,

           VAR_3 ? "to" : "from", VAR_2);

    dump_metadata(NULL, VAR_0->metadata, "  ");



    if (!VAR_3) {

        av_log(NULL, AV_LOG_INFO, "  Duration: ");

        if (VAR_0->duration != AV_NOPTS_VALUE) {

            int VAR_5, VAR_6, VAR_9, VAR_9;

            int64_t duration = VAR_0->duration + (VAR_0->duration <= INT64_MAX - 5000 ? 5000 : 0);

            VAR_9  = duration / AV_TIME_BASE;

            VAR_9    = duration % AV_TIME_BASE;

            VAR_6  = VAR_9 / 60;

            VAR_9 %= 60;

            VAR_5 = VAR_6 / 60;

            VAR_6 %= 60;

            av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", VAR_5, VAR_6, VAR_9,

                   (100 * VAR_9) / AV_TIME_BASE);

        } else {

            av_log(NULL, AV_LOG_INFO, "N/A");

        }

        if (VAR_0->start_time != AV_NOPTS_VALUE) {

            int VAR_9, VAR_9;

            av_log(NULL, AV_LOG_INFO, ", start: ");

            VAR_9 = VAR_0->start_time / AV_TIME_BASE;

            VAR_9   = llabs(VAR_0->start_time % AV_TIME_BASE);

            av_log(NULL, AV_LOG_INFO, "%d.%06d",

                   VAR_9, (int) av_rescale(VAR_9, 1000000, AV_TIME_BASE));

        }

        av_log(NULL, AV_LOG_INFO, ", bitrate: ");

        if (VAR_0->bit_rate)

            av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", (int64_t)VAR_0->bit_rate / 1000);

        else

            av_log(NULL, AV_LOG_INFO, "N/A");

        av_log(NULL, AV_LOG_INFO, "\n");

    }



    for (VAR_4 = 0; VAR_4 < VAR_0->nb_chapters; VAR_4++) {

        AVChapter *ch = VAR_0->chapters[VAR_4];

        av_log(NULL, AV_LOG_INFO, "    Chapter #%d:%d: ", VAR_1, VAR_4);

        av_log(NULL, AV_LOG_INFO,

               "start %f, ", ch->start * av_q2d(ch->time_base));

        av_log(NULL, AV_LOG_INFO,

               "end %f\n", ch->end * av_q2d(ch->time_base));



        dump_metadata(NULL, ch->metadata, "    ");

    }



    if (VAR_0->nb_programs) {

        int VAR_9, VAR_10, VAR_11 = 0;

        for (VAR_9 = 0; VAR_9 < VAR_0->nb_programs; VAR_9++) {

            AVDictionaryEntry *name = av_dict_get(VAR_0->programs[VAR_9]->metadata,

                                                  "name", NULL, 0);

            av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", VAR_0->programs[VAR_9]->id,

                   name ? name->value : "");

            dump_metadata(NULL, VAR_0->programs[VAR_9]->metadata, "    ");

            for (VAR_10 = 0; VAR_10 < VAR_0->programs[VAR_9]->nb_stream_indexes; VAR_10++) {

                dump_stream_format(VAR_0, VAR_0->programs[VAR_9]->stream_index[VAR_10],

                                   VAR_1, VAR_3);

                printed[VAR_0->programs[VAR_9]->stream_index[VAR_10]] = 1;

            }

            VAR_11 += VAR_0->programs[VAR_9]->nb_stream_indexes;

        }

        if (VAR_11 < VAR_0->nb_streams)

            av_log(NULL, AV_LOG_INFO, "  No Program\n");

    }



    for (VAR_4 = 0; VAR_4 < VAR_0->nb_streams; VAR_4++)

        if (!printed[VAR_4])

            dump_stream_format(VAR_0, VAR_4, VAR_1, VAR_3);



    av_free(printed);

}

void FUNC_0(AVFormatContext *VAR_0, int VAR_1,
const char *VAR_2, int VAR_3)
{ int VAR_4; uint8_t *printed = VAR_0->nb_streams ? av_mallocz(VAR_0->nb_streams) : NULL; if (VAR_0->nb_streams && !printed)
return; av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
VAR_3 ? "Output" : "Input",
VAR_1,
VAR_3 ? VAR_0->oformat->name : VAR_0->iformat->name,
VAR_3 ? "to" : "from", VAR_2); dump_metadata(NULL, VAR_0->metadata, "  "); if (!VAR_3) { av_log(NULL, AV_LOG_INFO, "  Duration: "); if (VAR_0->duration != AV_NOPTS_VALUE) { int VAR_5, VAR_6, VAR_9, VAR_9; int64_t duration = VAR_0->duration + (VAR_0->duration <= INT64_MAX - 5000 ? 5000 : 0); VAR_9  = duration / AV_TIME_BASE; VAR_9    = duration % AV_TIME_BASE; VAR_6  = VAR_9 / 60; VAR_9 %= 60; VAR_5 = VAR_6 / 60; VAR_6 %= 60; av_log(NULL, AV_LOG_INFO, "%02d:%02d:%02d.%02d", VAR_5, VAR_6, VAR_9,
(100 * VAR_9) / AV_TIME_BASE); } else { av_log(NULL, AV_LOG_INFO, "N/A"); } if (VAR_0->start_time != AV_NOPTS_VALUE) { int VAR_9, VAR_9; av_log(NULL, AV_LOG_INFO, ", start: "); VAR_9 = VAR_0->start_time / AV_TIME_BASE; VAR_9   = llabs(VAR_0->start_time % AV_TIME_BASE); av_log(NULL, AV_LOG_INFO, "%d.%06d",
VAR_9, (int) av_rescale(VAR_9, 1000000, AV_TIME_BASE)); } av_log(NULL, AV_LOG_INFO, ", bitrate: "); if (VAR_0->bit_rate)
av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", (int64_t)VAR_0->bit_rate / 1000); else
av_log(NULL, AV_LOG_INFO, "N/A"); av_log(NULL, AV_LOG_INFO, "\n"); } for (VAR_4 = 0; VAR_4 < VAR_0->nb_chapters; VAR_4++) { AVChapter *ch = VAR_0->chapters[VAR_4]; av_log(NULL, AV_LOG_INFO, "    Chapter #%d:%d: ", VAR_1, VAR_4); av_log(NULL, AV_LOG_INFO,
"start %f, ", ch->start * av_q2d(ch->time_base)); av_log(NULL, AV_LOG_INFO,
"end %f\n", ch->end * av_q2d(ch->time_base)); dump_metadata(NULL, ch->metadata, "    "); } if (VAR_0->nb_programs) { int VAR_9, VAR_10, VAR_11 = 0; for (VAR_9 = 0; VAR_9 < VAR_0->nb_programs; VAR_9++) { AVDictionaryEntry *name = av_dict_get(VAR_0->programs[VAR_9]->metadata,
"name", NULL, 0); av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", VAR_0->programs[VAR_9]->id,
name ? name->value : ""); dump_metadata(NULL, VAR_0->programs[VAR_9]->metadata, "    "); for (VAR_10 = 0; VAR_10 < VAR_0->programs[VAR_9]->nb_stream_indexes; VAR_10++) { dump_stream_format(VAR_0, VAR_0->programs[VAR_9]->stream_index[VAR_10],
VAR_1, VAR_3); printed[VAR_0->programs[VAR_9]->stream_index[VAR_10]] = 1; } VAR_11 += VAR_0->programs[VAR_9]->nb_stream_indexes; } if (VAR_11 < VAR_0->nb_streams)
av_log(NULL, AV_LOG_INFO, "  No Program\n"); } for (VAR_4 = 0; VAR_4 < VAR_0->nb_streams; VAR_4++) if (!printed[VAR_4])
dump_stream_format(VAR_0, VAR_4, VAR_1, VAR_3); av_free(printed); }