mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
Fixed internal buffer overflow
This commit is contained in:
parent
51407a4bc1
commit
a0fd6ab697
2 changed files with 7 additions and 3 deletions
|
@ -84,7 +84,7 @@ Jack::Jack( std::string name ) :
|
||||||
clientActive(false)
|
clientActive(false)
|
||||||
{
|
{
|
||||||
jack = this;
|
jack = this;
|
||||||
|
lastnframes=0;
|
||||||
samplerate = jack_get_sample_rate( client );
|
samplerate = jack_get_sample_rate( client );
|
||||||
|
|
||||||
LUPPP_NOTE("Samplerate %i", samplerate );
|
LUPPP_NOTE("Samplerate %i", samplerate );
|
||||||
|
@ -494,7 +494,7 @@ void Jack::processFrames(int nframes)
|
||||||
metronome->process( nframes, &buffers );
|
metronome->process( nframes, &buffers );
|
||||||
|
|
||||||
/// mix input, reverb & post-sidechain in
|
/// mix input, reverb & post-sidechain in
|
||||||
for(unsigned int i = 0; i < buffers.nframes; i++)
|
for(unsigned int i = 0; i < nframes; i++)
|
||||||
{
|
{
|
||||||
float input= buffers.audio[Buffers::MASTER_INPUT][i] * inputVol;
|
float input= buffers.audio[Buffers::MASTER_INPUT][i] * inputVol;
|
||||||
|
|
||||||
|
@ -574,8 +574,9 @@ void Jack::processFrames(int nframes)
|
||||||
// JACK in multiple parts internally in Luppp: used for processing bar() / beat()
|
// JACK in multiple parts internally in Luppp: used for processing bar() / beat()
|
||||||
// if a full JACK nframes has been processed, this is extra work: its not that expensive
|
// if a full JACK nframes has been processed, this is extra work: its not that expensive
|
||||||
/// update buffers by nframes
|
/// update buffers by nframes
|
||||||
if(nframes<buffers.nframes)
|
if(lastnframes+nframes<buffers.nframes)
|
||||||
{
|
{
|
||||||
|
lastnframes=nframes;
|
||||||
buffers.audio[Buffers::MASTER_INPUT] = &buffers.audio[Buffers::MASTER_INPUT] [nframes];
|
buffers.audio[Buffers::MASTER_INPUT] = &buffers.audio[Buffers::MASTER_INPUT] [nframes];
|
||||||
buffers.audio[Buffers::MASTER_RETURN_L] = &buffers.audio[Buffers::MASTER_RETURN_L][nframes];
|
buffers.audio[Buffers::MASTER_RETURN_L] = &buffers.audio[Buffers::MASTER_RETURN_L][nframes];
|
||||||
buffers.audio[Buffers::MASTER_RETURN_R] = &buffers.audio[Buffers::MASTER_RETURN_R][nframes];
|
buffers.audio[Buffers::MASTER_RETURN_R] = &buffers.audio[Buffers::MASTER_RETURN_R][nframes];
|
||||||
|
@ -594,6 +595,8 @@ void Jack::processFrames(int nframes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lastnframes=0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ class Jack
|
||||||
|
|
||||||
JackSendReturn *getJackSendReturn(int t);
|
JackSendReturn *getJackSendReturn(int t);
|
||||||
private:
|
private:
|
||||||
|
int lastnframes;
|
||||||
jack_client_t* client;
|
jack_client_t* client;
|
||||||
|
|
||||||
Buffers buffers;
|
Buffers buffers;
|
||||||
|
|
Loading…
Add table
Reference in a new issue