Cannot play M3U8 with IPv6 address in segment URLs
If an M3U8 playlist contains segment URLs that have IPv6 addresses in them, VLC, after a series of internal processing, fails to assemble a valid URL and thus cannot fetch any segment.
An example of such a playlist:
http://[2409:8087:3869:8021:1001::e5]:6610/PLTV/88888910/224/3221226251/index.m3u8
Logs when running VLC_VERBOSE=3 cvlc
with this URL: vlc.log
Note that the URL in the line above adaptive demux error: Failed to create demuxer (nil) Unknown
is invalid: it lacks square brackets around the IPv6 address.
It seems that the culprit is in the ConnectionParams::setPath
function. When called, it concatenates hostname
into the URL without checking if it is an IPv6 address. If it is, the resulting URL is then invalid. I've tried to manually patch this function by surrounding hostname
inside square brackets, and it worked in this case.