Browse Source

Don't write atom to ringbuffer after it fails the initial data

tags/1.9.7
falkTX 9 years ago
parent
commit
a0dfed06f1
1 changed files with 4 additions and 6 deletions
  1. +4
    -6
      source/utils/Lv2AtomRingBuffer.hpp

+ 4
- 6
source/utils/Lv2AtomRingBuffer.hpp View File

@@ -184,17 +184,15 @@ protected:

bool writeAtom(const LV2_Atom* const atom, const int32_t portIndex) noexcept
{
tryWrite(atom, sizeof(LV2_Atom));
tryWrite(&portIndex, sizeof(int32_t));
tryWrite(LV2_ATOM_BODY_CONST(atom), atom->size);
if (tryWrite(atom, sizeof(LV2_Atom)) && tryWrite(&portIndex, sizeof(int32_t)))
tryWrite(LV2_ATOM_BODY_CONST(atom), atom->size);
return commitWrite();
}

bool writeAtomChunk(const LV2_Atom* const atom, const void* const data, const int32_t portIndex) noexcept
{
tryWrite(atom, sizeof(LV2_Atom));
tryWrite(&portIndex, sizeof(int32_t));
tryWrite(data, atom->size);
if (tryWrite(atom, sizeof(LV2_Atom)) && tryWrite(&portIndex, sizeof(int32_t)))
tryWrite(data, atom->size);
return commitWrite();
}



Loading…
Cancel
Save