summaryrefslogtreecommitdiff
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2007-08-16 22:12:03 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2007-08-16 22:12:03 +0000
commitf18cae4d6e9bbf44fd0e64803688a75accefa2b4 (patch)
treedd92b0fc374b13d26e3bb3bfb58fb2f9051abdc0 /libavformat/udp.c
parentfce388b4b971940edfa0d04f3029f0ce4521c35d (diff)
Set UDP receive buffer to 64k
Originally committed as revision 10129 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index edbf543ba9..d0aadcefc8 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -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 char *uri, int flags)
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;