diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-11 02:11:44 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-11 02:22:54 +0100 |
commit | 6c10b31af146741bc1f6f3072de5bf94db2903d9 (patch) | |
tree | 4b8fb58959962beae3a6486b70e6ad74c9ad3e83 /libs/ardour | |
parent | fa033a7293c293a53472c696b5a39b1789096874 (diff) |
only instantiate Analysis Processor if needed
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 85857f21ef..bdcdf2620e 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -305,10 +305,10 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c config = new_config; data_width = sndfile_data_width (Encoder::get_real_format (config)); unsigned channels = new_config.channel_config->get_n_chans(); - analyser.reset (new Analyser (config.format->sample_rate(), channels, max_frames, - (framecnt_t) ceil (parent.timespan->get_length () * config.format->sample_rate () / (double) parent.session.nominal_frame_rate ()))); _analyse = config.format->analyse(); if (_analyse) { + analyser.reset (new Analyser (config.format->sample_rate(), channels, max_frames, + (framecnt_t) ceil (parent.timespan->get_length () * config.format->sample_rate () / (double) parent.session.nominal_frame_rate ()))); parent.add_analyser (config.filename->get_path (config.format), analyser); } @@ -316,18 +316,19 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c short_converter = ShortConverterPtr (new SampleFormatConverter<short> (channels)); short_converter->init (max_frames, config.format->dither_type(), data_width); add_child (config); - analyser->add_output (short_converter); + if (_analyse) { analyser->add_output (short_converter); } + } else if (data_width == 24 || data_width == 32) { int_converter = IntConverterPtr (new SampleFormatConverter<int> (channels)); int_converter->init (max_frames, config.format->dither_type(), data_width); add_child (config); - analyser->add_output (int_converter); + if (_analyse) { analyser->add_output (int_converter); } } else { int actual_data_width = 8 * sizeof(Sample); float_converter = FloatConverterPtr (new SampleFormatConverter<Sample> (channels)); float_converter->init (max_frames, config.format->dither_type(), actual_data_width); add_child (config); - analyser->add_output (float_converter); + if (_analyse) { analyser->add_output (float_converter); } } } |