[FFmpeg-devel] [PATCH] http: handle URLs with spaces

Eli Kara eli at algotec.co.il
Sun Feb 2 21:26:59 CET 2014

> What is an end-user application supposed to do?

> 1. Split input URL into protocol and rest 2. Guess all avio protocols which might use http 3. Split the http URL in further components 4. Do the escape mangling on the path component 5. Join them all > back

> All that in the application code, for every project that uses libavformat and wants to do network access? And that for an API that isn't even http specific but accepts generic URLs?

> This API sure likes causing trouble... 

I just have to mention this - wget's code is a heuristic. It decides certain things and assumes this is the correct behavior for everyone. While this may be true 90%
of the time you have to realize there is no rule that fits all. Also, browsers can be really dumb if the like. They can assume in 99% of cases a user will not enter a URL-encoded URL :)

Having said that - consider another thing. FFmpeg exists for quite a bit of time now. If you blindly decide to URL encode all URLs (regardless of algorithm) you will break many user's
Behaviors. Again taking XBMC as an example - all content server via HTTP that is reached by add-ons passes escaped URLs. Also for library entries. If FFmpeg encodes them for the
second time you'll break behavior for millions of users. That's not something you decide on lightly just because up until now the library was not conformant.

An API way of deciding this or at least enabling/disabling the behavior is a must IMO.

ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org

More information about the ffmpeg-devel mailing list