udp: Fix receiving large udp packets
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 28 Jun 2013 21:58:13 +0000 (23:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 28 Jun 2013 22:10:15 +0000 (00:10 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/udp.c

index e8a01dbd286a17e720551e3e222b7bc6fbfc96fb..744b9906c7385759434ec020ba218ea88f9f2c83 100644 (file)
@@ -586,7 +586,11 @@ static int udp_open(URLContext *h, const char *uri, int flags)
     }
     /* handling needed to support options picking from both AVOption and URL */
     s->circular_buffer_size *= 188;
-    h->max_packet_size = s->packet_size;
+    if (flags & AVIO_FLAG_WRITE) {
+        h->max_packet_size = s->packet_size;
+    } else {
+        h->max_packet_size = UDP_MAX_PKT_SIZE;
+    }
     h->rw_timeout = s->timeout;
 
     /* fill the dest addr */