X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmusx.c;h=fd5a9297f9b31650b76d16164570691d843db430;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=aff6c31a86a22034810c6f5cdbcfcf1e739eae0a;hpb=64425e005edf3bdd77c34c078c3e74ab5ecef557;p=ffmpeg diff --git a/libavformat/musx.c b/libavformat/musx.c index aff6c31a86a..fd5a9297f9b 100644 --- a/libavformat/musx.c +++ b/libavformat/musx.c @@ -20,12 +20,23 @@ */ #include "libavutil/avassert.h" +#include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" -static int musx_probe(AVProbeData *p) +static int musx_probe(const AVProbeData *p) { - if (memcmp(p->buf, "MUSX", 4)) + unsigned version; + + if (AV_RB32(p->buf) != MKBETAG('M','U','S','X')) + return 0; + + version = AV_RL32(p->buf + 8); + if (version != 10 && + version != 6 && + version != 5 && + version != 4 && + version != 201) return 0; return AVPROBE_SCORE_MAX / 5 * 2; @@ -167,7 +178,7 @@ static int musx_read_packet(AVFormatContext *s, AVPacket *pkt) return av_get_packet(s->pb, pkt, par->block_align); } -AVInputFormat ff_musx_demuxer = { +const AVInputFormat ff_musx_demuxer = { .name = "musx", .long_name = NULL_IF_CONFIG_SMALL("Eurocom MUSX"), .read_probe = musx_probe,