Fix MIDI disk-writer flush

to_write must not exceed `total = _samples_pending_write`.
If the write succeeds (events spanning `to_write` samples are written)
to_write is atomically subtracted from `_samples_pending_write`.
This commit is contained in:
Robin Gareus 2020-01-07 03:59:25 +01:00
parent f15297e24c
commit 254f22e372
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -991,7 +991,7 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
if (force_flush) {
/* push out everything we have, right now */
to_write = UINT32_MAX;
to_write = total;
} else {
to_write = _chunk_samples;
}