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

Lukasz Marek lukasz.m.luki at gmail.com
Sun Feb 2 21:08:55 CET 2014


On 02.02.2014 19:53, wm4 wrote:
> On Sun, 2 Feb 2014 19:22:50 +0100
> Nicolas George <george at nsup.org> wrote:
>
>> Le quartidi 14 pluviôse, an CCXXII, wm4 a écrit :
>>> And you reject any realworld-safe handling like browsers and wget do?
>>
>> Once again: please distinguish libraries from end-user applications.
>>
>> For libraries, sane and predictable behaviour is paramount.
>
> 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 have no opinion about supporting escaping or no, so don't take my 
answer as "against", but all you described application does when using 
http protocol (or others). I used ffmpeg on ios platform and there is 
for example NSUrl class that requires percent-escaped strings and there 
is NString class that provides method to do it.

Taking this as example, it may be more proper to add escape/unescape 
funtions to avstring scope and use it in ffplay, ffmpeg and export to 
public API.

-- 
Best Regards,
Lukasz Marek

You can avoid reality, but you cannot avoid the consequences of avoiding 
reality. - Ayn Rand


More information about the ffmpeg-devel mailing list