From da4d1cd77915ec8d72ac4a39323a6d398aa81ce1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 22 Nov 2020 20:44:45 +0100 Subject: [PATCH] Yet another export fix (amend a5291222493a2) --- libs/ardour/export_channel.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index b14bfd8406..6ee3978533 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -127,7 +127,8 @@ PortExportChannel::read (Sample const *& data, samplecnt_t samples) const samplecnt_t to_write = std::min (samples, (samplecnt_t) vec.len[0]); mix_buffers_no_gain (&_buffer[0], vec.buf[0], to_write); - to_write = std::min (to_write - samples, (samplecnt_t) vec.len[1]); + + to_write = std::min (samples - to_write, (samplecnt_t) vec.len[1]); if (to_write > 0) { mix_buffers_no_gain (&_buffer[vec.len[0]], vec.buf[1], to_write); }