Commit 2a83905f authored by bellard's avatar bellard

fixed multicast connect


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1221 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3be6f171
...@@ -141,13 +141,13 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -141,13 +141,13 @@ static int udp_open(URLContext *h, const char *uri, int flags)
if (udp_fd < 0) if (udp_fd < 0)
goto fail; goto fail;
my_addr.sin_family = AF_INET;
my_addr.sin_addr.s_addr = htonl (INADDR_ANY);
if (s->is_multicast && !(h->flags & URL_WRONLY)) { if (s->is_multicast && !(h->flags & URL_WRONLY)) {
/* special case: the bind must be done on the multicast address */ /* special case: the bind must be done on the multicast address port */
my_addr = s->dest_addr; my_addr.sin_port = s->dest_addr.sin_port;
} else { } else {
my_addr.sin_family = AF_INET;
my_addr.sin_port = htons(s->local_port); my_addr.sin_port = htons(s->local_port);
my_addr.sin_addr.s_addr = htonl (INADDR_ANY);
} }
/* the bind is needed to give a port to the socket now */ /* the bind is needed to give a port to the socket now */
......
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