put addPCM call in stream_read rather than stdout_callback

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@909 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2008-03-28 02:59:50 +00:00
parent c94cd74840
commit 397a45d11d
2 changed files with 9 additions and 4 deletions

View File

@ -330,8 +330,12 @@ void QPulseAudioThread::stream_read_callback ( pa_stream *s, size_t length, void
return;
}
buffer = ( float* ) pa_xmalloc ( buffer_length = length );
memcpy ( buffer, data, length );
(*s_qprojectM_MainWindowPtr)->addPCM( (float*)data, length / ( sizeof ( float ) ) );
//buffer = ( float* ) pa_xmalloc ( buffer_length = length );
//memcpy ( buffer, data, length );
buffer_index = 0;
pa_stream_drop ( s );
}
@ -678,7 +682,7 @@ void QPulseAudioThread::run()
#ifdef SIGPIPE
signal ( SIGPIPE, SIG_IGN );
#endif
/*
if ( ! ( stdio_event = mainloop_api->io_new ( mainloop_api,
STDOUT_FILENO,
PA_IO_EVENT_OUTPUT,
@ -687,7 +691,7 @@ void QPulseAudioThread::run()
fprintf ( stderr, "io_new() failed.\n" );
goto quit;
}
/*
/* Create a new connection context */
if ( ! ( context = pa_context_new ( mainloop_api, client_name ) ) )
{

View File

@ -12,6 +12,7 @@ else(${CMAKE_PROJECT_NAME} MATCHES "PROJECTM_ROOT")
pkg_search_module(LIBPROJECTM REQUIRED libprojectM)
endif(${CMAKE_PROJECT_NAME} MATCHES "PROJECTM_ROOT")
find_package(Qt4 REQUIRED) # find and setup Qt4 for this project
include(${QT_USE_FILE})