diff options
author | Robin Gareus <robin@gareus.org> | 2016-02-16 13:22:12 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-02-16 13:22:12 +0100 |
commit | e18e765c7553f2fc9b74323065e3bb4452c22cbb (patch) | |
tree | 7d4f32ddfb610b391a315076f63a8363848df7fd | |
parent | 9ab061c6cb317341705cf2e0a2b1af97f9663f23 (diff) |
Fix Analysis duration for added silence
-rw-r--r-- | libs/ardour/export_graph_builder.cc | 6 | ||||
-rw-r--r-- | libs/audiographer/src/general/analyser.cc | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc index 75587dedae..9e25d51513 100644 --- a/libs/ardour/export_graph_builder.cc +++ b/libs/ardour/export_graph_builder.cc @@ -307,8 +307,12 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c unsigned channels = new_config.channel_config->get_n_chans(); _analyse = config.format->analyse(); if (_analyse) { + framecnt_t sample_rate = parent.session.nominal_frame_rate(); + framecnt_t sb = config.format->silence_beginning_at (parent.timespan->get_start(), sample_rate); + framecnt_t se = config.format->silence_end_at (parent.timespan->get_end(), sample_rate); + framecnt_t duration = parent.timespan->get_length () + sb + se; 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 ()))); + (framecnt_t) ceil (duration * config.format->sample_rate () / sample_rate))); parent.add_analyser (config.filename->get_path (config.format), analyser); } diff --git a/libs/audiographer/src/general/analyser.cc b/libs/audiographer/src/general/analyser.cc index d0c58f037f..d216267fbd 100644 --- a/libs/audiographer/src/general/analyser.cc +++ b/libs/audiographer/src/general/analyser.cc @@ -234,8 +234,8 @@ Analyser::process (ProcessContext<float> const & ctx) ARDOUR::ExportAnalysisPtr Analyser::result () { - if (_pos == 0) { DEBUG_TRACE (PBD::DEBUG::ExportAnalysis, string_compose ("Processed %1 / %2 samples", _pos, _n_samples)); + if (_pos == 0 || _pos != _n_samples) { return ARDOUR::ExportAnalysisPtr (); } if (_ebur128_plugin) { |