[FFmpeg-devel] [RFC] libavformat: URL reassembly with IPv6 addresses

Martin Storsjö martin
Fri Feb 26 23:16:59 CET 2010

On Sat, 27 Feb 2010, Martin Storsj? wrote:

> On Fri, 26 Feb 2010, Ronald S. Bultje wrote:
> > On Fri, Feb 26, 2010 at 2:24 PM, Martin Storsj? <martin at martin.st> wrote:
> > > Ok, so what about the attached patch?
> > 
> > Summary of IRC discussion:
> > - almost always (but not always, e.g. HTTP request header), this is
> > used in combination with a protocol, and that'd require a temporary
> > buffer plus two extra lines of code to get to the final URI; would be
> > nice if that was done directly. If that's a little non-optimal, that's
> > OK, because it's not speed-critical, I'd prefer very much that the
> > calling code is small (i.e. one-liner), pretty much as simple as
> > snprintf(buf, .., "tcp://%s:%d?...", etc);.
> > - don't use av_strlcat() on an uninitialized buffer, it might not be zero'ed out
> Ok, so based on this discussion, here's another suggestion. One function 
> that hides all the details of escaping IP addresses in URLs and assembling 
> URLs, which is quite simple and non-intrusive to use. All the code that 
> uses it is left as simple as before, or even becomes simpler.
> Only tested the RTSP/RTP and HTTP protocols briefly this far, but the 
> other ones are quite simple to proof-read once more if the concept looks 
> good.

Clarification: Tested HTTP with IPv6, and general non-brokenness of 

Missed one case of snprintf(... "tcp://") in rtsp.c still, but you get the 
general picture of what the modifications look like.

// Martin

More information about the ffmpeg-devel mailing list