mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Continue export-roll to flush buffers
This is required when using plugins to write data.
This commit is contained in:
parent
a13a797600
commit
ebc887e33d
1 changed files with 21 additions and 13 deletions
|
|
@ -295,11 +295,31 @@ ExportHandler::process_timespan (samplecnt_t samples)
|
|||
samplecnt_t samples_to_read = 0;
|
||||
samplepos_t const end = current_timespan->get_end();
|
||||
|
||||
if (process_position >= end) {
|
||||
/* export complete, post-roll to feed and flush latent plugins
|
||||
* (This is mainly neede for Vapor) */
|
||||
if (process_position + samples < end + session.worst_latency_preroll ()) {
|
||||
process_position += samples;
|
||||
return 0;
|
||||
}
|
||||
|
||||
export_status->stop = true;
|
||||
|
||||
/* Start post-processing/normalizing if necessary */
|
||||
post_processing = graph_builder->need_postprocessing ();
|
||||
if (post_processing) {
|
||||
export_status->total_postprocessing_cycles = graph_builder->get_postprocessing_cycle_count();
|
||||
export_status->current_postprocessing_cycle = 0;
|
||||
} else {
|
||||
finish_timespan ();
|
||||
}
|
||||
return 1; /* trigger realtime_stop() */
|
||||
}
|
||||
|
||||
bool const last_cycle = (process_position + samples >= end);
|
||||
|
||||
if (last_cycle) {
|
||||
samples_to_read = end - process_position;
|
||||
export_status->stop = true;
|
||||
} else {
|
||||
samples_to_read = samples;
|
||||
}
|
||||
|
|
@ -312,18 +332,6 @@ ExportHandler::process_timespan (samplecnt_t samples)
|
|||
export_status->processed_samples_current_timespan += ret;
|
||||
}
|
||||
|
||||
/* Start post-processing/normalizing if necessary */
|
||||
if (last_cycle) {
|
||||
post_processing = graph_builder->need_postprocessing ();
|
||||
if (post_processing) {
|
||||
export_status->total_postprocessing_cycles = graph_builder->get_postprocessing_cycle_count();
|
||||
export_status->current_postprocessing_cycle = 0;
|
||||
} else {
|
||||
finish_timespan ();
|
||||
}
|
||||
return 1; /* trigger realtime_stop() */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue