int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)
{
    const char *p;
    char tag[128], *q;
    p = info;
    if (*p == '?')
        p++;
    for(;;) {
        q = tag;
        while (*p != '\0' && *p != '=' && *p != '&') {
            if ((q - tag) < sizeof(tag) - 1)
                *q++ = *p;
            p++;
        }
        *q = '\0';
        q = arg;
        if (*p == '=') {
            p++;
            while (*p != '&' && *p != '\0') {
                if ((q - arg) < arg_size - 1) {
                    if (*p == '+')
                        *q++ = ' ';
                    else
                        *q++ = *p;
                }
                p++;
            }
            *q = '\0';
        }
        if (!strcmp(tag, tag1))
            return 1;
        if (*p != '&')
            break;
        p++;
    }
    return 0;
}
['static void start_multicast(void)\n{\n    FFStream *stream;\n    char session_id[32];\n    HTTPContext *rtp_c;\n    struct sockaddr_in dest_addr;\n    int default_port, stream_index;\n    default_port = 6000;\n    for(stream = first_stream; stream != NULL; stream = stream->next) {\n        if (stream->is_multicast) {\n            snprintf(session_id, sizeof(session_id), "%08x%08x",\n                     av_random(&random_state), av_random(&random_state));\n            if (stream->multicast_port == 0) {\n                stream->multicast_port = default_port;\n                default_port += 100;\n            }\n            dest_addr.sin_family = AF_INET;\n            dest_addr.sin_addr = stream->multicast_ip;\n            dest_addr.sin_port = htons(stream->multicast_port);\n            rtp_c = rtp_new_connection(&dest_addr, stream, session_id,\n                                       RTSP_PROTOCOL_RTP_UDP_MULTICAST);\n            if (!rtp_c)\n                continue;\n            if (open_input_stream(rtp_c, "") < 0) {\n                fprintf(stderr, "Could not open input stream for stream \'%s\'\\n",\n                        stream->filename);\n                continue;\n            }\n            for(stream_index = 0; stream_index < stream->nb_streams;\n                stream_index++) {\n                dest_addr.sin_port = htons(stream->multicast_port +\n                                           2 * stream_index);\n                if (rtp_new_av_stream(rtp_c, stream_index, &dest_addr, NULL) < 0) {\n                    fprintf(stderr, "Could not open output stream \'%s/streamid=%d\'\\n",\n                            stream->filename, stream_index);\n                    exit(1);\n                }\n            }\n            rtp_c->state = HTTPSTATE_SEND_DATA;\n        }\n    }\n}', 'static int open_input_stream(HTTPContext *c, const char *info)\n{\n    char buf[128];\n    char input_filename[1024];\n    AVFormatContext *s;\n    int buf_size, i;\n    int64_t stream_pos;\n    if (c->stream->feed) {\n        strcpy(input_filename, c->stream->feed->feed_filename);\n        buf_size = FFM_PACKET_SIZE;\n        if (find_info_tag(buf, sizeof(buf), "date", info))\n        {\n            stream_pos = parse_date(buf, 0);\n            if (stream_pos == INT64_MIN)\n                return -1;\n        }\n        else if (find_info_tag(buf, sizeof(buf), "buffer", info)) {\n            int prebuffer = strtol(buf, 0, 10);\n            stream_pos = av_gettime() - prebuffer * (int64_t)1000000;\n        } else\n            stream_pos = av_gettime() - c->stream->prebuffer * (int64_t)1000;\n    } else {\n        strcpy(input_filename, c->stream->feed_filename);\n        buf_size = 0;\n        if (find_info_tag(buf, sizeof(buf), "date", info))\n        {\n            stream_pos = parse_date(buf, 1);\n            if (stream_pos == INT64_MIN)\n                return -1;\n        }\n        else\n            stream_pos = 0;\n    }\n    if (input_filename[0] == \'\\0\')\n        return -1;\n#if 0\n    { time_t when = stream_pos / 1000000;\n    http_log("Stream pos = %"PRId64", time=%s", stream_pos, ctime(&when));\n    }\n#endif\n    if (av_open_input_file(&s, input_filename, c->stream->ifmt,\n                           buf_size, c->stream->ap_in) < 0) {\n        http_log("%s not found", input_filename);\n        return -1;\n    }\n    s->flags |= AVFMT_FLAG_GENPTS;\n    c->fmt_in = s;\n    av_find_stream_info(c->fmt_in);\n    for(i=0;i<s->nb_streams;i++)\n        open_parser(s, i);\n    c->pts_stream_index = 0;\n    for(i=0;i<c->stream->nb_streams;i++) {\n        if (c->pts_stream_index == 0 &&\n            c->stream->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {\n            c->pts_stream_index = i;\n        }\n    }\n#if 1\n    if (c->fmt_in->iformat->read_seek)\n        c->fmt_in->iformat->read_seek(c->fmt_in, 0, stream_pos, 0);\n#endif\n    c->start_time = cur_time;\n    c->first_pts = AV_NOPTS_VALUE;\n    return 0;\n}', "int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info)\n{\n    const char *p;\n    char tag[128], *q;\n    p = info;\n    if (*p == '?')\n        p++;\n    for(;;) {\n        q = tag;\n        while (*p != '\\0' && *p != '=' && *p != '&') {\n            if ((q - tag) < sizeof(tag) - 1)\n                *q++ = *p;\n            p++;\n        }\n        *q = '\\0';\n        q = arg;\n        if (*p == '=') {\n            p++;\n            while (*p != '&' && *p != '\\0') {\n                if ((q - arg) < arg_size - 1) {\n                    if (*p == '+')\n                        *q++ = ' ';\n                    else\n                        *q++ = *p;\n                }\n                p++;\n            }\n            *q = '\\0';\n        }\n        if (!strcmp(tag, tag1))\n            return 1;\n        if (*p != '&')\n            break;\n        p++;\n    }\n    return 0;\n}"]