aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-28 00:42:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-28 01:08:52 +0200
commit87df986dcf90dcda2d10d9c3b3c84656cdd032aa (patch)
treef7c506a9a96b3df41f392a558a1f9add4f9ff013 /libavformat/tcp.c
parentee7214c59a2641389bec9e9598345c7a58f1e173 (diff)
parent15358ade152ebc28fcc824e09ad9206597c281df (diff)
downloadandroid_external_ffmpeg-87df986dcf90dcda2d10d9c3b3c84656cdd032aa.tar.gz
android_external_ffmpeg-87df986dcf90dcda2d10d9c3b3c84656cdd032aa.tar.bz2
android_external_ffmpeg-87df986dcf90dcda2d10d9c3b3c84656cdd032aa.zip
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 <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c7
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",