mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
Don't crash if ardour vamp plugins are n/a #8161
This still assert()s in debug builds. Since those plugins should always be available.
This commit is contained in:
parent
3acd076304
commit
fe1f8effb9
1 changed files with 11 additions and 5 deletions
|
|
@ -38,18 +38,24 @@ LoudnessReader::LoudnessReader (float sample_rate, unsigned int channels, sample
|
||||||
using namespace Vamp::HostExt;
|
using namespace Vamp::HostExt;
|
||||||
PluginLoader* loader (PluginLoader::getInstance ());
|
PluginLoader* loader (PluginLoader::getInstance ());
|
||||||
_ebur_plugin = loader->loadPlugin ("libardourvampplugins:ebur128", sample_rate, PluginLoader::ADAPT_ALL_SAFE);
|
_ebur_plugin = loader->loadPlugin ("libardourvampplugins:ebur128", sample_rate, PluginLoader::ADAPT_ALL_SAFE);
|
||||||
assert (_ebur_plugin);
|
assert (_ebur_plugin); // should always be available
|
||||||
|
if (_ebur_plugin) {
|
||||||
_ebur_plugin->reset ();
|
_ebur_plugin->reset ();
|
||||||
if (!_ebur_plugin->initialise (channels, _bufsize, _bufsize)) {
|
if (!_ebur_plugin->initialise (channels, _bufsize, _bufsize)) {
|
||||||
delete _ebur_plugin;
|
delete _ebur_plugin;
|
||||||
_ebur_plugin = 0;
|
_ebur_plugin = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int c = 0; c < _channels; ++c) {
|
for (unsigned int c = 0; c < _channels; ++c) {
|
||||||
using namespace Vamp::HostExt;
|
using namespace Vamp::HostExt;
|
||||||
PluginLoader* loader (PluginLoader::getInstance ());
|
PluginLoader* loader (PluginLoader::getInstance ());
|
||||||
Vamp::Plugin* dbtp_plugin = loader->loadPlugin ("libardourvampplugins:dBTP", sample_rate, PluginLoader::ADAPT_ALL_SAFE);
|
Vamp::Plugin* dbtp_plugin = loader->loadPlugin ("libardourvampplugins:dBTP", sample_rate, PluginLoader::ADAPT_ALL_SAFE);
|
||||||
|
assert (dbtp_plugin); // should always be available
|
||||||
|
if (!dbtp_plugin) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dbtp_plugin->reset ();
|
dbtp_plugin->reset ();
|
||||||
if (!dbtp_plugin->initialise (1, _bufsize, _bufsize)) {
|
if (!dbtp_plugin->initialise (1, _bufsize, _bufsize)) {
|
||||||
delete dbtp_plugin;
|
delete dbtp_plugin;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue