Fix a crash in rhythm ferret if the relevant plugin couldn't be found for some reason

The crash was caused by not catching 'failed_constructor()' (which gets thrown in the c'tor for AudioAnalyser).
This commit is contained in:
John Emmas 2017-02-04 12:58:33 +00:00
parent d1599abad3
commit efd859a0ee

View file

@ -253,6 +253,7 @@ RhythmFerret::run_analysis ()
int
RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr<Readable> readable, frameoffset_t /*offset*/, AnalysisFeatureList& results)
{
try {
TransientDetector t (_session->frame_rate());
for (uint32_t i = 0; i < readable->n_channels(); ++i) {
@ -277,6 +278,11 @@ RhythmFerret::run_percussion_onset_analysis (boost::shared_ptr<Readable> readabl
t.update_positions (readable.get(), i, results);
}
} catch (failed_constructor& err) {
error << "Could not load percussion onset detection plugin" << endmsg;
return -1;
}
return 0;
}