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

Zane van Iperen zane at zanevaniperen.com
Sun Mar 29 19:40:51 EEST 2020


On Sun, 29 Mar 2020 18:21:37 +0200
"Michael Niedermayer" <michael at niedermayer.cc> wrote:

> 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
> 

I did not know that tool existed!

Have fixed the problem by checking for the specific sample
rates found in those files.

Would sending a v6 so soon after the v5 be considered spamming?

Thanks,
Zane

> thx
> 
> [...]
> --
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> What does censorship reveal? It reveals fear. -- Julian Assange
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list