mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-02 13:35:33 +00:00
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:
@ -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 ) ) )
|
||||
{
|
||||
|
||||
@ -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})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user