summaryrefslogtreecommitdiff
path: root/libs/ardour/export_graph_builder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-03-01 15:42:23 +0000
committerCarl Hetherington <carl@carlh.net>2012-03-01 15:42:23 +0000
commit683455c02e3667df01647b30dd4409594376e9e0 (patch)
treef03fe1d2ec138bcbebf8dd3c38b64d50e78fd637 /libs/ardour/export_graph_builder.cc
parentbb98baf4136f00cdad0aa962758aa6231478344a (diff)
Patch from colinf to fix crash on stem export of 4-channel tracks (#4750).
git-svn-id: svn://localhost/ardour2/branches/3.0@11571 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_graph_builder.cc')
-rw-r--r--libs/ardour/export_graph_builder.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/export_graph_builder.cc b/libs/ardour/export_graph_builder.cc
index 9b35e16530..8152ff0c20 100644
--- a/libs/ardour/export_graph_builder.cc
+++ b/libs/ardour/export_graph_builder.cc
@@ -293,9 +293,10 @@ ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpe
: parent (parent)
{
config = new_config;
- max_frames_out = 4086; // TODO good chunk size
-
- buffer.reset (new AllocatingProcessContext<Sample> (max_frames_out, config.channel_config->get_n_chans()));
+ uint32_t const channels = config.channel_config->get_n_chans();
+ max_frames_out = 4086 - (4086 % channels); // TODO good chunk size
+
+ buffer.reset (new AllocatingProcessContext<Sample> (max_frames_out, channels));
peak_reader.reset (new PeakReader ());
normalizer.reset (new AudioGrapher::Normalizer (config.format->normalize_target()));
threader.reset (new Threader<Sample> (parent.thread_pool));
@@ -304,8 +305,7 @@ ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpe
normalizer->add_output (threader);
int format = ExportFormatBase::F_RAW | ExportFormatBase::SF_Float;
- tmp_file.reset (new TmpFile<float> (format, config.channel_config->get_n_chans(),
- config.format->sample_rate()));
+ tmp_file.reset (new TmpFile<float> (format, channels, config.format->sample_rate()));
tmp_file->FileWritten.connect_same_thread (post_processing_connection,
boost::bind (&Normalizer::start_post_processing, this));