static void build_file_streams(void)
{
    FFStream *stream, *stream_next;
    int i, ret;
    for(stream = first_stream; stream != NULL; stream = stream_next) {
        AVFormatContext *infile = NULL;
        stream_next = stream->next;
        if (stream->stream_type == STREAM_TYPE_LIVE &&
            !stream->feed) {
            if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
                av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);
            }
            http_log("Opening file '%s'\n", stream->feed_filename);
            if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
                http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
            fail:
                remove_stream(stream);
            } else {
                if (avformat_find_stream_info(infile, NULL) < 0) {
                    http_log("Could not find codec parameters from '%s'\n",
                             stream->feed_filename);
                    avformat_close_input(&infile);
                    goto fail;
                }
                extract_mpeg4_header(infile);
                for(i=0;i<infile->nb_streams;i++)
                    add_av_stream1(stream, infile->streams[i]->codec, 1);
                avformat_close_input(&infile);
            }
        }
    }
}
['static void build_file_streams(void)\n{\n    FFStream *stream, *stream_next;\n    int i, ret;\n    for(stream = first_stream; stream != NULL; stream = stream_next) {\n        AVFormatContext *infile = NULL;\n        stream_next = stream->next;\n        if (stream->stream_type == STREAM_TYPE_LIVE &&\n            !stream->feed) {\n            if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {\n                av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);\n            }\n            http_log("Opening file \'%s\'\\n", stream->feed_filename);\n            if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {\n                http_log("Could not open \'%s\': %d\\n", stream->feed_filename, ret);\n            fail:\n                remove_stream(stream);\n            } else {\n                if (avformat_find_stream_info(infile, NULL) < 0) {\n                    http_log("Could not find codec parameters from \'%s\'\\n",\n                             stream->feed_filename);\n                    avformat_close_input(&infile);\n                    goto fail;\n                }\n                extract_mpeg4_header(infile);\n                for(i=0;i<infile->nb_streams;i++)\n                    add_av_stream1(stream, infile->streams[i]->codec, 1);\n                avformat_close_input(&infile);\n            }\n        }\n    }\n}', '__attribute__ ((format (printf, 1, 2)))\n#endif\nstatic void http_log(const char *fmt, ...)\n{\n    va_list vargs;\n    va_start(vargs, fmt);\n    http_vlog(fmt, vargs);\n    va_end(vargs);\n}', 'static void http_vlog(const char *fmt, va_list vargs)\n{\n    static int print_prefix = 1;\n    if (logfile) {\n        if (print_prefix) {\n            char buf[32];\n            ctime1(buf);\n            fprintf(logfile, "%s ", buf);\n        }\n        print_prefix = strstr(fmt, "\\n") != NULL;\n        vfprintf(logfile, fmt, vargs);\n        fflush(logfile);\n    }\n}', 'int avformat_open_input(AVFormatContext **ps, const char *filename,\n                        AVInputFormat *fmt, AVDictionary **options)\n{\n    AVFormatContext *s = *ps;\n    int ret = 0;\n    AVDictionary *tmp = NULL;\n    ID3v2ExtraMeta *id3v2_extra_meta = NULL;\n    if (!s && !(s = avformat_alloc_context()))\n        return AVERROR(ENOMEM);\n    if (fmt)\n        s->iformat = fmt;\n    if (options)\n        av_dict_copy(&tmp, *options, 0);\n    if ((ret = av_opt_set_dict(s, &tmp)) < 0)\n        goto fail;\n    if ((ret = init_input(s, filename, &tmp)) < 0)\n        goto fail;\n    if (s->iformat->flags & AVFMT_NEEDNUMBER) {\n        if (!av_filename_number_test(filename)) {\n            ret = AVERROR(EINVAL);\n            goto fail;\n        }\n    }\n    s->duration = s->start_time = AV_NOPTS_VALUE;\n    av_strlcpy(s->filename, filename ? filename : "", sizeof(s->filename));\n    if (s->iformat->priv_data_size > 0) {\n        if (!(s->priv_data = av_mallocz(s->iformat->priv_data_size))) {\n            ret = AVERROR(ENOMEM);\n            goto fail;\n        }\n        if (s->iformat->priv_class) {\n            *(const AVClass **) s->priv_data = s->iformat->priv_class;\n            av_opt_set_defaults(s->priv_data);\n            if ((ret = av_opt_set_dict(s->priv_data, &tmp)) < 0)\n                goto fail;\n        }\n    }\n    if (s->pb)\n        ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);\n    if (s->iformat->read_header)\n        if ((ret = s->iformat->read_header(s)) < 0)\n            goto fail;\n    if (id3v2_extra_meta &&\n        (ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0)\n        goto fail;\n    ff_id3v2_free_extra_meta(&id3v2_extra_meta);\n    if ((ret = queue_attached_pictures(s)) < 0)\n        goto fail;\n    if (s->pb && !s->data_offset)\n        s->data_offset = avio_tell(s->pb);\n    s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;\n    if (options) {\n        av_dict_free(options);\n        *options = tmp;\n    }\n    *ps = s;\n    return 0;\nfail:\n    ff_id3v2_free_extra_meta(&id3v2_extra_meta);\n    av_dict_free(&tmp);\n    if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))\n        avio_close(s->pb);\n    avformat_free_context(s);\n    *ps = NULL;\n    return ret;\n}']