X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fudp.c;h=21b445594819acda1cb211b5e6104d927c5307bf;hb=4ccb7911baa761d373e28068b93db13a76a780b8;hp=7c18fb7bf05c368b2ca782c881ca90d6021f1223;hpb=2905e3ff6462431d55f89614b24e2a407707c82a;p=ffmpeg diff --git a/libavformat/udp.c b/libavformat/udp.c index 7c18fb7bf05..21b44559481 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)