[FFmpeg-cvslog] udp: Receive on the remote port number, if no local port is set

Can Wu git at videolan.org
Sat Jun 25 04:33:11 CEST 2011


ffmpeg | branch: master | Can Wu <wu.canus at gmail.com> | Fri Jun 17 13:58:01 2011 +0800| [fc66e231541b91b22f6e0d8257991cc5343db8d5] | committer: 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: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc66e231541b91b22f6e0d8257991cc5343db8d5
---

 libavformat/udp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index d6522bf..724ff01 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)



More information about the ffmpeg-cvslog mailing list