]> git.sesse.net Git - ffmpeg/commit
avformat/libopenmpt: Probe file format from file data if possible
authorJörn Heusipp <osmanx@problemloesungsmaschine.de>
Wed, 21 Feb 2018 11:11:48 +0000 (12:11 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 20 Mar 2018 21:59:40 +0000 (22:59 +0100)
commitf6ea397d0ae4e4188e90deecbcffd1cf5419c110
tree6256685c8001c9aed2c6ec4464f4fe9c6cb6935a
parent81b0d591d690f518c01c45d7ce20fdca1de80d80
avformat/libopenmpt: Probe file format from file data if possible

When building with libopenmpt 0.3, use the libopenmpt file header
probing functions for probing. libopenmpt probing functions are
allocation-free and designed to be as fast as possible.

For libopenmpt 0.2, or when libopenmpt 0.3 file header probing cannot
probe successfully due to too small probe buffer, test the filename
against the file extensions supported by the libopenmpt library that
is actually linked, instead of relying on a hard-coded file extension
list. File extension testing is also allocation-free and designed to
be fast in libopenmpt. Avoiding a hard-coded file extension list is
useful because later libopenmpt versions will likely add support for
more module file formats.

libopenmpt file header probing is tested regularly against the FATE
suite and other diverse file collections by libopenmpt upstream in
order to avoid false positives.

FATE passes with './configure --enable-libopenmpt' as well as with
'./configure --enable-libopenmpt --enable-libmodplug'.

libopenmpt probing adds about 5%..10% cpu time (depending on precise
usage pattern and host CPU and compiler version used for libopenmpt)
compared to all current internal FFmpeg probing functions combined in
tools/probetest for all of its module formats combined (currently 41
modules formats in libopenmpt 0.3.4 and 234 file formats in FFmpeg).

Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/libopenmpt.c