static int mpegvideo_parse(AVCodecParserContext *s,

                           AVCodecContext *avctx,

                           const uint8_t **poutbuf, int *poutbuf_size,

                           const uint8_t *buf, int buf_size)

{

    ParseContext1 *pc1 = s->priv_data;

    ParseContext *pc= &pc1->pc;

    int next;



    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){

        next= buf_size;

    }else{

        next= ff_mpeg1_find_frame_end(pc, buf, buf_size);



        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {

            *poutbuf = NULL;

            *poutbuf_size = 0;

            return buf_size;

        }



    }

    /* we have a full frame : we just parse the first few MPEG headers

       to have the full timing information. The time take by this

       function should be negligible for uncorrupted streams */

    mpegvideo_extract_headers(s, avctx, buf, buf_size);

#if 0

    printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",

           s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);

#endif



    *poutbuf = buf;

    *poutbuf_size = buf_size;

    return next;

}

static int mpegvideo_parse(AVCodecParserContext *s,

                           AVCodecContext *avctx,

                           const uint8_t **poutbuf, int *poutbuf_size,

                           const uint8_t *buf, int buf_size)

{

    ParseContext1 *pc1 = s->priv_data;

    ParseContext *pc= &pc1->pc;

    int next;



    if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){

        next= buf_size;

    }else{

        next= ff_mpeg1_find_frame_end(pc, buf, buf_size);



        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {

            *poutbuf = NULL;

            *poutbuf_size = 0;

            return buf_size;

        }



    }

    





    mpegvideo_extract_headers(s, avctx, buf, buf_size);

#if 0

    printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",

           s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);

#endif



    *poutbuf = buf;

    *poutbuf_size = buf_size;

    return next;

}

static int FUNC_0(AVCodecParserContext *VAR_0,

                           AVCodecContext *VAR_1,

                           const uint8_t **VAR_2, int *VAR_3,

                           const uint8_t *VAR_4, int VAR_5)

{

    ParseContext1 *pc1 = VAR_0->priv_data;

    ParseContext *pc= &pc1->pc;

    int VAR_6;



    if(VAR_0->flags & PARSER_FLAG_COMPLETE_FRAMES){

        VAR_6= VAR_5;

    }else{

        VAR_6= ff_mpeg1_find_frame_end(pc, VAR_4, VAR_5);



        if (ff_combine_frame(pc, VAR_6, &VAR_4, &VAR_5) < 0) {

            *VAR_2 = NULL;

            *VAR_3 = 0;

            return VAR_5;

        }



    }

    





    mpegvideo_extract_headers(VAR_0, VAR_1, VAR_4, VAR_5);

#if 0

    printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",

           VAR_0->pict_type, (double)VAR_1->time_base.den / VAR_1->time_base.num, VAR_0->repeat_pict);

#endif



    *VAR_2 = VAR_4;

    *VAR_3 = VAR_5;

    return VAR_6;

}

static int FUNC_0(AVCodecParserContext *VAR_0,
AVCodecContext *VAR_1,
const uint8_t **VAR_2, int *VAR_3,
const uint8_t *VAR_4, int VAR_5)
{ ParseContext1 *pc1 = VAR_0->priv_data; ParseContext *pc= &pc1->pc; int VAR_6; if(VAR_0->flags & PARSER_FLAG_COMPLETE_FRAMES){ VAR_6= VAR_5; }else{ VAR_6= ff_mpeg1_find_frame_end(pc, VAR_4, VAR_5); if (ff_combine_frame(pc, VAR_6, &VAR_4, &VAR_5) < 0) { *VAR_2 = NULL; *VAR_3 = 0; return VAR_5; } } mpegvideo_extract_headers(VAR_0, VAR_1, VAR_4, VAR_5); #if 0
printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
VAR_0->pict_type, (double)VAR_1->time_base.den / VAR_1->time_base.num, VAR_0->repeat_pict); #endif
*VAR_2 = VAR_4; *VAR_3 = VAR_5; return VAR_6; }