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

Michael Niedermayer michael at niedermayer.cc
Mon Apr 27 22:22:39 EEST 2020


On Sun, Apr 26, 2020 at 11:49:00PM +0000, Zane van Iperen wrote:
> On Sun, 26 Apr 2020 00:07:52 +0200
> "Michael Niedermayer" <michael at niedermayer.cc> wrote:
> 
> > 
> > also iam not sure it makes sense or if it goes to far but the probe
> > code could check all tracks which are within the buffer
> > all these low 10 scores are a bit ugly, some more solid "yes iam sure
> > this is / is not" instead of such really low scores.
> > 
> > low scores which get returned based on few weak checks have the
> > problem of more often producing errors in detection. Random non
> > multimedia files being detected as something they are not or if 2
> > demuxers have such a low score detection then its more likely the
> > wrong one will be choosen
> > 
> > 
> 
> How's this?
> 
> I've removed the "track_count > 113" check and made it
> all-or-nothing.
> 
> 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 || track_count > INT_MAX)
>         return 0;
> 
>     if ((sample_rate !=  5512) && (sample_rate != 11025) &&
>         (sample_rate != 22050) && (sample_rate != 44100))
>         return 0;
> 
>     /* Check the first track header. */
>     if (AV_RL32(p->buf + 28) != sample_rate)
>         return 0;
> 
>     if ((flags & ~PP_BNK_FLAG_MASK) != 0)
>         return 0;
> 
>     return AVPROBE_SCORE_MAX / 4 + 1;
> }

ok until someone sees a way to improve this

thx


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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20200427/087c5020/attachment.sig>


More information about the ffmpeg-devel mailing list