mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-26 13:48:38 -05:00
PortAudio adjustments for OSX
Seems to be some sort of audio init race condition, intermittent crash on startup
This commit is contained in:
parent
b70b659a5f
commit
14d7e431bd
@ -77,8 +77,7 @@ else (DEFINED WIN32)
|
||||
|
||||
set(FFTW_LIB fftw3)
|
||||
|
||||
find_package (OpenAL)
|
||||
include_directories ( ${OPENAL_INCLUDE_DIR} )
|
||||
SET (PORTAUDIO_LIBRARY portaudio)
|
||||
endif (DEFINED WIN32)
|
||||
|
||||
|
||||
|
@ -15,7 +15,9 @@
|
||||
#include "AppFrame.h"
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef WIN32
|
||||
#include "pa_debugprint.h"
|
||||
#endif
|
||||
|
||||
wxString glGetwxString(GLenum name) {
|
||||
const GLubyte *v = glGetString(name);
|
||||
@ -109,10 +111,14 @@ static int patestCallback(const void *inputBuffer, void *outputBuffer, unsigned
|
||||
|
||||
TestGLCanvas *src = (TestGLCanvas *) userData;
|
||||
|
||||
float *out = (float*) outputBuffer;
|
||||
|
||||
if (!src->audio_queue.size()) {
|
||||
for (int i = 0; i < framesPerBuffer * 2; i++) {
|
||||
out[i] = 0;
|
||||
}
|
||||
return paContinue;
|
||||
}
|
||||
float *out = (float*) outputBuffer;
|
||||
|
||||
std::vector<float> *nextBuffer = src->audio_queue.front();
|
||||
|
||||
@ -161,7 +167,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, int *attribList) :
|
||||
std::cout << "Error starting :(\n";
|
||||
}
|
||||
|
||||
outputParameters.device = 5; /* default output device */
|
||||
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
|
||||
if (outputParameters.device == paNoDevice) {
|
||||
std::cout << "Error: No default output device.\n";
|
||||
}
|
||||
|
@ -12,7 +12,9 @@
|
||||
#include "liquid/liquid.h"
|
||||
|
||||
#include "portaudio.h"
|
||||
#ifdef WIN32
|
||||
#include "pa_stream.h"
|
||||
#endif
|
||||
|
||||
class PrimaryGLContext: public wxGLContext {
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user