13
0

amend 7bb9d04, fix midi looping

This commit is contained in:
Robin Gareus 2015-03-12 16:09:55 +01:00
parent 37a9ef0501
commit b622bc18fc

View File

@ -1440,8 +1440,6 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
size_t events_read = 0;
_playback_buf->skip_to (playback_sample);
if (loc) {
framepos_t effective_start;
@ -1461,6 +1459,8 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
_playback_buf->resolve_tracker (dst, 0);
}
_playback_buf->skip_to (effective_start);
if (loc->end() >= effective_start && loc->end() < effective_start + nframes) {
/* end of loop is within the range we are reading, so
split the read in two, and lie about the location
@ -1492,6 +1492,7 @@ MidiDiskstream::get_playback (MidiBuffer& dst, framecnt_t nframes)
events_read = _playback_buf->read (dst, effective_start, effective_start + nframes);
}
} else {
_playback_buf->skip_to (playback_sample);
events_read = _playback_buf->read (dst, playback_sample, playback_sample + nframes);
}