From b326b8e4628ddb71e5a0479e0f8e8248f237e66c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 31 Aug 2020 01:19:41 +0200 Subject: [PATCH] Fix MIDI Capture alignment When recording audio, simply not writing to the ringbuffer offsets the recording accordingly. When recording MIDI, absolute timestamps are used, so the recording has to be offset by the accumulated difference. Previously this went unnoticed because tests using the Dummy backend the accumulated offset never exceeded 1 cycle. --- libs/ardour/disk_writer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ardour/disk_writer.cc b/libs/ardour/disk_writer.cc index 34aa3f1e9f..ad15081dcf 100644 --- a/libs/ardour/disk_writer.cc +++ b/libs/ardour/disk_writer.cc @@ -484,6 +484,8 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp */ if (rec_nframes) { _accumulated_capture_offset += rec_offset; + } else { + _accumulated_capture_offset += nframes; } }