[FFmpeg-soc] [soc]: r243 - dirac/dirac_parser.c

Michael Niedermayer michaelni at gmx.at
Mon Jun 11 02:10:51 CEST 2007


Hi

On Sun, Jun 10, 2007 at 04:17:51PM +0200, marco wrote:
> Author: marco
> Date: Sun Jun 10 16:17:50 2007
> New Revision: 243
> 
> Log:
> Add Dirac parser
> 
> 
> Added:
>    dirac/dirac_parser.c
> 
> Added: dirac/dirac_parser.c
> ==============================================================================
> --- (empty file)
> +++ dirac/dirac_parser.c	Sun Jun 10 16:17:50 2007
[...]
> +#include "parser.h"
> +
> +#define DEBUG 1
> +
> +/**
> + * finds the end of the current frame in the bitstream.
> + * @return the position of the first byte of the next frame, or -1
> + */
> +static int find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size){
> +     uint32_t state;
> +
> +    /* Check if there is enough room for a Parse Info Header,
> +       otherwise stop.  */
> +    if (buf_size < 13)
> +        return END_NOT_FOUND;
> +
> +    state = pc->state;
> +
> +    if (pc->frame_start_found == 0) {
> +        /* next_parse_offset has the amount of bytes to the next frame.  */
> +        state = AV_RB32(buf + 5);
> +    }

this wont work, a parser can be feeded with arbitrary sized chunks, that is
buf_size could always be 1 for example


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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070611/52fc1449/attachment.pgp>


More information about the FFmpeg-soc mailing list