Fix master/monitor auto-connect

When initially using a different backend, the engine does
not yet have a reference to the Session, and main busses
were not connected.
This commit is contained in:
Robin Gareus
2025-10-15 18:09:45 +02:00
parent df88d2f60c
commit 6e62c49749
3 changed files with 7 additions and 4 deletions

View File

@@ -146,7 +146,7 @@ public:
int disconnect (std::shared_ptr<Port>);
int disconnect (std::string const&);
int reestablish_ports ();
int reconnect_ports ();
int reconnect_ports (Session* s = nullptr);
bool connected (const std::string&);
bool physically_connected (const std::string&);

View File

@@ -920,7 +920,7 @@ PortManager::set_pretty_names (std::vector<std::string> const& port_names, DataT
}
int
PortManager::reconnect_ports ()
PortManager::reconnect_ports (Session* s)
{
std::shared_ptr<Ports const> p = _ports.reader ();
@@ -928,7 +928,10 @@ PortManager::reconnect_ports ()
DEBUG_TRACE (DEBUG::Ports, string_compose ("reconnect %1 ports\n", p->size ()));
Session* s = AudioEngine::instance ()->session ();
if (!s) {
s = AudioEngine::instance ()->session ();
}
if (s && s->master_out() && !s->master_out ()->output()->has_ext_connection()) {
s->auto_connect_master_bus ();
}

View File

@@ -1670,7 +1670,7 @@ Session::hookup_io ()
/* Get everything connected */
AudioEngine::instance()->reconnect_ports ();
AudioEngine::instance()->reconnect_ports (this);
AfterConnect (); /* EMIT SIGNAL */