diff options
-rw-r--r-- | libs/ardour/disk_reader.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc index 028fb24716..4ed24bcf4b 100644 --- a/libs/ardour/disk_reader.cc +++ b/libs/ardour/disk_reader.cc @@ -692,8 +692,16 @@ DiskReader::overwrite_existing_audio () chunk1_offset = overwrite_offset; chunk1_cnt = min (c->front()->rbuf->bufsize() - overwrite_offset, to_overwrite); + /* note: because we are overwriting buffer contents but not moving the + * write/read pointers, we do actually want to fill all the way to the + * write pointer (the value given by PlaybackBuffer::overwritable_at(). + * + * This differs from what happens during ::refill_audio() where we are + * careful not to allow the read pointer to catch the write pointer + * (that indicates an empty buffer) + */ + if (chunk1_cnt == to_overwrite) { - chunk1_cnt--; chunk2_cnt = 0; } else { chunk2_cnt = to_overwrite - chunk1_cnt; |