Skip to content
Snippets Groups Projects
Commit 82a6e3cf authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Fixed crash when jack is not started

parent dd21fff1
Branches
No related tags found
No related merge requests found
......@@ -111,10 +111,17 @@ void AudioManager::init() {
m_rtBufSize = 1024;
bool init=true;
try{
m_rtAudio->openStream(param, NULL, RTAUDIO_FLOAT32, data.nRate,
&m_rtBufSize,
AudioManager::rtaudio_callback, &data, options);
}
catch(const exception& e) {
init=false;
}
if(init) {
int nbBufs = 5;
m_bufSize = m_rtBufSize*nbBufs;
......@@ -134,6 +141,7 @@ void AudioManager::init() {
m_thread = new std::thread(audioThreadFunction, this);
m_init = true;
}
}
bool AudioManager::changeBuf(float* outputBuf, float maxSinValue) {
......@@ -147,9 +155,9 @@ bool AudioManager::changeBuf(float* outputBuf, float maxSinValue) {
}
else {
//cout<<"AudioManager : Could not write buffer"<<endl;
return false;
}
}
return false;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment