

//*********************************************************
//decode in_buf to out_buf
#define MP3_ERR -1
#define MP3_OK  0
#define MP3_NEED_MORE 1


int status;
struct mpstr mp;
InitMP3(&mp);
int inlen;
inlen=21759;
int outlen;
outlen=0;
int OUT_BUF_SIZE;
OUT_BUF_SIZE=50000000;

char *bufin;
bufin=(char*)((uptrszint)((&(((uint8*)(__ARRAY_UBYTE_IN_BUF[0]))[array_check(( 0 )-__ARRAY_UBYTE_IN_BUF[4],__ARRAY_UBYTE_IN_BUF[5])]))));
char *bufout;
bufout=(char*)((uptrszint)((&(((uint8*)(__ARRAY_UBYTE_OUT_BUF[0]))[array_check(( 0 )-__ARRAY_UBYTE_OUT_BUF[4],__ARRAY_UBYTE_OUT_BUF[5])]))));


status = decodeMP3(&mp,bufin,inlen,bufout,OUT_BUF_SIZE,&outlen);
bufout+=outlen;

ddd:

status = decodeMP3(&mp,NULL,0,bufout,OUT_BUF_SIZE,&outlen);
bufout+=outlen;

if ((status==0)&&(outlen!=0)) goto ddd;

//status = decodeMP3(&mp,buf,len,out,8192,&size);
/*

while(1) {
37	      len = read(0,buf,16384);
38	      if(len <= 0)
39	         break;
40	      ret = decodeMP3(&mp,buf,len,out,8192,&size);
41	      while(ret == MP3_OK) {
42	         write(1,out,size);
43	         ret = decodeMP3(&mp,NULL,0,out,8192,&size);
44	      }
45	   }







	// Initialize buffer
	status = decodeMP3(&mp,bufin,inlen,bufout,OUT_BUF_SIZE,&outlen);
qbs_print(qbs_str(status),1);
qbs_print(qbs_str(outlen),1);

	// Decode buffer
//	status = decodeMP3(&mp,NULL,0,bufout,OUT_BUF_SIZE,&outlen);
status = decodeMP3(&mp,NULL,0,bufout,OUT_BUF_SIZE,&outlen);
qbs_print(qbs_str(status),1);
qbs_print(qbs_str(outlen),1);
*/
