rem: echo_stream *pstream, *rstream;
add: echo_stream *pstream, *rstream, *stream;
context: echo_buffer_exchange(echo_dev *card, multi_buffer_info *data){	cpu_status status;	echo_stream *pstream, *rstream;	data->flags = B_MULTI_BUFFER_PLAYBACK | B_MULTI_BUFFER_RECORD;		if (!(card->pstream->state & ECHO_STATE_STARTED))		echo_stream_start(card->pstream, echo_play_inth, card->pstream);	if (!(card->pstream2->state & ECHO_STATE_STARTED))                echo_stream_start(card->pstream2, echo_play_inth, card->pstream2);	if (!(card->rstream->state & ECHO_STATE_STARTED))		echo_stream_start(card->rstream, echo_record_inth, card->rstream);	if(acquire_sem_etc(card->buffer_ready_sem, 1, B_RELATIVE_TIMEOUT | B_CAN_INTERRUPT, 50000)		== B_TIMED_OUT) {		LOG(("buffer_exchange timeout ff\n"));	}		status = lock();		LIST_FOREACH(pstream, &card->streams, next) {		if ((pstream->use & ECHO_USE_PLAY) == 0 || 			(pstream->state & ECHO_STATE_STARTED) == 0)			continue;		if(pstream->update_needed)				break;	}		LIST_FOREACH(rstream, &card->streams, next) {		if ((rstream->use & ECHO_USE_RECORD) == 0 ||			(rstream->state & ECHO_STATE_STARTED) == 0)			continue;		if(rstream->update_needed)				break;	}		if(!pstream)		pstream = card->pstream;	if(!rstream)		rstream = card->rstream;		/* do playback */	data->playback_buffer_cycle = pstream->buffer_cycle;	data->played_real_time = pstream->real_time;	data->played_frames_count = pstream->frames_count;	data->_reserved_0 = pstream->first_channel;	pstream->update_needed = false;		/* do record */	data->record_buffer_cycle = rstream->buffer_cycle;	data->recorded_frames_count = rstream->frames_count;	data->recorded_real_time = rstream->real_time;	data->_reserved_1 = rstream->first_channel;	rstream->update_needed = false;	unlock(status);		//TRACE(("buffer_exchange ended\n"));	return B_OK;}