[FFmpeg-devel] [PATCH v2] avformat: add a concat protocol that takes a line break delimited list of resources

James Almer jamrial at gmail.com
Sun Jun 27 23:00:56 EEST 2021


On 6/27/2021 4:40 PM, Nicolas George wrote:
> James Almer (12021-06-27):
>> Only line breaks need to be escaped. I said as much and even suggested to
>> make it more explicit in the documentation.
>> Every other character will be read and added verbatim into a string used as
>> uri for a given resource that ffurl_open_whitelist() will then handle.
>>
>> Create a text file with the following four entries
>>
>> foo\
>> bar.h264
>> foo'bar.h264
>> foo\bar.h264
>> foobar.h264
>>
>> Where only the line break is escaped to ensure it's not interpreted as a
>> resource name delimiter, and they will all be read and open if they exist.
> 
> I do not need you to explain this to me.

You asked what characters needed to be escaped, i answered and figured 
giving an example would help. If not for you, for someone else reading 
this thread.
I know well strings are your field of expertise and hardly mine. Don't 
wrongly assume the other person has ill intentions.

> 
>> There's no need for any escaping other than the delimiter character, so
>> wouldn't it be misleading linking to a document that will make you write
>> your entries in the file in a way that will not work?
> 
> The code and documentation must be compatible, of course.
> 
>> Said documentation will tell you that if you want to load foo'bar.h264 you
>> will need to write it as foo\'bar.h264, but that's not true here and will
> 
> That should be true, see below.
> 
>> Wont your request to use escaping functions result in the need for the
>> entries in the text file to start pointlessly escaping characters like
>> quotes, backslashes and others for no reason, as if this were bash?
> 
> My request results in using the same syntax we have developed and tuned
> for the rest of the project.
> 
> Having several subtly different rules for escaping in a single project
> is an abominable idea.

It's literally having a list of raw filenames in a file, where the 
delimiter character can be part of the filename and as such needs to be 
handled. I'm not writing a new language, or new escaping rules. I don't 
see how it's so unacceptable.

Can you point me in the right direction then? What functions should i 
use? How would the entries in the text file need to be written like in 
order for said functions to write all valid characters correctly in the 
output buffer? How will line breaks as part of the file name need be 
handled? A backslash before an actual line break like in this version, 
or will this mean the entries will need to look like something out of 
bash? If the latter, will these functions convert the sequence of the 
characters \ and n into a single 0x0A byte in the output buffer?

> 
> Regards,
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list