changeset 62:56a6676125b4 libavformat

variable UDP packet size patch by Max Krasnyansky
author bellard
date Sun, 09 Feb 2003 18:06:23 +0000
parents 2aa6e12c82fc
children 8329ba7cbd01
files udp.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/udp.c	Sun Feb 09 17:03:32 2003 +0000
+++ b/udp.c	Sun Feb 09 18:06:23 2003 +0000
@@ -48,6 +48,7 @@
  * option: 'multicast=1' : enable multicast 
  *         'ttl=n'       : set the ttl value (for multicast only)
  *         'localport=n' : set the local port
+ *         'pkt_size=n'  : set max packet size
  *
  * @param s1 media file context
  * @param uri of the remote server
@@ -104,6 +105,7 @@
     char buf[256];
 
     h->is_streamed = 1;
+    h->max_packet_size = 1472;
 
     is_output = (flags & URL_WRONLY);
     
@@ -123,6 +125,9 @@
         if (find_info_tag(buf, sizeof(buf), "localport", p)) {
             s->local_port = strtol(buf, NULL, 10);
         }
+        if (find_info_tag(buf, sizeof(buf), "pkt_size", p)) {
+            h->max_packet_size = strtol(buf, NULL, 10);
+        }
     }
 
     /* fill the dest addr */
@@ -191,7 +196,6 @@
     }
 
     s->udp_fd = udp_fd;
-    h->max_packet_size = 1472; /* XXX: probe it ? */
     return 0;
  fail:
     if (udp_fd >= 0)