[FFmpeg-devel] fix for issue 1676 - file.c doesn't understand file URLs

Tomas Härdin tomas.hardin
Fri Feb 5 15:00:18 CET 2010

On Fri, 2010-02-05 at 14:30 +0100, Laurent Aimar wrote:
> Hi,
> On Fri, Feb 05, 2010, Tomas H?rdin wrote:
> > I can  shed some light on this. I read up on this a while back and found
> > the RFC in which the URI syntax is defined. In fact, the RFC is here:
> > http://www.ietf.org/rfc/rfc2396.txt
> > 
> > The short answer is that you shouldn't use any extra slashes at all.
> > That example URI is NOT well-formed.
>  From rfc3986 (http://tools.ietf.org/html/rfc3986#section-3.1), you have
> the following extract:
>   "If the URI scheme defines a default for host, then that default
>    applies when the host subcomponent is undefined or when the
>    registered name is empty (zero length).  For example, the "file" URI
>    scheme is defined so that no authority, an empty host, and
>    "localhost" all mean the end-user's machine, whereas the "http"
>    scheme considers a missing authority or empty host invalid."
>  Which IMHO, make file://host/path a valid syntax weither or not host is
> empty.
> Regards,

Ah, right. I have actually skimmed through that RFC before, but it seem
I didn't recall it. My Firefox history had it quite a bit further down
the list compared to RFC 2396. I wasn't too far off though - the URI is
well-formed for RFC 3986, but not 2396. It's just a little ugly IMO.

You're right about the file URI. Since the file scheme operates on the
local file system host can be ignored. The userinfo part might be
interesting in some special applications though, as I mentioned. That
might be outside the scope of libavformat though.

Anyway, as long as the URI parsing in libavformat is forgiving enough
things should be fine.


More information about the ffmpeg-devel mailing list