diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-16 15:09:16 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-16 15:09:59 +0100 |
commit | 7b1c7efc1ca2e77d51568b0e8c3b2deb71115d54 (patch) | |
tree | 2ca13b4c0a6019faf9e1ce3f00219da09f94f1d9 /gtk2_ardour/engine_dialog.cc | |
parent | 4c2ea510e3e69197715ae3f7ca3bea7bc97084c0 (diff) |
work-around engine dialog crashes.
Thanks to brilliant detective work by John E. we
can now reveal that the actual crash in
EngineControl::print_channel_count() is caused
by a seemingly unrelated exception.
The root cause however is waves/ASIO backend reporting a
buffersize that is not in list of available buffer-sizes
it reported earlier.
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index dfa22e6035..742dce03f8 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -1013,7 +1013,7 @@ EngineControl::device_changed () if (0 == period) { period = backend->default_buffer_size(device_name); } - buffer_size_combo.set_active_text (bufsize_as_string (period)); + set_active_text_if_present (buffer_size_combo, bufsize_as_string (period)); show_buffer_duration (); } else { buffer_size_combo.set_sensitive (false); @@ -1247,7 +1247,7 @@ EngineControl::maybe_display_saved_state () if (!_desired_sample_rate) { sample_rate_combo.set_active_text (rate_as_string (state->sample_rate)); } - buffer_size_combo.set_active_text (bufsize_as_string (state->buffer_size)); + set_active_text_if_present (buffer_size_combo, bufsize_as_string (state->buffer_size)); /* call this explicitly because we're ignoring changes to the controls at this point. */ @@ -1465,7 +1465,7 @@ EngineControl::set_state (const XMLNode& root) driver_combo.set_active_text ((*i)->driver); device_combo.set_active_text ((*i)->device); sample_rate_combo.set_active_text (rate_as_string ((*i)->sample_rate)); - buffer_size_combo.set_active_text (bufsize_as_string ((*i)->buffer_size)); + set_active_text_if_present (buffer_size_combo, bufsize_as_string ((*i)->buffer_size)); input_latency.set_value ((*i)->input_latency); output_latency.set_value ((*i)->output_latency); midi_option_combo.set_active_text ((*i)->midi_option); @@ -1784,6 +1784,8 @@ EngineControl::get_buffer_size () const uint32_t samples; if (sscanf (txt.c_str(), "%d", &samples) != 1) { + fprintf(stderr, "Find a trout and repeatedly slap the nearest C++ who throws exceptions without catching them.\n"); + fprintf(stderr, "Ardour will likely crash now, giving you time to get the trout.\n"); throw exception (); } @@ -2175,7 +2177,7 @@ EngineControl::engine_running () boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend(); assert (backend); - buffer_size_combo.set_active_text (bufsize_as_string (backend->buffer_size())); + set_active_text_if_present (buffer_size_combo, bufsize_as_string (backend->buffer_size())); sample_rate_combo.set_active_text (rate_as_string (backend->sample_rate())); buffer_size_combo.set_sensitive (true); |