aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorCan Wu <wu.canus@gmail.com>2011-06-17 13:58:01 +0800
committerMartin Storsjö <martin@martin.st>2011-06-24 18:27:02 +0300
commitfc66e231541b91b22f6e0d8257991cc5343db8d5 (patch)
tree9c757a7e9d615939737af3e743a2ec78b9cc1124 /libavformat/udp.c
parentadbfc605f6bbe87b292c82cd1f5d4d974fa6b73c (diff)
downloadffmpeg-fc66e231541b91b22f6e0d8257991cc5343db8d5.tar.gz
udp: Receive on the remote port number, if no local port is set
For a unicast udp stream to localhost:1234, currently ffplay udp://:1234?localport=1234 works, but ffplay udp://:1234 doesn't work. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index d6522bf0be..724ff0197d 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -365,7 +365,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
goto fail;
}
- if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
+ if ((s->is_multicast || !s->local_port) && (h->flags & AVIO_FLAG_READ))
s->local_port = port;
udp_fd = udp_socket_create(s, &my_addr, &len);
if (udp_fd < 0)