offset+=packet_size+1; } return buf_size;
return packet_size;
static int amr_nb_decode_frame(AVCodecContext * avctx,            void *data, int *data_size,            uint8_t * buf, int buf_size){    AMRContext *s = (AMRContext*)avctx->priv_data;    uint8_t*amrData=buf;    int offset=0;    static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };    enum Mode dec_mode;    int packet_size;    //printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);    while(offset<buf_size)    {    	dec_mode = (amrData[offset] >> 3) & 0x000F;    	packet_size = block_size[dec_mode];            s->frameCount++;        //printf("offset=%d, packet_size=%d amrData= 0x%X %X %X %X\n",offset,packet_size,amrData[offset],amrData[offset+1],amrData[offset+2],amrData[offset+3]);    	/* call decoder */    	Decoder_Interface_Decode(s->decState, &amrData[offset], data+*data_size, 0);    	*data_size+=160*2;           offset+=packet_size+1;     }    return buf_size;}