From be92c927e8928eb56f10776ab9360373c293ec78 Mon Sep 17 00:00:00 2001 From: GZharun Date: Wed, 28 Jan 2015 12:44:38 +0200 Subject: [Summary] HOT FIX: Fixed crash which happens on an attempt to load a session with audio after preferences removal, when buffer preset is set to Medium. [Details] It happened because ARDOUR::Butler::thread_work() was called before Buttler::map_parameters() method was called, which sets up the correct buffering parameters (set_buffering_parameters () call) according to chosen preset. I've added this calls into Butler::start_thread () to make sure everything is set up and ready for use for Butler. This is a hot fix, because it requires the review from Paul Davis, and probably more gentle solution. But it's possible this commit may become the main solution itself. --- libs/ardour/butler.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libs/ardour/butler.cc') diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 67d7dd1617..8e68eed7c4 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -104,12 +104,16 @@ Butler::config_changed (std::string p) int Butler::start_thread() { - const float rate = (float)_session.frame_rate(); - + Diskstream::set_buffering_parameters (Config->get_buffering_preset()); + /* size is in Samples, not bytes */ + const float rate = (float)_session.frame_rate(); audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * rate); audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * rate); - + + _session.adjust_capture_buffering (); + _session.adjust_playback_buffering (); + /* size is in bytes * XXX: Jack needs to tell us the MIDI buffer size * (i.e. how many MIDI bytes we might see in a cycle) -- cgit v1.2.3