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

Martin Storsjö martin
Fri Feb 26 23:09:39 CET 2010


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 

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-function-ff_url_format-for-assembling-urls.patch
Type: text/x-diff
Size: 3526 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100227/10df8507/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Use-ff_url_format-for-assembling-urls.patch
Type: text/x-diff
Size: 7155 bytes
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100227/10df8507/attachment-0001.patch>

More information about the ffmpeg-devel mailing list