[FFmpeg-devel] [PATCH] avformat/file: Fix handing of file URIs

Nicolas George george at nsup.org
Thu Nov 24 20:12:46 EET 2022


Nick Sarnie (12022-11-24):
> The current URI handling only removes the file: prefix, but we also need to
> consider the case of percent encoding.
> Percent encoding can happen with non-ASCII characters in the path.

NAK, this is a huge compatibility break.

But this fix is necessary, you are right.

What needs to happen to handle this correctly:

- Introduce a “fs:” protocol as a synonym to file:.

- Change “file:” (but not “fs:”!) to detect if the rest of the path
  looks like a real file URL or a raw file path.

  - If it looks like a real file URL, de-percent-escape it.

  - If it looks like a raw file path, treat it the legacy way after
    printing a warning.

- In a few years, remove the heuristics and always handle “file:” in the
  standards-compliant way.

I believe we can ignore incomplete / relative file:// URLs in the
transition period. The triple / would be a very reliable way of
identification.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20221124/b6c826ef/attachment.sig>


More information about the ffmpeg-devel mailing list