/* If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address. */
int rtp_set_remote_url(URLContext *h, const char *uri)
/* If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address. */
int rtp_set_remote_url(URLContext *h, const char *uri)
{
    RTPContext *s = h->priv_data;
    char hostname[256];
    int port;
    char buf[1024];
    char path[1024];
    ff_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), &port,
                 path, sizeof(path), uri);
    ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port, "%s", path);
    udp_set_remote_url(s->rtp_hd, buf);
    ff_url_join(buf, sizeof(buf), "udp", NULL, hostname, port + 1, "%s", path);
    udp_set_remote_url(s->rtcp_hd, buf);
    return 0;
}