arts_free(); 
static int acntl(int request, void *arg){    int tmp, tmp1, samples;    switch(request)    {      case PM_REQ_DISCARD: /* Discard stream */	arts_close_stream(stream);	arts_free();	stream=NULL;	return 0;      case PM_REQ_RATE: /* Change sample rate */        arts_close_stream(stream);        tmp = (dpm.encoding & PE_16BIT) ? 16 : 8;        tmp1 = (dpm.encoding & PE_MONO) ? 1 : 2;        stream = arts_play_stream(*(int*)arg,		    LE_LONG(tmp),		    tmp1,		    "timidity");        server_buffer = arts_stream_get(stream, ARTS_P_SERVER_LATENCY) * dpm.rate * (tmp/8) * tmp1 / 1000;	return 0;      case PM_REQ_GETQSIZ: /* Get maximum queue size */	*(int*)arg = arts_stream_get(stream, ARTS_P_BUFFER_SIZE);	return 0;      case PM_REQ_SETQSIZ: /* Set queue size */	*(int*)arg = arts_stream_set(stream, ARTS_P_BUFFER_SIZE, *(int*)arg);	return 0;      case PM_REQ_GETFRAGSIZ: /* Get device fragment size */	*(int*)arg = arts_stream_get(stream, ARTS_P_PACKET_SIZE);	return 0;      case PM_REQ_GETSAMPLES: /* Get current play sample */	tmp = arts_stream_get(stream, ARTS_P_BUFFER_SIZE) -		         arts_stream_get(stream, ARTS_P_BUFFER_SPACE) +			 server_buffer;	samples = output_count - tmp;	if(samples < 0)	  samples = 0;	if(!(dpm.encoding & PE_MONO)) samples >>= 1;	if(dpm.encoding & PE_16BIT) samples >>= 1;	*(int*)arg = samples;	return 0;      case PM_REQ_GETFILLABLE: /* Get fillable device queue size */	*(int*)arg = arts_stream_get(stream, ARTS_P_BUFFER_SPACE);	return 0;      case PM_REQ_GETFILLED: /* Get filled device queue size */	*(int*)arg = arts_stream_get(stream, ARTS_P_BUFFER_SIZE) - arts_stream_get(stream, ARTS_P_BUFFER_SPACE);	return 0;      /* The following are not (yet) implemented: */      case PM_REQ_FLUSH: /* Wait until playback is complete */      case PM_REQ_MIDI: /* Send MIDI event */      case PM_REQ_INST_NAME: /* Get instrument name */      case PM_REQ_OUTPUT_FINISH: /* Sent after last output_data */      case PM_REQ_PLAY_START: /* Called just before playing */      case PM_REQ_PLAY_END: /* Called just after playing */	return -1;    }    return -1;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/b9a054f6fb8ff9d0552058f0ff9715922773931d/aRts_a.c/buggy/timidity/aRts_a.c