Further reduce DSP load of debug builds

In all years of using these assert()s never triggered. Besides
there are valid_port() tests in other strategic locations that
are not periodically hit in realtime context.
This commit is contained in:
Robin Gareus 2022-05-06 01:25:05 +02:00
parent ed21ea8fc6
commit 226dadbd19
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 3 additions and 7 deletions

View File

@ -219,7 +219,7 @@ Port::connected_to (std::string const & o) const
return false;
}
return port_engine.connected_to (_port_handle, AudioEngine::instance()->make_port_name_non_relative (o));
return port_engine.connected_to (_port_handle, AudioEngine::instance()->make_port_name_non_relative (o), true);
}
int

View File

@ -748,12 +748,12 @@ PortEngineSharedImpl::connected (PortEngine::PortHandle port_handle, bool /* pro
}
bool
PortEngineSharedImpl::connected_to (PortEngine::PortHandle src, const std::string& dst, bool /*process_callback_safe*/)
PortEngineSharedImpl::connected_to (PortEngine::PortHandle src, const std::string& dst, bool process_callback_safe)
{
BackendPortPtr src_port = boost::dynamic_pointer_cast<BackendPort> (src);
BackendPortPtr dst_port = find_port (dst);
#ifndef NDEBUG
if (!valid_port (src_port) || !dst_port) {
if (!process_callback_safe && (!valid_port (src_port) || !dst_port)) {
PBD::error << string_compose (_("%1::connected_to: Invalid Port"), _instance_name) << endmsg;
return false;
}

View File

@ -1790,7 +1790,6 @@ AlsaAudioBackend::get_buffer (PortEngine::PortHandle port_handle, pframes_t nfra
{
BackendPortPtr port = boost::dynamic_pointer_cast<BackendPort> (port_handle);
assert (port);
assert (valid_port (port));
return port->get_buffer (nframes);
}

View File

@ -1218,7 +1218,6 @@ CoreAudioBackend::get_buffer (PortEngine::PortHandle port_handle, pframes_t nfra
{
boost::shared_ptr<BackendPort> port = boost::dynamic_pointer_cast<BackendPort> (port_handle);
assert (port);
assert (valid_port (port));
if (!port || !valid_port (port)) return NULL; // XXX remove me
return port->get_buffer (nframes);
}

View File

@ -1446,7 +1446,6 @@ PortAudioBackend::get_buffer (PortEngine::PortHandle port_handle, pframes_t nfra
{
boost::shared_ptr<BackendPort> port = boost::dynamic_pointer_cast<BackendPort>(port_handle);
assert (port);
assert (valid_port (port));
if (!port || !valid_port (port)) return NULL; // XXX remove me
return port->get_buffer (nframes);
}

View File

@ -981,7 +981,6 @@ PulseAudioBackend::get_buffer (PortEngine::PortHandle port_handle, pframes_t nfr
BackendPortPtr port = boost::dynamic_pointer_cast<BackendPort> (port_handle);
assert (port);
assert (valid_port (port));
return port->get_buffer (nframes);
}