diff options
| author | Michael Niedermayer <[email protected]> | 2012-06-28 00:42:47 +0200 | 
|---|---|---|
| committer | Michael Niedermayer <[email protected]> | 2012-06-28 01:08:52 +0200 | 
| commit | 87df986dcf90dcda2d10d9c3b3c84656cdd032aa (patch) | |
| tree | f7c506a9a96b3df41f392a558a1f9add4f9ff013 /libavformat/tcp.c | |
| parent | ee7214c59a2641389bec9e9598345c7a58f1e173 (diff) | |
| parent | 15358ade152ebc28fcc824e09ad9206597c281df (diff) | |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mss1: validate number of changeable palette entries
  mss1: report palette changed when some additional colours were decoded
  x86: fft: replace call to memcpy by a loop
  udp: Support IGMPv3 source specific multicast and source blocking
  dxva2: include dxva.h if found
  libm: Provide fallback definitions for isnan() and isinf()
  tcp: Pass NULL as hostname to getaddrinfo if the string is empty
  tcp: Set AI_PASSIVE when the socket will be used for listening
Conflicts:
	configure
	libavcodec/mss1.c
	libavformat/udp.c
Merged-by: Michael Niedermayer <[email protected]>
Diffstat (limited to 'libavformat/tcp.c')
| -rw-r--r-- | libavformat/tcp.c | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 2fb6a8a584..42dcee0c16 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -63,7 +63,12 @@ static int tcp_open(URLContext *h, const char *uri, int flags)      hints.ai_family = AF_UNSPEC;      hints.ai_socktype = SOCK_STREAM;      snprintf(portstr, sizeof(portstr), "%d", port); -    ret = getaddrinfo(hostname, portstr, &hints, &ai); +    if (listen_socket) +        hints.ai_flags |= AI_PASSIVE; +    if (!hostname[0]) +        ret = getaddrinfo(NULL, portstr, &hints, &ai); +    else +        ret = getaddrinfo(hostname, portstr, &hints, &ai);      if (ret) {          av_log(h, AV_LOG_ERROR,                 "Failed to resolve hostname %s: %s\n",  | 
