Fix transport reset logic for hosts with non-static buffer sizes
This commit is contained in:
parent
a5ea17fbcf
commit
c46d659340
1 changed files with 5 additions and 5 deletions
|
|
@ -448,7 +448,7 @@ class CardinalPlugin : public CardinalBasePlugin
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string fAutosavePath;
|
std::string fAutosavePath;
|
||||||
uint64_t fPreviousFrame;
|
uint64_t fNextExpectedFrame;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
String comment;
|
String comment;
|
||||||
|
|
@ -474,7 +474,7 @@ public:
|
||||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||||
fAudioBufferCopy(nullptr),
|
fAudioBufferCopy(nullptr),
|
||||||
#endif
|
#endif
|
||||||
fPreviousFrame(0),
|
fNextExpectedFrame(0),
|
||||||
fWasBypassed(false)
|
fWasBypassed(false)
|
||||||
{
|
{
|
||||||
#ifndef HEADLESS
|
#ifndef HEADLESS
|
||||||
|
|
@ -1082,7 +1082,7 @@ protected:
|
||||||
fAudioBufferCopy[i] = new float[bufferSize];
|
fAudioBufferCopy[i] = new float[bufferSize];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fPreviousFrame = 0;
|
fNextExpectedFrame = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void deactivate() override
|
void deactivate() override
|
||||||
|
|
@ -1108,7 +1108,7 @@ protected:
|
||||||
{
|
{
|
||||||
const TimePosition& timePos(getTimePosition());
|
const TimePosition& timePos(getTimePosition());
|
||||||
|
|
||||||
const bool reset = timePos.playing && (timePos.frame == 0 || fPreviousFrame + frames != timePos.frame);
|
const bool reset = timePos.playing && (timePos.frame == 0 || fNextExpectedFrame != timePos.frame);
|
||||||
|
|
||||||
context->playing = timePos.playing;
|
context->playing = timePos.playing;
|
||||||
context->bbtValid = timePos.bbt.valid;
|
context->bbtValid = timePos.bbt.valid;
|
||||||
|
|
@ -1133,7 +1133,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
context->reset = reset;
|
context->reset = reset;
|
||||||
fPreviousFrame = timePos.frame;
|
fNextExpectedFrame = timePos.playing ? timePos.frame + frames : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// separate buffers, use them
|
// separate buffers, use them
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue