Retain TransportMaster Ports across sessions
Unloading a session should only remove session-ports. This fixes Timecode master sync when switching snapshots or sessions.
This commit is contained in:
parent
4194313e4b
commit
0786be859d
|
@ -186,7 +186,7 @@ public:
|
||||||
|
|
||||||
void set_port_pretty_name (std::string const&, std::string const&);
|
void set_port_pretty_name (std::string const&, std::string const&);
|
||||||
|
|
||||||
void remove_all_ports ();
|
void remove_session_ports ();
|
||||||
|
|
||||||
/** reset port-buffers. e.g. after freewheeling */
|
/** reset port-buffers. e.g. after freewheeling */
|
||||||
void reinit (bool with_ratio = false);
|
void reinit (bool with_ratio = false);
|
||||||
|
|
|
@ -834,7 +834,7 @@ AudioEngine::remove_session ()
|
||||||
SessionHandlePtr::set_session (0);
|
SessionHandlePtr::set_session (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_all_ports ();
|
remove_session_ports ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -274,7 +274,7 @@ PortManager::clear_pending_port_deletions ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PortManager::remove_all_ports ()
|
PortManager::remove_session_ports ()
|
||||||
{
|
{
|
||||||
/* make sure that JACK callbacks that will be invoked as we cleanup
|
/* make sure that JACK callbacks that will be invoked as we cleanup
|
||||||
* ports know that they have nothing to do.
|
* ports know that they have nothing to do.
|
||||||
|
@ -282,13 +282,20 @@ PortManager::remove_all_ports ()
|
||||||
|
|
||||||
PBD::Unwinder<bool> uw (_port_remove_in_progress, true);
|
PBD::Unwinder<bool> uw (_port_remove_in_progress, true);
|
||||||
|
|
||||||
/* process lock MUST be held by caller
|
/* process lock MUST be held by caller */
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
{
|
||||||
RCUWriter<Ports> writer (_ports);
|
RCUWriter<Ports> writer (_ports);
|
||||||
std::shared_ptr<Ports> ps = writer.get_copy ();
|
std::shared_ptr<Ports> ps = writer.get_copy ();
|
||||||
ps->clear ();
|
|
||||||
|
for (auto i = ps->begin (); i != ps->end (); ) {
|
||||||
|
std::shared_ptr<Port> port = i->second;
|
||||||
|
if (i->second->flags () & TransportMasterPort) {
|
||||||
|
++i;
|
||||||
|
} else {
|
||||||
|
i = ps->erase (i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear dead wood list in RCU */
|
/* clear dead wood list in RCU */
|
||||||
|
@ -857,7 +864,7 @@ PortManager::reestablish_ports ()
|
||||||
|
|
||||||
if (i != p->end ()) {
|
if (i != p->end ()) {
|
||||||
/* failed */
|
/* failed */
|
||||||
remove_all_ports ();
|
remove_session_ports ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue