aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorLuca Abeni <lucabe72@email.it>2007-11-14 07:35:36 +0000
committerLuca Abeni <lucabe72@email.it>2007-11-14 07:35:36 +0000
commit0ec12335110fbc748d9b0d82e0059bae908bcbe1 (patch)
treecd3d3d86f4735305cd6c71cb7a2c59aaf1096fd3 /libavformat
parent0d4e281cac9c3f72f048c9f23d7724c499483fb0 (diff)
downloadffmpeg-0ec12335110fbc748d9b0d82e0059bae908bcbe1.tar.gz
Remove some ifdefs by using the "dest_addr_len" field in both the IPv4-only
code and the protocol-independent code Originally committed as revision 11011 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/udp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index c52d3062ed..ec437d8c46 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -38,8 +38,8 @@ typedef struct {
struct sockaddr_in dest_addr;
#else
struct sockaddr_storage dest_addr;
- size_t dest_addr_len;
#endif
+ size_t dest_addr_len;
} UDPContext;
#define UDP_TX_BUF_SIZE 32768
@@ -234,6 +234,7 @@ int udp_set_remote_url(URLContext *h, const char *uri)
return AVERROR(EIO);
s->dest_addr.sin_family = AF_INET;
s->dest_addr.sin_port = htons(port);
+ s->dest_addr_len = sizeof(s->dest_addr);
return 0;
#endif
}
@@ -441,11 +442,7 @@ static int udp_write(URLContext *h, uint8_t *buf, int size)
for(;;) {
ret = sendto (s->udp_fd, buf, size, 0,
(struct sockaddr *) &s->dest_addr,
-#ifndef CONFIG_IPV6
- sizeof (s->dest_addr));
-#else
s->dest_addr_len);
-#endif
if (ret < 0) {
if (ff_neterrno() != FF_NETERROR(EINTR) &&
ff_neterrno() != FF_NETERROR(EAGAIN))