Use recv() instead of recvfrom() (removes some other differences between

IPv4-only and protocol-independent code)

Originally committed as revision 11015 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Luca Abeni 17 years ago
parent 66c49825da
commit 4c7d5764a0
  1. 10
      libavformat/udp.c

@ -404,18 +404,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
static int udp_read(URLContext *h, uint8_t *buf, int size) static int udp_read(URLContext *h, uint8_t *buf, int size)
{ {
UDPContext *s = h->priv_data; UDPContext *s = h->priv_data;
#ifndef CONFIG_IPV6
struct sockaddr_in from;
#else
struct sockaddr_storage from;
#endif
socklen_t from_len;
int len; int len;
for(;;) { for(;;) {
from_len = sizeof(from); len = recv(s->udp_fd, buf, size, 0);
len = recvfrom (s->udp_fd, buf, size, 0,
(struct sockaddr *)&from, &from_len);
if (len < 0) { if (len < 0) {
if (ff_neterrno() != FF_NETERROR(EAGAIN) && if (ff_neterrno() != FF_NETERROR(EAGAIN) &&
ff_neterrno() != FF_NETERROR(EINTR)) ff_neterrno() != FF_NETERROR(EINTR))

Loading…
Cancel
Save