current_keysig = opt_init_keysig; 
current_keysig = (opt_init_keysig == 8) ? 0 : opt_init_keysig; 
static void ctl_pass_playing_list(int n, char *args[]){	double btime;	int i, j;#ifdef SIGPIPE	signal(SIGPIPE, SIG_IGN);    /* Handle broken pipe */#endif /* SIGPIPE */	printf("TiMidity starting in ALSA server mode\n");	set_realtime_priority();	if (alsa_seq_open(&alsactx.handle) < 0) {		fprintf(stderr, "error in snd_seq_open\n");		return;	}	alsactx.queue = -1;	alsactx.client = snd_seq_client_id(alsactx.handle);	alsactx.fd = snd_seq_file_descriptor(alsactx.handle);	snd_seq_set_client_name(alsactx.handle, "TiMidity");	snd_seq_set_client_pool_input(alsactx.handle, 1000); /* enough? */	if (opt_sequencer_ports < 1)		alsactx.num_ports = 1;	else if (opt_sequencer_ports > MAX_PORTS)		alsactx.num_ports = MAX_PORTS;	else		alsactx.num_ports = opt_sequencer_ports;	printf("Opening sequencer port:");	for (i = 0; i < alsactx.num_ports; i++) {		int port;		port = alsa_create_port(alsactx.handle, i);		if (port < 0)			return;		alsactx.port[i] = port;		alsa_set_timestamping(&alsactx, port);		printf(" %d:%d", alsactx.client, alsactx.port[i]);	}	printf("\n");	alsactx.used = 0;	alsactx.active = 0;	opt_realtime_playing = 1; /* Enable loading patch while playing */	allocate_cache_size = 0; /* Don't use pre-calclated samples */	current_keysig = opt_init_keysig;	note_key_offset = 0;	if (IS_STREAM_TRACE) {		/* set the audio queue size as minimum as possible, since		 * we don't have to use audio queue..		 */		play_mode->acntl(PM_REQ_GETFRAGSIZ, &buffer_time_advance);		if (!(play_mode->encoding & PE_MONO))			buffer_time_advance >>= 1;		if (play_mode->encoding & PE_16BIT)			buffer_time_advance >>= 1;		btime = (double)buffer_time_advance / play_mode->rate;		btime *= 1.01; /* to be sure */		aq_set_soft_queue(btime, 0.0);	} else {		buffer_time_advance = 0;	}	rate_frac = (double)play_mode->rate / 1000000.0;	rate_frac_nsec = (double)play_mode->rate / 1000000000.0;	alarm(0);	signal(SIGALRM, sig_timeout);	signal(SIGINT, safe_exit);	signal(SIGTERM, safe_exit);	signal(SIGHUP, sig_reset);	if (opt_force_keysig != 8) {		i = current_keysig + ((current_keysig < 8) ? 7 : -6);		j = opt_force_keysig + ((current_keysig < 8) ? 7 : 10);		while (i != j && i != j + 12) {			if (++note_key_offset > 6)				note_key_offset -= 12;			i += (i > 10) ? -5 : 7;		}	}	i = current_keysig + ((current_keysig < 8) ? 7 : -9), j = 0;	while (i != 7 && i != 19)		i += (i < 7) ? 5 : -7, j++;	j += note_key_offset, j -= floor(j / 12.0) * 12;	current_freq_table = j;	play_mode->close_output();	if (ctl.flags & CTLF_DAEMONIZE)	{		int pid = fork();		FILE *pidf;		switch (pid)		{			case 0:			// child is the daemon				break;			case -1:		// error status return				exit(7);			default:		// no error, doing well				if ((pidf = fopen( "/var/run/timidity.pid", "w" )) != NULL )					fprintf( pidf, "%d\n", pid );				exit(0);		}	}	for (;;) {		server_reset();		doit(&alsactx);	}}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/6e735c2764b7b157d0d160045412a4c2cdcead39/alsaseq_c.c/buggy/interface/alsaseq_c.c