Browse Source

audiofile: only advance internal frame if there is a file

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0-RC2
falkTX 3 years ago
parent
commit
e0515ae49f
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 14 additions and 13 deletions
  1. +14
    -13
      source/native-plugins/audio-file.cpp

+ 14
- 13
source/native-plugins/audio-file.cpp View File

@@ -344,10 +344,22 @@ protected:
void process2(const float* const*, float** const outBuffer, const uint32_t frames,
const NativeMidiEvent*, uint32_t) override
{
const bool loopMode = fLoopMode;
const float volume = fVolume;
float* const out1 = outBuffer[0];
float* const out2 = outBuffer[1];

const water::GenericScopedLock<water::SpinLock> gsl(fPool.mutex);

if (! fDoProcess)
{
// carla_stderr("P: no process");
carla_zeroFloats(out1, frames);
carla_zeroFloats(out2, frames);
fLastPosition = 0.0f;
return;
}

const bool loopMode = fLoopMode;
const float volume = fVolume;
bool needsIdleRequest = false;
bool playing;
uint64_t frame;
@@ -367,17 +379,6 @@ protected:
fInternalTransportFrame += frames;
}

const water::GenericScopedLock<water::SpinLock> gsl(fPool.mutex);

if (! fDoProcess)
{
// carla_stderr("P: no process");
carla_zeroFloats(out1, frames);
carla_zeroFloats(out2, frames);
fLastPosition = 0.0f;
return;
}

// not playing
if (! playing)
{


Loading…
Cancel
Save