[FFmpeg-devel] [PATCH] url_split() ipv6 support

Ronald S. Bultje rsbultje
Sun Sep 23 18:43:38 CEST 2007


Hi,

see $subj, this patch adds support for parsing hostnames such as:
proto://[ipv6host]:port/address
proto://ipv6host:port/address

I've tested with the attached sample .c file and everything appears to work
normally, except that it actually parses the ipv6-ones correctly now.
Output:

$ ./test-url_split
"test.avi"-> "" :// "" @ "" : "0" / "test.avi"
"/tmp/test.mp3"-> "" :// "" @ "" : "0" / "/tmp/test.mp3"
"file:///tmp/test.mp3"-> "file" :// "" @ "" : "0" / "/tmp/test.mp3"
"http://www.address.com"-> "http" :// "" @ "www.address.com" : "0" / ""
"http://www.address.com/"-> "http" :// "" @ "www.address.com" : "0" / "/"
"http://www.address.com:80"-> "http" :// "" @ "www.address.com" : "80" / ""
"http://www.address.com:80/"-> "http" :// "" @ "www.address.com" : "80" /
"/"
"http://www.address.com:80/test.mp3"-> "http" :// "" @ "www.address.com" :
"80" / "/test.mp3"
"http://1.2.3.4:80/test.mp4"-> "http" :// "" @ "1.2.3.4" : "80" /
"/test.mp4"
"http://:::80/test.mp5"-> "http" :// "" @ "::" : "80" / "/test.mp5"
"http://[::1]:80/test.mp6"-> "http" :// "" @ "::1" : "80" / "/test.mp6"
"http://[host.address]:80/test.mp3"-> "http" :// "" @ "host.address" : "80"
/ "/test.mp3"
"file:///[pat]h/to/file.mp3"-> "file" :// "" @ "" : "0" /
"/[pat]h/to/file.mp3"
"http://1:2:3:4:5:6:7:8:80/test.mp3"-> "http" :// "" @ "1:2:3:4:5:6:7:8" :
"80" / "/test.mp3"
"http://me@:::80/test.mp3"-> "http" :// "me" @ "::" : "80" / "/test.mp3"
"http://me:x@:::80/test.mp3"-> "http" :// "me:x" @ "::" : "80" / "/test.mp3"

Before, 8-14 wouldn't work for a variety of reasons.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-url_split-ipv6.patch
Type: application/octet-stream
Size: 3639 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070923/bc7ebd9b/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test-url_split.c
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070923/bc7ebd9b/attachment.txt>



More information about the ffmpeg-devel mailing list