mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-22 19:58:39 -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)
|
set(FFTW_LIB fftw3)
|
||||||
|
|
||||||
find_package (OpenAL)
|
SET (PORTAUDIO_LIBRARY portaudio)
|
||||||
include_directories ( ${OPENAL_INCLUDE_DIR} )
|
|
||||||
endif (DEFINED WIN32)
|
endif (DEFINED WIN32)
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
#include "AppFrame.h"
|
#include "AppFrame.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
#include "pa_debugprint.h"
|
#include "pa_debugprint.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
wxString glGetwxString(GLenum name) {
|
wxString glGetwxString(GLenum name) {
|
||||||
const GLubyte *v = glGetString(name);
|
const GLubyte *v = glGetString(name);
|
||||||
@ -109,10 +111,14 @@ static int patestCallback(const void *inputBuffer, void *outputBuffer, unsigned
|
|||||||
|
|
||||||
TestGLCanvas *src = (TestGLCanvas *) userData;
|
TestGLCanvas *src = (TestGLCanvas *) userData;
|
||||||
|
|
||||||
|
float *out = (float*) outputBuffer;
|
||||||
|
|
||||||
if (!src->audio_queue.size()) {
|
if (!src->audio_queue.size()) {
|
||||||
|
for (int i = 0; i < framesPerBuffer * 2; i++) {
|
||||||
|
out[i] = 0;
|
||||||
|
}
|
||||||
return paContinue;
|
return paContinue;
|
||||||
}
|
}
|
||||||
float *out = (float*) outputBuffer;
|
|
||||||
|
|
||||||
std::vector<float> *nextBuffer = src->audio_queue.front();
|
std::vector<float> *nextBuffer = src->audio_queue.front();
|
||||||
|
|
||||||
@ -161,7 +167,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, int *attribList) :
|
|||||||
std::cout << "Error starting :(\n";
|
std::cout << "Error starting :(\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
outputParameters.device = 5; /* default output device */
|
outputParameters.device = Pa_GetDefaultOutputDevice(); /* default output device */
|
||||||
if (outputParameters.device == paNoDevice) {
|
if (outputParameters.device == paNoDevice) {
|
||||||
std::cout << "Error: No default output device.\n";
|
std::cout << "Error: No default output device.\n";
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,9 @@
|
|||||||
#include "liquid/liquid.h"
|
#include "liquid/liquid.h"
|
||||||
|
|
||||||
#include "portaudio.h"
|
#include "portaudio.h"
|
||||||
|
#ifdef WIN32
|
||||||
#include "pa_stream.h"
|
#include "pa_stream.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class PrimaryGLContext: public wxGLContext {
|
class PrimaryGLContext: public wxGLContext {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user