summaryrefslogtreecommitdiff
path: root/libs/ardour/export_graph_builder.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 19:45:20 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 19:45:20 +0000
commitd54d26e822661e76a56fe7d8bb371f1b3944e066 (patch)
tree69b42772bf35150542e1c831e42ed0b0e517c445 /libs/ardour/export_graph_builder.cc
parentaa76272ae789a1120478840f12be18585340cd6b (diff)
Inrease the export "chunk size" to speed it up over 10% at least in some situations
git-svn-id: svn://localhost/ardour2/branches/3.0@12919 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r--libs/ardour/export_graph_builder.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc
index 5061bcecfd..2be9044415 100644
--- a/libs/ardour/export_graph_builder.cc
+++ b/libs/ardour/export_graph_builder.cc
@@ -1,6 +1,7 @@
#include "ardour/export_graph_builder.h"
#include "audiographer/process_context.h"
+#include "audiographer/general/chunker.h"
#include "audiographer/general/interleaver.h"
#include "audiographer/general/normalizer.h"
#include "audiographer/general/peak_reader.h"
@@ -474,11 +475,18 @@ ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, F
typedef ExportChannelConfiguration::ChannelList ChannelList;
config = new_config;
- max_frames = parent.session.engine().frames_per_cycle();
+ framecnt_t max_frames = parent.session.engine().frames_per_cycle();
interleaver.reset (new Interleaver<Sample> ());
interleaver->init (new_config.channel_config->get_n_chans(), max_frames);
+ // Make the chunk size divisible by the channel count
+ int chan_count = new_config.channel_config->get_n_chans();
+ max_frames_out = 8192;
+ max_frames_out -= max_frames_out % chan_count;
+ chunker.reset (new Chunker<Sample> (max_frames_out));
+ interleaver->add_output(chunker);
+
ChannelList const & channel_list = config.channel_config->get_channels();
unsigned chan = 0;
for (ChannelList::const_iterator it = channel_list.begin(); it != channel_list.end(); ++it, ++chan) {
@@ -498,6 +506,8 @@ ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, F
void
ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
{
+ assert (*this == new_config);
+
for (boost::ptr_list<SilenceHandler>::iterator it = children.begin(); it != children.end(); ++it) {
if (*it == new_config) {
it->add_child (new_config);
@@ -505,9 +515,8 @@ ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
}
}
- framecnt_t const max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
- interleaver->add_output (children.back().sink ());
+ chunker->add_output (children.back().sink ());
}
bool