BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
- _silent = false;
-
if (_queue_panic) {
MidiBuffer& mbuf (bufs.get_midi (0));
_queue_panic = false;
offset = the_region->sync_offset (dir);
}
+ if (length == 0) {
+ error << _("Cannot audition empty file.") << endmsg;
+ return;
+ }
+
/* can't audition from a negative sync point */
if (dir < 0) {
/* process audio */
this_nframes = min (nframes, length - current_sample + _import_position);
- if ((ret = roll (this_nframes, current_sample, current_sample + nframes, false, need_butler)) != 0) {
+ if (this_nframes > 0 && 0 != (ret = roll (this_nframes, current_sample, current_sample + this_nframes, false, need_butler))) {
silence (nframes);
return ret;
}
current_sample += this_nframes;
+ if (this_nframes < nframes) {
+ if (this_nframes > 0) {
+ _session.engine().split_cycle (this_nframes);
+ }
+ silence (nframes - this_nframes);
+ }
+
} else {
silence (nframes);
}