13
0

Fix realtime export loudness normalization

TmpFileRt::get_samples_written() returns the number of
samples written *to disk*. It is only valid after the FileFlushed
signal is emitted.

This fixes an assert() with Limiter and Analyzer being configured
with a too low total sample-count, leading to an overflow in
the analysis graph array.
This commit is contained in:
Robin Gareus 2021-04-29 19:05:09 +02:00
parent 5014b20c5f
commit a8c47da364
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 5 additions and 2 deletions

View File

@ -720,7 +720,6 @@ void
ExportGraphBuilder::Intermediate::prepare_post_processing()
{
for (boost::ptr_list<SFC>::iterator i = children.begin(); i != children.end(); ++i) {
(*i).set_duration (tmp_file->get_samples_written() / config.channel_config->get_n_chans());
if (use_peak) {
(*i).set_peak_dbfs (peak_reader->get_peak());
}
@ -736,6 +735,10 @@ ExportGraphBuilder::Intermediate::prepare_post_processing()
void
ExportGraphBuilder::Intermediate::start_post_processing()
{
for (boost::ptr_list<SFC>::iterator i = children.begin(); i != children.end(); ++i) {
(*i).set_duration (tmp_file->get_samples_written() / config.channel_config->get_n_chans());
}
tmp_file->seek (0, SEEK_SET);
/* called in disk-thread when exporting in realtime,

View File

@ -73,7 +73,7 @@ Limiter::set_duration (samplecnt_t s)
return;
}
const size_t n_data = sizeof (_result->limiter_pk) / sizeof (float);
_spp = ceilf (s / (float) n_data);
_spp = ceilf ((s + 2.f) / (float) n_data);
}
void