ALSA|Dummy: ignore port unregistration when engine is stopped

When changing Engine parameters, ardour first stops
the engine and only later when re-etablishing ports
unregisters/re-registers them.

ALSA: silently ignore port unregs and silently accept registrations
Dummy: print a PBD::info message,
This commit is contained in:
Robin Gareus 2014-09-08 01:25:56 +02:00
parent dc318e6e74
commit b1da9af8de
2 changed files with 9 additions and 4 deletions

View file

@ -914,8 +914,8 @@ AlsaAudioBackend::add_port (
void void
AlsaAudioBackend::unregister_port (PortEngine::PortHandle port_handle) AlsaAudioBackend::unregister_port (PortEngine::PortHandle port_handle)
{ {
if (!valid_port (port_handle)) { if (!_run) {
PBD::error << _("AlsaBackend::unregister_port: Invalid Port.") << endmsg; return;
} }
AlsaPort* port = static_cast<AlsaPort*>(port_handle); AlsaPort* port = static_cast<AlsaPort*>(port_handle);
std::vector<AlsaPort*>::iterator i = std::find (_ports.begin (), _ports.end (), static_cast<AlsaPort*>(port_handle)); std::vector<AlsaPort*>::iterator i = std::find (_ports.begin (), _ports.end (), static_cast<AlsaPort*>(port_handle));

View file

@ -595,6 +595,9 @@ DummyAudioBackend::register_port (
{ {
if (name.size () == 0) { return 0; } if (name.size () == 0) { return 0; }
if (flags & IsPhysical) { return 0; } if (flags & IsPhysical) { return 0; }
if (!_running) {
PBD::info << _("DummyBackend::register_port: Engine is not running.") << endmsg;
}
return add_port (_instance_name + ":" + name, type, flags); return add_port (_instance_name + ":" + name, type, flags);
} }
@ -631,8 +634,10 @@ DummyAudioBackend::add_port (
void void
DummyAudioBackend::unregister_port (PortEngine::PortHandle port_handle) DummyAudioBackend::unregister_port (PortEngine::PortHandle port_handle)
{ {
if (!valid_port (port_handle)) { if (!_running) {
PBD::error << _("DummyBackend::unregister_port: Invalid Port.") << endmsg; PBD::info << _("DummyBackend::unregister_port: Engine is not running.") << endmsg;
assert (!valid_port (port_handle));
return;
} }
DummyPort* port = static_cast<DummyPort*>(port_handle); DummyPort* port = static_cast<DummyPort*>(port_handle);
std::vector<DummyPort*>::iterator i = std::find (_ports.begin (), _ports.end (), static_cast<DummyPort*>(port_handle)); std::vector<DummyPort*>::iterator i = std::find (_ports.begin (), _ports.end (), static_cast<DummyPort*>(port_handle));