static int mjpeg_decode_com(MJpegDecodeContext *s)

{

    int i;

    UINT8 *cbuf;



    /* XXX: verify len field validity */

    unsigned int len = get_bits(&s->gb, 16)-2;

    cbuf = av_malloc(len+1);



    for (i = 0; i < len; i++)

	cbuf[i] = get_bits(&s->gb, 8);

    if (cbuf[i-1] == '\n')

	cbuf[i-1] = 0;

    else

	cbuf[i] = 0;



    printf("mjpeg comment: '%s'\n", cbuf);



    /* buggy avid, it puts EOI only at every 10th frame */

    if (!strcmp(cbuf, "AVID"))

    {

	s->buggy_avid = 1;

//	if (s->first_picture)

//	    printf("mjpeg: workarounding buggy AVID\n");

    }

    

    av_free(cbuf);



    return 0;

}

static int mjpeg_decode_com(MJpegDecodeContext *s)

{

    int i;

    UINT8 *cbuf;



    

    unsigned int len = get_bits(&s->gb, 16)-2;

    cbuf = av_malloc(len+1);



    for (i = 0; i < len; i++)

	cbuf[i] = get_bits(&s->gb, 8);

    if (cbuf[i-1] == '\n')

	cbuf[i-1] = 0;

    else

	cbuf[i] = 0;



    printf("mjpeg comment: '%s'\n", cbuf);



    

    if (!strcmp(cbuf, "AVID"))

    {

	s->buggy_avid = 1;





    }

    

    av_free(cbuf);



    return 0;

}

static int FUNC_0(MJpegDecodeContext *VAR_0)

{

    int VAR_1;

    UINT8 *cbuf;



    

    unsigned int VAR_2 = get_bits(&VAR_0->gb, 16)-2;

    cbuf = av_malloc(VAR_2+1);



    for (VAR_1 = 0; VAR_1 < VAR_2; VAR_1++)

	cbuf[VAR_1] = get_bits(&VAR_0->gb, 8);

    if (cbuf[VAR_1-1] == '\n')

	cbuf[VAR_1-1] = 0;

    else

	cbuf[VAR_1] = 0;



    printf("mjpeg comment: '%VAR_0'\n", cbuf);



    

    if (!strcmp(cbuf, "AVID"))

    {

	VAR_0->buggy_avid = 1;





    }

    

    av_free(cbuf);



    return 0;

}

static int FUNC_0(MJpegDecodeContext *VAR_0)
{ int VAR_1; UINT8 *cbuf; unsigned int VAR_2 = get_bits(&VAR_0->gb, 16)-2; cbuf = av_malloc(VAR_2+1); for (VAR_1 = 0; VAR_1 < VAR_2; VAR_1++) cbuf[VAR_1] = get_bits(&VAR_0->gb, 8); if (cbuf[VAR_1-1] == '\n')
cbuf[VAR_1-1] = 0; else
cbuf[VAR_1] = 0; printf("mjpeg comment: '%VAR_0'\n", cbuf); if (!strcmp(cbuf, "AVID"))
{ VAR_0->buggy_avid = 1; } av_free(cbuf); return 0; }