static HTTPContext *find_rtp_session_with_url(const char *url, 

                                              const char *session_id)

{

    HTTPContext *rtp_c;

    char path1[1024];

    const char *path;

    char buf[1024];

    int s;



    rtp_c = find_rtp_session(session_id);

    if (!rtp_c)

        return NULL;



    /* find which url is asked */

    url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);

    path = path1;

    if (*path == '/')

        path++;

    if(!strcmp(path, rtp_c->stream->filename)) return rtp_c;

    for(s=0; s<rtp_c->stream->nb_streams; ++s) {

      snprintf(buf, sizeof(buf), "%s/streamid=%d",

        rtp_c->stream->filename, s);

      if(!strncmp(path, buf, sizeof(buf))) {

    // XXX: Should we reply with RTSP_STATUS_ONLY_AGGREGATE if nb_streams>1?

        return rtp_c;

      }

    }

    return NULL;

}

static HTTPContext *find_rtp_session_with_url(const char *url, 

                                              const char *session_id)

{

    HTTPContext *rtp_c;

    char path1[1024];

    const char *path;

    char buf[1024];

    int s;



    rtp_c = find_rtp_session(session_id);

    if (!rtp_c)

        return NULL;



    

    url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);

    path = path1;

    if (*path == '/')

        path++;

    if(!strcmp(path, rtp_c->stream->filename)) return rtp_c;

    for(s=0; s<rtp_c->stream->nb_streams; ++s) {

      snprintf(buf, sizeof(buf), "%s/streamid=%d",

        rtp_c->stream->filename, s);

      if(!strncmp(path, buf, sizeof(buf))) {

    

        return rtp_c;

      }

    }

    return NULL;

}

static HTTPContext *FUNC_0(const char *url, 

                                              const char *session_id)

{

    HTTPContext *rtp_c;

    char VAR_0[1024];

    const char *VAR_1;

    char VAR_2[1024];

    int VAR_3;



    rtp_c = find_rtp_session(session_id);

    if (!rtp_c)

        return NULL;



    

    url_split(NULL, 0, NULL, 0, NULL, VAR_0, sizeof(VAR_0), url);

    VAR_1 = VAR_0;

    if (*VAR_1 == '/')

        VAR_1++;

    if(!strcmp(VAR_1, rtp_c->stream->filename)) return rtp_c;

    for(VAR_3=0; VAR_3<rtp_c->stream->nb_streams; ++VAR_3) {

      snprintf(VAR_2, sizeof(VAR_2), "%VAR_3/streamid=%d",

        rtp_c->stream->filename, VAR_3);

      if(!strncmp(VAR_1, VAR_2, sizeof(VAR_2))) {

    

        return rtp_c;

      }

    }

    return NULL;

}

static HTTPContext *FUNC_0(const char *url,
const char *session_id)
{ HTTPContext *rtp_c; char VAR_0[1024]; const char *VAR_1; char VAR_2[1024]; int VAR_3; rtp_c = find_rtp_session(session_id); if (!rtp_c)
return NULL; url_split(NULL, 0, NULL, 0, NULL, VAR_0, sizeof(VAR_0), url); VAR_1 = VAR_0; if (*VAR_1 == '/')
VAR_1++; if(!strcmp(VAR_1, rtp_c->stream->filename)) return rtp_c; for(VAR_3=0; VAR_3<rtp_c->stream->nb_streams; ++VAR_3) { snprintf(VAR_2, sizeof(VAR_2), "%VAR_3/streamid=%d",
rtp_c->stream->filename, VAR_3); if(!strncmp(VAR_1, VAR_2, sizeof(VAR_2))) { return rtp_c; } } return NULL; }