[FFmpeg-cvslog] r10129 - trunk/libavformat/udp.c
ramiro
subversion
Fri Aug 17 00:12:03 CEST 2007
Author: ramiro
Date: Fri Aug 17 00:12:03 2007
New Revision: 10129
Log:
Set UDP receive buffer to 64k
Modified:
trunk/libavformat/udp.c
Modified: trunk/libavformat/udp.c
==============================================================================
--- trunk/libavformat/udp.c (original)
+++ trunk/libavformat/udp.c Fri Aug 17 00:12:03 2007
@@ -43,6 +43,7 @@ typedef struct {
} UDPContext;
#define UDP_TX_BUF_SIZE 32768
+#define UDP_MAX_PKT_SIZE 65536
#ifdef CONFIG_IPV6
@@ -396,6 +397,11 @@ static int udp_open(URLContext *h, const
perror("setsockopt sndbuf");
goto fail;
}
+ } else {
+ /* set udp recv buffer size to the largest possible udp packet size to
+ * avoid losing data on OSes that set this too low by default. */
+ tmp = UDP_MAX_PKT_SIZE;
+ setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp));
}
s->udp_fd = udp_fd;
More information about the ffmpeg-cvslog
mailing list