From 254f22e372ff1155e76bea2c9a6f9c6c85a94868 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 7 Jan 2020 03:59:25 +0100 Subject: [PATCH] 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`. --- libs/ardour/disk_writer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index 6a455318e9..33a9187ca2 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -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; }