Commit fd8f91e3 authored by Martin Storsjö's avatar Martin Storsjö

rtsp: Simplify code for forming the remote peer url

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 3c8bff07
...@@ -1483,18 +1483,15 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, ...@@ -1483,18 +1483,15 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
case RTSP_LOWER_TRANSPORT_UDP: { case RTSP_LOWER_TRANSPORT_UDP: {
char url[1024], options[30] = ""; char url[1024], options[30] = "";
const char *peer = host;
if (rt->rtsp_flags & RTSP_FLAG_FILTER_SRC) if (rt->rtsp_flags & RTSP_FLAG_FILTER_SRC)
av_strlcpy(options, "?connect=1", sizeof(options)); av_strlcpy(options, "?connect=1", sizeof(options));
/* Use source address if specified */ /* Use source address if specified */
if (reply->transports[0].source[0]) { if (reply->transports[0].source[0])
ff_url_join(url, sizeof(url), "rtp", NULL, peer = reply->transports[0].source;
reply->transports[0].source, ff_url_join(url, sizeof(url), "rtp", NULL, peer,
reply->transports[0].server_port_min, "%s", options); reply->transports[0].server_port_min, "%s", options);
} else {
ff_url_join(url, sizeof(url), "rtp", NULL, host,
reply->transports[0].server_port_min, "%s", options);
}
if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) && if (!(rt->server_type == RTSP_SERVER_WMS && i > 1) &&
ff_rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) { ff_rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
err = AVERROR_INVALIDDATA; err = AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment