diff --git a/configure b/configure index e285e16545..81f056f695 100755 --- a/configure +++ b/configure @@ -3035,6 +3035,7 @@ check_cflags -Wdeclaration-after-statement check_cflags -Wall check_cflags -Wno-parentheses check_cflags -Wno-switch +check_cflags -Wno-format-zero-length check_cflags -Wdisabled-optimization check_cflags -Wpointer-arith check_cflags -Wredundant-decls diff --git a/libavformat/udp.c b/libavformat/udp.c index 7c18fb7bf0..21b4455948 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -444,7 +444,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)