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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user