diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index b80f1978ad..04fcb126b9 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -624,15 +624,16 @@ MidiDiskstream::commit (framecnt_t playback_distance) uint32_t frames_read = g_atomic_int_get(&_frames_read_from_ringbuffer); uint32_t frames_written = g_atomic_int_get(&_frames_written_to_ringbuffer); + cerr << "MDS written: " << frames_written << " - read: " << frames_read << + " = " << frames_written - frames_read + << " + " << playback_distance << " < " << midi_readahead << " = " << need_butler << ")" << endl; + assert (frames_read <= frames_written); if ((frames_written - frames_read) + playback_distance < midi_readahead) { need_butler = true; } - /*cerr << "MDS written: " << frames_written << " - read: " << frames_read << - " = " << frames_written - frames_read - << " + " << nframes << " < " << midi_readahead << " = " << need_butler << ")" << endl;*/ return need_butler; }