summaryrefslogtreecommitdiffstats
path: root/src/engine/QueuedEngineInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/QueuedEngineInterface.cpp')
-rw-r--r--src/engine/QueuedEngineInterface.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp
index 6a322e16..9a2cea1b 100644
--- a/src/engine/QueuedEngineInterface.cpp
+++ b/src/engine/QueuedEngineInterface.cpp
@@ -39,8 +39,10 @@ QueuedEngineInterface::now() const
{
// Exactly one cycle latency (some could run ASAP if we get lucky, but not always, and a slight
// constant latency is far better than jittery lower (average) latency
- assert(_engine.audio_driver());
- return _engine.audio_driver()->frame_time() + _engine.audio_driver()->buffer_size();
+ if (_engine.audio_driver())
+ return _engine.audio_driver()->frame_time() + _engine.audio_driver()->buffer_size();
+ else
+ return 0;
}
@@ -99,8 +101,14 @@ QueuedEngineInterface::load_plugins()
void
QueuedEngineInterface::activate()
{
- QueuedEventSource::activate();
+ static bool in_activate = false;
+ if (!in_activate) {
+ in_activate = true;
+ _engine.activate(1);
+ }
+ QueuedEventSource::activate_source();
push_queued(new PingQueuedEvent(_engine, _responder, now()));
+ in_activate = false;
}