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.
This commit is contained in:
Robin Gareus 2020-08-31 01:19:41 +02:00
parent cdd48926d1
commit b326b8e462
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -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;
}
}