filters/portaudio/pasink.c
/**
 * send the float data into the output buffer provided by pa_audio
 * TODO: just call memcpy()
 */
send the float data into the output buffer provided by pa_audio
TODO: just call memcpy()
send the float data into the output buffer provided by pa_audio TODO : just call memcpy ()
static int pa_output_callback(	const void *inputBuffer, void *outputBuffer,
	                            unsigned long framesPerBuffer,
	                            const PaStreamCallbackTimeInfo* timeInfo,
	                            PaStreamCallbackFlags statusFlags,
	                            void *userData ) {
	pa_output_data *data = (pa_output_data*)userData;
	float *out = (float*)outputBuffer;
	int locked = data->buffer_index;
	(void) timeInfo; 
	(void) statusFlags;
	(void) inputBuffer;
	LOCK(&data->reading[locked]);
	memcpy(out, data->buffers[data->buffer_index], data->buffer_size * sizeof(float));
	data->dirty[data->buffer_index] = 0;
	data->buffer_index = (data->buffer_index + 1) % BUFFERS;
	UNLOCK(&data->reading[locked]);
	UNLOCK(&data->writing[locked]);
	return paContinue;
}
static int pa_output_callback ( const void * inputBuffer , void * outputBuffer , unsigned long framesPerBuffer , const PaStreamCallbackTimeInfo * timeInfo , PaStreamCallbackFlags statusFlags , void * userData ) { pa_output_data * data = ( pa_output_data * ) userData ; float * out = ( float * ) outputBuffer ; int locked = data -> buffer_index ; ( void ) timeInfo ; ( void ) statusFlags ; ( void ) inputBuffer ; LOCK ( & data -> reading [ locked ] ) ; memcpy ( out , data -> buffers [ data -> buffer_index ] , data -> buffer_size * sizeof ( float ) ) ; data -> dirty [ data -> buffer_index ] = 0 ; data -> buffer_index = ( data -> buffer_index + 1 ) % BUFFERS ; UNLOCK ( & data -> reading [ locked ] ) ; UNLOCK ( & data -> writing [ locked ] ) ; return paContinue ; }
send the float data into the output buffer provided by pa_audio
 TODO: just call memcpy()
send the float data into the output buffer provided by pa_audio TODO : just call memcpy ()
/* Prevent unused variable warnings. */ /* this buffer is no longer dirty */