return had_error;
return 0;
int get_mp3_info(mp3info *mp3,int scantype, int fullscan_vbr){  int had_error = 0;  int frame_type[15]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};  float seconds=0,total_rate=0;  int frames=0,frame_types=0,frames_so_far=0;  int l,vbr_median=-1;  int bitrate,lastrate;  int counter=0;  mp3header header;  struct stat filestat;  off_t sample_pos,data_start=0;  stat(mp3->filename,&filestat);  mp3->datasize=filestat.st_size;  get_id3(mp3);  if(scantype == SCAN_QUICK) {	if(get_first_header(mp3,0L)) {		data_start=ftell(mp3->file);		lastrate=15-mp3->header.bitrate;		while((counter < NUM_SAMPLES) && lastrate) {			sample_pos=(counter*(mp3->datasize/NUM_SAMPLES+1))+data_start;			if(get_first_header(mp3,sample_pos)) {				bitrate=15-mp3->header.bitrate;			} else {				bitrate=-1;			}					if(bitrate != lastrate) {				mp3->vbr=1;				if(fullscan_vbr) {					counter=NUM_SAMPLES;					scantype=SCAN_FULL;				}			}			lastrate=bitrate;			counter++;					}	}	if(!(scantype == SCAN_FULL)) {		mp3->frames=(mp3->datasize-data_start)/(l=frame_length(&mp3->header));		mp3->seconds = (int)((float)(frame_length(&mp3->header)*mp3->frames)/			       (float)(header_bitrate(&mp3->header)*125)+0.5);		mp3->vbr_average = (float)header_bitrate(&mp3->header);	}  }  if(scantype == SCAN_FULL) {  	if(get_first_header(mp3,0L)) {		data_start=ftell(mp3->file);		while((bitrate=get_next_header(mp3))) {			frame_type[15-bitrate]++;			frames++;		}		memcpy(&header,&(mp3->header),sizeof(mp3header));		for(counter=0;counter<15;counter++) {			if(frame_type[counter]) {				frame_types++;				header.bitrate=counter;				frames_so_far += frame_type[counter];				seconds += (float)(frame_length(&header)*frame_type[counter])/				           (float)(header_bitrate(&header)*125);				total_rate += (float)((header_bitrate(&header))*frame_type[counter]);				if((vbr_median == -1) && (frames_so_far >= frames/2))					vbr_median=counter;			}		}		mp3->seconds=(int)(seconds+0.5);		mp3->header.bitrate=vbr_median;		mp3->vbr_average=total_rate/(float)frames;		mp3->frames=frames;		if(frame_types > 1) {			mp3->vbr=1;		}	}  }  return had_error;}