summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 443738f777..94882c13b3 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -289,13 +289,26 @@ Session::Session (AudioEngine &eng,
/* we need the audioengine to be up and usable to make much more
* progress with construction, so lets get that started if it isn't already.
*/
-
- if (_engine.current_backend() == 0 || _engine.setup_required()) {
+
+ if (_engine.current_backend() == 0) {
+ /* backend is unknown ... */
+ boost::optional<int> r = AudioEngineSetupRequired (sr);
+ if (r.get_value_or (-1) != 0) {
+ destroy ();
+ throw failed_constructor();
+ }
+ } else if (_engine.setup_required()) {
+ /* backend is known, but setup is needed */
boost::optional<int> r = AudioEngineSetupRequired (sr);
if (r.get_value_or (-1) != 0) {
destroy ();
throw failed_constructor();
}
+ } else if (!_engine.running()) {
+ if (_engine.start()) {
+ destroy ();
+ throw failed_constructor ();
+ }
}
/* at this point the engine should be connected (i.e. interacting