summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-16 09:57:22 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-16 09:57:22 -0400
commit31157cb343ad1b6a82134c92c77fb37d983cc5ed (patch)
treeedcb1b56ad685a61d5338e0ff7dfb095cb068798 /libs
parentbde50d5396b49ac982686034c3165c337b7069a7 (diff)
fix ordering in session construction so that new sessions and existing ones both work
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session.cc30
-rw-r--r--libs/ardour/session_state.cc7
2 files changed, 26 insertions, 11 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index cad869a577..e2deb71639 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -264,11 +264,18 @@ Session::Session (AudioEngine &eng,
pre_engine_init (fullpath);
if (_is_new) {
+ if (ensure_engine (sr)) {
+ destroy ();
+ throw failed_constructor ();
+ }
+
if (create (mix_template, bus_profile)) {
destroy ();
throw failed_constructor ();
}
+
} else {
+
if (load_state (_current_snapshot_name)) {
throw failed_constructor ();
}
@@ -284,11 +291,11 @@ Session::Session (AudioEngine &eng,
sr = atoi (prop->value());
}
}
- }
- if (ensure_engine (sr)) {
- destroy ();
- throw failed_constructor ();
+ if (ensure_engine (sr)) {
+ destroy ();
+ throw failed_constructor ();
+ }
}
if (post_engine_init ()) {
@@ -361,6 +368,21 @@ Session::ensure_engine (uint32_t desired_sample_rate)
return -1;
}
+ /* the graph is just about as basic to everything else as the engine
+ so we create it here. this results in it coming into being at just
+ the right time for both new and existing sessions.
+
+ XXX some cleanup in the new/existing path is still waiting to be
+ done
+ */
+
+ if (how_many_dsp_threads () > 1) {
+ /* For now, only create the graph if we are using >1 DSP threads, as
+ it is a bit slower than the old code with 1 thread.
+ */
+ _process_graph.reset (new Graph (*this));
+ }
+
return 0;
}
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index e847ba45ce..99fa3f4a3b 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -210,13 +210,6 @@ Session::post_engine_init ()
set_block_size (_engine.samples_per_cycle());
set_frame_rate (_engine.sample_rate());
- if (how_many_dsp_threads () > 1) {
- /* For now, only create the graph if we are using >1 DSP threads, as
- it is a bit slower than the old code with 1 thread.
- */
- _process_graph.reset (new Graph (*this));
- }
-
n_physical_outputs = _engine.n_physical_outputs ();
n_physical_inputs = _engine.n_physical_inputs ();