Allow adding tracks w/o running backend

This commit is contained in:
Robin Gareus 2017-07-20 16:45:14 +02:00
parent 40e2f9a68a
commit adc2c756e6
3 changed files with 6 additions and 5 deletions

View File

@ -70,7 +70,9 @@ Port::Port (std::string const & n, DataType t, PortFlags f)
assert (_name.find_first_of (':') == std::string::npos);
if ((_port_handle = port_engine.register_port (_name, t, _flags)) == 0) {
if (!port_engine.available ()) {
_port_handle = 0; // created during ::reestablish() later
} else if ((_port_handle = port_engine.register_port (_name, t, _flags)) == 0) {
cerr << "Failed to register port \"" << _name << "\", reason is unknown from here\n";
throw failed_constructor ();
}

View File

@ -926,10 +926,6 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
loc = _processors.end ();
}
if (!AudioEngine::instance()->connected()) {
return 1;
}
if (others.empty()) {
return 0;
}

View File

@ -6826,6 +6826,9 @@ Session::update_latency (bool playback)
if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _route_deletion_in_progress) {
return;
}
if (!_engine.running()) {
return;
}
boost::shared_ptr<RouteList> r = routes.reader ();
framecnt_t max_latency = 0;