From f6bfe60a7861ebc27a6397920d9de1f8d2dfc821 Mon Sep 17 00:00:00 2001 From: petern Date: Sat, 25 Jul 2009 15:52:40 +0000 Subject: [PATCH] -Change: Move comment to more appropriate place. git-svn-id: http://svn.fuzzle.org/mloop/trunk@35 ba049829-c6ef-42ef-81ac-908dd8d2e907 --- src/jack.cpp | 6 ------ src/ringbuffer.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jack.cpp b/src/jack.cpp index 3b644d6..7688309 100644 --- a/src/jack.cpp +++ b/src/jack.cpp @@ -98,12 +98,6 @@ int Jack::ProcessCallback(jack_nframes_t nframes) m_notecache.HandleEvent(ev); if (m_recording) { - /* Don't add the event to the buffer if it will become full. - * This includes the case where the event would actually fit, - * but would cause the buffer to be full. This prevents the - * need for extra logic to determine if the buffer is full - * or empty. - */ ev.time += m_recording_time; if (m_loop_buffer->PushEvent(ev)) { m_delay_record = false; diff --git a/src/ringbuffer.cpp b/src/ringbuffer.cpp index 05b29be..bedf3e1 100644 --- a/src/ringbuffer.cpp +++ b/src/ringbuffer.cpp @@ -6,6 +6,12 @@ bool RingBuffer::PushEvent(const jack_midi_event_t &ev) { + /* Don't add the event to the buffer if it will become full. + * This includes the case where the event would actually fit, + * but would cause the buffer to be full. This prevents the + * need for extra logic to determine if the buffer is full + * or empty. + */ size_t f = jack_ringbuffer_write_space(m_buffer); if (f <= sizeof ev.time + sizeof ev.size + ev.size) return false;