static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,

                      const uint8_t **poutbuf, int *poutbuf_size,

                      const uint8_t *buf, int buf_size)

{

    CookParseContext *s = s1->priv_data;



    if (s->duration)

        s1->duration = s->duration;

    else if (avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)

        s->duration = AV_RB16(avctx->extradata + 4) / avctx->channels;



    /* always return the full packet. this parser isn't doing any splitting or

       combining, only setting packet duration */

    *poutbuf      = buf;

    *poutbuf_size = buf_size;

    return buf_size;

}

static int cook_parse(AVCodecParserContext *s1, AVCodecContext *avctx,

                      const uint8_t **poutbuf, int *poutbuf_size,

                      const uint8_t *buf, int buf_size)

{

    CookParseContext *s = s1->priv_data;



    if (s->duration)

        s1->duration = s->duration;

    else if (avctx->extradata && avctx->extradata_size >= 8 && avctx->channels)

        s->duration = AV_RB16(avctx->extradata + 4) / avctx->channels;



    



    *poutbuf      = buf;

    *poutbuf_size = buf_size;

    return buf_size;

}

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)

{

    CookParseContext *s = VAR_0->priv_data;



    if (s->duration)

        VAR_0->duration = s->duration;

    else if (VAR_1->extradata && VAR_1->extradata_size >= 8 && VAR_1->channels)

        s->duration = AV_RB16(VAR_1->extradata + 4) / VAR_1->channels;



    



    *VAR_2      = VAR_4;

    *VAR_3 = VAR_5;

    return VAR_5;

}

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)
{ CookParseContext *s = VAR_0->priv_data; if (s->duration)
VAR_0->duration = s->duration; else if (VAR_1->extradata && VAR_1->extradata_size >= 8 && VAR_1->channels)
s->duration = AV_RB16(VAR_1->extradata + 4) / VAR_1->channels; *VAR_2      = VAR_4; *VAR_3 = VAR_5; return VAR_5; }