[FFmpeg-devel] [PATCH] shorten UDP read URLs

Martin Storsjö martin
Thu Sep 16 21:02:35 CEST 2010


On Thu, 16 Sep 2010, aviad rozenhek wrote:

> other programs such as VLC have convenient notation for udp read socket in
> port 1234: udp://localhost:1234
> in ffmpeg/ffplay a more cumbersome udp://localhost?localport=1234 is needed.
> 
> the attached patch makes udp://localhost:1234 behave exactly like
> udp://localhost?localport=1234 for reading UDP without breaking anything I
> could think of.
> use of ?localport flags is maintained for backwards compatibility.

A few issues:
- Why move the code? Since the code is both moved and modified, it would 
be easier to review if you'd first move it without altering it, then 
modifying it in a separate patch.
- I think it would be possible to do this at the current place in the 
code, without moving it, with something like this:
if (!s->local_port && !(h->flags & URL_WRONLY))
    s->local_port = port;

I'm a bit undecided about which flags this should apply to. The RTSP/RTP 
code uses URL_RDWR for everything, but on the other hand, that code also 
always specifies ?localport= internally so this shouldn't matter. The 
comment "for a read only URL the remote port is irrelevant" is a bit 
misleading, since the code currently also applies for URL_RDWR.

// Martin



More information about the ffmpeg-devel mailing list