[FFmpeg-devel] Fwd: [PATCH] Psygnosis YOP demuxer

Diego Biurrun diego
Sat Dec 26 22:02:58 CET 2009


On Sat, Dec 26, 2009 at 11:22:15PM +0530, Mohamed Naufal wrote:
> 2009/12/26 Diego Biurrun <diego at biurrun.de>
> 
> [...]
> > > --- libavformat/yop.c (revision 0)
> > > +++ libavformat/yop.c (revision 0)
> > > @@ -0,0 +1,175 @@
> > > +
> > > +static int yop_probe(AVProbeData *probe_packet)
> > > +{
> > > +    if (AV_RB16(probe_packet->buf) == AV_RB16("YO") &&
> > > +        !(AV_RL16(probe_packet->buf + 8) & 1) &&
> > !(AV_RL16(probe_packet->buf + 10) & 1))
> > > +        return AVPROBE_SCORE_MAX / 2 + 1;
> >
> > You no longer check probe_packet->buf[6] and [7]?
> >
> Changed (probe_packet->buf[6]  != 0) to probe_packet->buf[6]

It had disappeared from previous versions, which had made me
suspicious..

> --- libavformat/yop.c	(revision 0)
> +++ libavformat/yop.c	(revision 0)
> @@ -0,0 +1,175 @@
> +
> +static int yop_probe(AVProbeData *probe_packet)
> +{
> +    if (AV_RB16(probe_packet->buf) == AV_RB16("YO") &&
> +        probe_packet->buf[6] && probe_packet->buf[7] &&
> +        !(AV_RL16(probe_packet->buf + 8) & 1) && !(AV_RL16(probe_packet->buf + 10) & 1))

Optionally, for extra readability:

  if (AV_RB16(probe_packet->buf) == AV_RB16("YO")  &&
      probe_packet->buf[6] && probe_packet->buf[7] &&
      !(AV_RL16(probe_packet->buf +  8) & 1)       && 
      !(AV_RL16(probe_packet->buf + 10) & 1))

or

  if (AV_RB16(probe_packet->buf) == AV_RB16("YO")  &&
      probe_packet->buf[6]                         &&
      probe_packet->buf[7]                         &&
      !(AV_RL16(probe_packet->buf +  8) & 1)       && 
      !(AV_RL16(probe_packet->buf + 10) & 1))

But that's my last comment, I promise! Also, wait for Michael's review
before making changes. I'd be very surprised if he didn't have more
things to say..

Diego



More information about the ffmpeg-devel mailing list