diff options
author | Max Krasnyansky <maxk@qualcomm.com> | 2003-02-09 18:06:23 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-02-09 18:06:23 +0000 |
commit | 9899efb41a5a132a20a3c46ac97418a66e1a119c (patch) | |
tree | 4dfc989d002880436f9e07b64f501e4980228f88 /libavformat | |
parent | 1e711bd6039bcd2a8cb65a90e63c06d032de5202 (diff) | |
download | ffmpeg-9899efb41a5a132a20a3c46ac97418a66e1a119c.tar.gz |
variable UDP packet size patch by Max Krasnyansky
Originally committed as revision 1565 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/udp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c index 3d159ef4f8..f28bdcaa4c 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -48,6 +48,7 @@ typedef struct { * 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 @@ static int udp_open(URLContext *h, const char *uri, int flags) char buf[256]; h->is_streamed = 1; + h->max_packet_size = 1472; is_output = (flags & URL_WRONLY); @@ -123,6 +125,9 @@ static int udp_open(URLContext *h, const char *uri, int flags) 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 @@ static int udp_open(URLContext *h, const char *uri, int flags) } s->udp_fd = udp_fd; - h->max_packet_size = 1472; /* XXX: probe it ? */ return 0; fail: if (udp_fd >= 0) |