summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-22 08:12:23 +0000
committerDavid Robillard <d@drobilla.net>2008-11-22 08:12:23 +0000
commit8a614ae060308637dd0ade55383ea54199531198 (patch)
treeb0c4fa8bacf62760ab12ea67c55b5b00e58bb4a2
parentcda796269b903899edcbc479dbdc3c7dacb944c5 (diff)
downloadingen-8a614ae060308637dd0ade55383ea54199531198.tar.gz
ingen-8a614ae060308637dd0ade55383ea54199531198.tar.bz2
ingen-8a614ae060308637dd0ade55383ea54199531198.zip
Better handling of large patch loading.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1766 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/engine/QueuedEventSource.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/engine/QueuedEventSource.cpp b/src/engine/QueuedEventSource.cpp
index e9817c4b..7dd12049 100644
--- a/src/engine/QueuedEventSource.cpp
+++ b/src/engine/QueuedEventSource.cpp
@@ -95,7 +95,7 @@ QueuedEventSource::process(PostProcessor& dest, ProcessContext& context)
* makes the process callback (more) realtime-safe by preventing being
* choked by events coming in faster than they can be processed.
* FIXME: test this and figure out a good value */
- const unsigned int MAX_QUEUED_EVENTS = context.nframes() / 100;
+ const unsigned int MAX_QUEUED_EVENTS = context.nframes() / 64;
unsigned int num_events_processed = 0;
@@ -114,9 +114,11 @@ QueuedEventSource::process(PostProcessor& dest, ProcessContext& context)
++num_events_processed;
}
- if (num_events_processed > 0)
- while (_full_semaphore.has_waiter())
+ if (_full_semaphore.has_waiter()) {
+ const bool full = (((_front.get() - _back.get() + _size) % _size) == 1);
+ if (!full)
_full_semaphore.post();
+ }
}