int last_addr, i;
int i;
static int find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){    ParseContext *pc= &s->parse_context;    int last_addr, i;    uint32_t state;//printf("first %02X%02X%02X%02X\n", buf[0], buf[1],buf[2],buf[3]);//    mb_addr= pc->mb_addr - 1;    state= pc->state;    //FIXME this will fail with slices    for(i=0; i<buf_size; i++){        state= (state<<8) | buf[i];        if((state&0xFFFFFF1F) == 0x101 || (state&0xFFFFFF1F) == 0x102 || (state&0xFFFFFF1F) == 0x105){            if(pc->frame_start_found){                pc->state=-1;                 pc->frame_start_found= 0;                return i-3;            }            pc->frame_start_found= 1;        }    }        pc->state= state;    return -1;}