提交 fc66e231 编写于 作者: C Can Wu 提交者: Martin Storsjö

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: NMartin Storsjö <martin@martin.st>
上级 adbfc605
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册