• Jörn Heusipp's avatar
    avformat/libopenmpt: Probe file format from file data if possible · f6ea397d
    Jörn Heusipp authored
    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: 's avatarJörn Heusipp <osmanx@problemloesungsmaschine.de>
    Reviewed-by: 's avatarJosh de Kock <josh@itanimul.li>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    f6ea397d
libopenmpt.c 11 KB