Fix seamless looping w/split-cycles
This fixes the following (loop-lennth > internal_playback_seek length. Due to read-ahead on some cycles the following can happen --- Loop From: 3528000 To: 3880800 (len: 352800) start-sample: 3880971 playback_sample: 3528171 nframes: 96 start-sample: 3880875 playback_sample: 3528075 nframes: 192 --- which resulted in disk_samples_to_consume == 0;
This commit is contained in:
parent
1341e18cac
commit
4c7cde0242
@ -367,8 +367,14 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
||||
AudioBuffer& disk_buf ((ms & MonitoringInput) ? scratch_bufs.get_audio(n) : output);
|
||||
|
||||
if (start_sample != playback_sample && target_gain != 0) {
|
||||
if (can_internal_playback_seek (start_sample - playback_sample)) {
|
||||
internal_playback_seek (start_sample - playback_sample);
|
||||
samplepos_t ss = start_sample;
|
||||
Location* loc = _loop_location;
|
||||
if (loc) {
|
||||
Evoral::Range<samplepos_t> loop_range (loc->start(), loc->end() - 1);
|
||||
ss = loop_range.squish (playback_sample);
|
||||
}
|
||||
if (can_internal_playback_seek (ss - playback_sample)) {
|
||||
internal_playback_seek (ss - playback_sample);
|
||||
} else {
|
||||
disk_samples_to_consume = 0; /* will force an underrun below */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user