[FFmpeg-cvslog] udp: Print an error message if bind fails

Martin Storsjö git at videolan.org
Thu Mar 8 03:10:44 CET 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Mar  7 21:40:29 2012 +0200| [a887c87c233a55db24f3990894b650c790000884] | committer: Martin Storsjö

udp: Print an error message if bind fails

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a887c87c233a55db24f3990894b650c790000884
---

 libavformat/udp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 8bb63c6..93d2692 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -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 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;
+    }
 
     len = sizeof(my_addr);
     getsockname(udp_fd, (struct sockaddr *)&my_addr, &len);



More information about the ffmpeg-cvslog mailing list