[FFmpeg-devel] NC4600 camera code

Reimar Döffinger Reimar.Doeffinger
Sat Dec 13 17:46:18 CET 2008


On Sat, Dec 13, 2008 at 11:22:36AM -0500, nicolas martin wrote:
> +#ifdef CONFIG_NC4600_DEMUXER
> +static int nc4600_mpeg4video_probe(AVProbeData *probe_packet)
> +{
> +    uint32_t *p = (uint32_t*)probe_packet->buf;
> +    return (*p==0xA5010000)*1000;

That's ugly and won't work on (probably) bigendian systems.
return (AV_RL32(probe_packet->buf) == 0xA5010000)*1000;
does.

> +int nc4600_ident_packet(unsigned char *p)
> +{
> +    int size=0;
> +    uint32_t *q = (uint32_t*)p;
> +    if (*q==0xA5010000) {
> +        size = p[5] + p[6]*256;
> +    }
> +    return size;
> +}

Same issue here.




More information about the ffmpeg-devel mailing list