From 0a865a7a141f52a71b1d27ffcc2c84de5eb2431d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 3 May 2009 17:55:54 +0000 Subject: Keep correct timers even when event write fails. Tidy. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1959 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/LV2EventBuffer.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/engine/LV2EventBuffer.cpp') diff --git a/src/engine/LV2EventBuffer.cpp b/src/engine/LV2EventBuffer.cpp index 3de70216..bec92c0e 100644 --- a/src/engine/LV2EventBuffer.cpp +++ b/src/engine/LV2EventBuffer.cpp @@ -85,8 +85,7 @@ LV2EventBuffer::increment() const } -/** - * \return true iff the cursor is valid (ie get_event is safe) +/** \return true iff the cursor is valid (ie get_event is safe) */ bool LV2EventBuffer::is_valid() const @@ -143,15 +142,14 @@ LV2EventBuffer::append(uint32_t frames, /*cout << "Appending event type " << type << ", size " << size << " @ " << frames << "." << subframes << endl;*/ - const bool ret = lv2_event_write(&_iter, frames, subframes, type, size, data); - - if (!ret) + if (!lv2_event_write(&_iter, frames, subframes, type, size, data)) { cerr << "ERROR: Failed to write event." << endl; - - _latest_frames = frames; - _latest_subframes = subframes; - - return ret; + return false; + } else { + _latest_frames = frames; + _latest_subframes = subframes; + return true; + } } -- cgit v1.2.1