summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-03-16 04:09:03 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-03-16 04:09:03 +0000
commitbca0450c188cdac82fbc74d05b5d72aff9115646 (patch)
tree688870950203e270b1dbc9baf975daa4c6d0d56c /libs/ardour/session.cc
parent0b7a7cba788c20d9554ab8aa5b38bacf16e72ab6 (diff)
possible fix for crash while adding new tracks
git-svn-id: svn://localhost/ardour2/trunk@1603 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 257126b6f1..951339db98 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -269,6 +269,7 @@ Session::Session (AudioEngine &eng,
pending_events (2048),
midi_requests (128), // the size of this should match the midi request pool size
diskstreams (new DiskstreamList),
+ diskstreams_input_pending (new DiskstreamList),
routes (new RouteList),
auditioner ((Auditioner*) 0),
_click_io ((IO*) 0),
@@ -332,6 +333,7 @@ Session::Session (AudioEngine &eng,
pending_events (2048),
midi_requests (16),
diskstreams (new DiskstreamList),
+ diskstreams_input_pending (new DiskstreamList),
routes (new RouteList),
main_outs (0)
@@ -2002,21 +2004,23 @@ void
Session::add_diskstream (boost::shared_ptr<Diskstream> dstream)
{
/* need to do this in case we're rolling at the time, to prevent false underruns */
- dstream->do_refill_with_alloc();
+ dstream->do_refill_with_alloc ();
- {
+ dstream->set_block_size (current_block_size);
+
+ if (_state_of_the_state & InitialConnecting) {
RCUWriter<DiskstreamList> writer (diskstreams);
boost::shared_ptr<DiskstreamList> ds = writer.get_copy();
ds->push_back (dstream);
- }
-
- dstream->set_block_size (current_block_size);
+ /* writer goes out of scope, copies ds back to main */
+ }
dstream->PlaylistChanged.connect (sigc::bind (mem_fun (*this, &Session::diskstream_playlist_changed), dstream));
/* this will connect to future changes, and check the current length */
diskstream_playlist_changed (dstream);
dstream->prepare ();
+
}
void
@@ -3383,7 +3387,11 @@ Session::graph_reordered ()
we were connecting. do it now.
*/
- request_input_change_handling ();
+ boost::shared_ptr<DiskstreamList> ds = diskstreams.reader();
+
+ for (DiskstreamList::iterator i = ds->begin(); i != ds->end(); ++i) {
+ request_input_change_handling (*i);
+ }
resort_routes ();