mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Fix Analysis duration for added silence
This commit is contained in:
parent
9ab061c6cb
commit
e18e765c75
2 changed files with 6 additions and 2 deletions
|
|
@ -307,8 +307,12 @@ ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_c
|
||||||
unsigned channels = new_config.channel_config->get_n_chans();
|
unsigned channels = new_config.channel_config->get_n_chans();
|
||||||
_analyse = config.format->analyse();
|
_analyse = config.format->analyse();
|
||||||
if (_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,
|
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);
|
parent.add_analyser (config.filename->get_path (config.format), analyser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,8 @@ Analyser::process (ProcessContext<float> const & ctx)
|
||||||
ARDOUR::ExportAnalysisPtr
|
ARDOUR::ExportAnalysisPtr
|
||||||
Analyser::result ()
|
Analyser::result ()
|
||||||
{
|
{
|
||||||
if (_pos == 0) {
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::ExportAnalysis, string_compose ("Processed %1 / %2 samples", _pos, _n_samples));
|
DEBUG_TRACE (PBD::DEBUG::ExportAnalysis, string_compose ("Processed %1 / %2 samples", _pos, _n_samples));
|
||||||
|
if (_pos == 0 || _pos != _n_samples) {
|
||||||
return ARDOUR::ExportAnalysisPtr ();
|
return ARDOUR::ExportAnalysisPtr ();
|
||||||
}
|
}
|
||||||
if (_ebur128_plugin) {
|
if (_ebur128_plugin) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue