diff options
author | David Robillard <d@drobilla.net> | 2010-12-15 05:25:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-15 05:25:38 +0000 |
commit | 84c939f117894f32f4ad6c220c43bdd6b993e712 (patch) | |
tree | d76441a99c70859f45b81566c3fedaa71bd09329 | |
parent | d7b03e1498c9637d23d8042295609f4beeea65d9 (diff) | |
download | patchage-84c939f117894f32f4ad6c220c43bdd6b993e712.tar.gz patchage-84c939f117894f32f4ad6c220c43bdd6b993e712.tar.bz2 patchage-84c939f117894f32f4ad6c220c43bdd6b993e712.zip |
Tolerate insane behaviour of latest SVN Jack (r4089).
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2698 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/JackDriver.cpp | 18 | ||||
-rw-r--r-- | src/Patchage.cpp | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 8e610a4..32b7237 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -502,6 +502,11 @@ JackDriver::jack_buffer_size_cb(jack_nframes_t buffer_size, void* jack_driver) jack_reset_max_delayed_usecs(me->_client); + if (buffer_size == 0) { + Raul::error << "Jack is insane and reporting a buffer size of 0" << endl; + return 0; + } + me->_buffer_size = buffer_size; me->reset_xruns(); me->reset_max_dsp_load(); @@ -587,15 +592,12 @@ JackDriver::set_buffer_size(jack_nframes_t size) float JackDriver::get_max_dsp_load() { - float max_load; - float max_delay; - - max_delay = jack_get_max_delayed_usecs(_client); - - const float rate = sample_rate(); - const float size = buffer_size(); - const float period = size / rate * 1000000; // usec + const float max_delay = jack_get_max_delayed_usecs(_client); + const float rate = sample_rate(); + const float size = buffer_size(); + const float period = size / rate * 1000000; // usec + float max_load; if (max_delay > period) { max_load = 1.0; jack_reset_max_delayed_usecs(_client); diff --git a/src/Patchage.cpp b/src/Patchage.cpp index e5588e7..1db04ea 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -300,7 +300,7 @@ Patchage::~Patchage() delete _dbus; #endif delete _state_manager; - + _about_win.destroy(); _messages_win.destroy(); |