1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

udp: Print an error message if bind fails

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2012-03-07 21:40:29 +02:00
parent 37cc8600d0
commit a887c87c23

View File

@ -387,8 +387,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
} }
/* bind to the local address if not multicast or if the multicast /* bind to the local address if not multicast or if the multicast
* bind failed */ * bind failed */
if (bind_ret < 0 && bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0) if (bind_ret < 0 && bind(udp_fd,(struct sockaddr *)&my_addr, len) < 0) {
av_log(h, AV_LOG_ERROR, "bind failed: %s\n", strerror(errno));
goto fail; goto fail;
}
len = sizeof(my_addr); len = sizeof(my_addr);
getsockname(udp_fd, (struct sockaddr *)&my_addr, &len); getsockname(udp_fd, (struct sockaddr *)&my_addr, &len);