Commit 0ddabc1f authored by lu_zero's avatar lu_zero

Use sdp c= line if the rtsp Transport line doesn't have a destination

Transport:destination in rtsp is optional, c= line in sdp is compulsory

Patch from Armand Bendanan (name.surnameATfreeDOTfr)



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20362 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 710c060f
...@@ -1125,12 +1125,19 @@ make_setup_request (AVFormatContext *s, const char *host, int port, ...@@ -1125,12 +1125,19 @@ make_setup_request (AVFormatContext *s, const char *host, int port,
{ {
char url[1024]; char url[1024];
struct in_addr in; struct in_addr in;
int port, ttl;
in.s_addr = htonl(reply->transports[0].destination);
if (reply->transports[0].destination) {
in.s_addr = htonl(reply->transports[0].destination);
port = reply->transports[0].port_min;
ttl = reply->transports[0].ttl;
} else {
in = rtsp_st->sdp_ip;
port = rtsp_st->sdp_port;
ttl = rtsp_st->sdp_ttl;
}
snprintf(url, sizeof(url), "rtp://%s:%d?ttl=%d", snprintf(url, sizeof(url), "rtp://%s:%d?ttl=%d",
inet_ntoa(in), inet_ntoa(in), port, ttl);
reply->transports[0].port_min,
reply->transports[0].ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) { if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) {
err = AVERROR_INVALIDDATA; err = AVERROR_INVALIDDATA;
goto fail; goto fail;
......
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