rtsp multicast fix by Thijs Vermeir $1$2@gmail.com

Originally committed as revision 9611 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Luca Barbato 2007-07-12 21:12:33 +00:00
parent 5d3049559a
commit d02678eccc
1 changed files with 5 additions and 7 deletions

View File

@ -1019,15 +1019,13 @@ static int rtsp_read_header(AVFormatContext *s,
case RTSP_PROTOCOL_RTP_UDP_MULTICAST: case RTSP_PROTOCOL_RTP_UDP_MULTICAST:
{ {
char url[1024]; char url[1024];
int ttl; struct in_addr in;
ttl = reply->transports[0].ttl; in.s_addr = htonl(reply->transports[0].destination);
if (!ttl)
ttl = 16;
snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d", snprintf(url, sizeof(url), "rtp://%s:%d?multicast=1&ttl=%d",
host, inet_ntoa(in),
reply->transports[0].server_port_min, reply->transports[0].port_min,
ttl); 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;