diff --git a/source/native-plugins/zynaddsubfx/Misc/Master.cpp b/source/native-plugins/zynaddsubfx/Misc/Master.cpp index 40f328ff0..173950a11 100644 --- a/source/native-plugins/zynaddsubfx/Misc/Master.cpp +++ b/source/native-plugins/zynaddsubfx/Misc/Master.cpp @@ -618,7 +618,7 @@ int msg_id=0; /* * Master audio out (the final sound) */ -void Master::AudioOut(float *outl, float *outr) +bool Master::AudioOut(float *outl, float *outr) { //Danger Limits if(memory->lowMemory(2,1024*1024)) @@ -645,7 +645,7 @@ void Master::AudioOut(float *outl, float *outr) if (mastercb) mastercb(mastercb_ptr, new_master); bToU->write("/free", "sb", "Master", sizeof(Master*), &this_master); - return; + return false; } //XXX yes, this is not realtime safe, but it is useful... @@ -821,6 +821,8 @@ void Master::AudioOut(float *outl, float *outr) //update the global frame timer time++; + + return true; } //TODO review the respective code from yoshimi for this @@ -846,7 +848,9 @@ void Master::GetAudioOutSamples(size_t nsamples, nsamples -= smps; //generate samples - AudioOut(bufl, bufr); + if (! AudioOut(bufl, bufr)) + return; + off = 0; out_off += smps; smps = synth.buffersize; diff --git a/source/native-plugins/zynaddsubfx/Misc/Master.h b/source/native-plugins/zynaddsubfx/Misc/Master.h index 4fb5f6264..db14d0b68 100644 --- a/source/native-plugins/zynaddsubfx/Misc/Master.h +++ b/source/native-plugins/zynaddsubfx/Misc/Master.h @@ -100,7 +100,7 @@ class Master void vuUpdate(const float *outl, const float *outr); /**Audio Output*/ - void AudioOut(float *outl, float *outr) REALTIME; + bool AudioOut(float *outl, float *outr) REALTIME; /**Audio Output (for callback mode). * This allows the program to be controled by an external program*/ void GetAudioOutSamples(size_t nsamples,