Look inside the file (with libmagic) to determined file-type
Brought to you by:
jmaggard
Currently minidlna determines the file-type based on the filename extension. Although faster, this is a MS-DOS/Windows way :-)
Perhaps, using libmagic(3) API should be an option? The attached patch provides a simple-minded illustration -- if the use of libmagic is deemed a good idea, things would have to be rearranged to avoid re-opening the file multiple times (as is done by magic_file(3)).
Also, libmagic's results can be used to set the mime-type for the accepted files...
Sample implementation of is_image() and friends using libmagic(3) API