libmodplug
libmodplug copied to clipboard
Implement probing for FFmpeg
FFmpeg relies on libraries probing capabilities do detect if a file is in a format supported by the library. Please implement probing for file formats supported by libmodplug, so FFmpeg is able to detect mod files with invalid extension. See https://trac.ffmpeg.org/ticket/2583 & https://trac.ffmpeg.org/ticket/4153
Here's how ffmpeg does probing:
- the application sends libavformat a small memory buffer containing the start of the file being probed (the buffer doesn't necessarily contain the whole file)
- the probe function returns a detection score
- this score is compared to other probers
- if the score is not high enough, it retries with a larger probe buffer (up until a maximum size)
So what libmodplug should provide is a function that checks a buffer whether it contains a known file header.