Hi,

On Sun, Jan 8, 2012 at 6:00 PM,  <[email protected]> wrote:
> +static int probe(AVProbeData *p)
> +{
> +    if (AV_RB32(p->buf) == PACKET_SIGNATURE)
> +        return AVPROBE_SCORE_MAX-2;

Not max?

> +    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
> +    st->codec->codec_id = CODEC_ID_VP3;
> +    avio_skip(s->pb, 28);
> +    st->duration = avio_rb32(s->pb);
> +    avpriv_set_pts_info(st, 32, 1, av_int2float(avio_rb32(s->pb)));  /* 
> framerate is a float */
> +    st->codec->width = avio_rb32(s->pb);
> +    st->codec->height = avio_rb32(s->pb);
> +    avio_skip(s->pb, 12);
> +    st->codec->codec_tag = avio_rb32(s->pb);  /* read it backwards so it's 
> in the right order */
> +    st->codec->pix_fmt = PIX_FMT_YUV420P;

I'm not sure demuxers should set the pixfmt, that's a decoder thing,
not a demuxer thing, imo.

> +    header = avio_rb32(s->pb);
> +    packet_size = avio_rb32(s->pb);
> +    avio_rb32(s->pb);
> +    payload_size = avio_rb32(s->pb);
> +
> +    if (header != PACKET_SIGNATURE)
> +        ret = AVERROR_INVALIDDATA;
> +
> +    pkt->pos = avio_tell(s->pb);
> +    ret = av_get_packet(s->pb, pkt, payload_size);

You're overwriting the ret of the above error handler. I think some
people have said that we should error out on invalid signatures, e.g.
if people force a demuxer, so we shouldn't check the signature at all,
probably.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to