[FFmpeg-devel] [PATCH v5 2/2] avformat: add demuxer for Pro Pinball Series' Soundbanks

Michael Niedermayer michael at niedermayer.cc
Sun Mar 29 19:21:37 EEST 2020


On Sun, Mar 29, 2020 at 01:30:36PM +0000, Zane van Iperen wrote:
[...]

> +static int pp_bnk_probe(const AVProbeData *p)
> +{
> +    uint32_t sample_rate = AV_RL32(p->buf +  4);
> +    uint32_t track_count = AV_RL32(p->buf + 12);
> +    uint32_t flags       = AV_RL32(p->buf + 16);
> +
> +    if (track_count == 0 || sample_rate == 0)
> +        return 0;
> +
> +    /* Sometimes we have the first track header, so check that too. */
> +    if (p->buf_size >= 32 && AV_RL32(p->buf + 28) != sample_rate)
> +        return 0;
> +
> +    /* These limits are based on analysing the game files. */
> +    if (track_count > 113 || sample_rate > 44100)
> +        return 10;
> +
> +    if ((flags & ~PP_BNK_FLAG_MASK) != 0)
> +        return 10;
> +
> +    return AVPROBE_SCORE_MAX / 4 + 1;
> +}

Fails 
tools/probetest 256 4096
testing size=1
testing size=2
testing size=4
testing size=8
testing size=16
Failure of pp_bnk probing code with score=26 type=0 p=EB2 size=16
testing size=32
testing size=64
testing size=128
testing size=256
testing size=512
testing size=1024
testing size=2048

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200329/d1df3ae4/attachment.sig>


More information about the ffmpeg-devel mailing list