summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-10-02 21:22:36 +0200
committerRobin Gareus <robin@gareus.org>2018-10-02 21:28:49 +0200
commit62cd539143f83cb1464ca06811ae5246c3193d7c (patch)
tree12a0ed7a146e759a7ad1804e6d40a9c77c207112
parent2b95b5b8b36fa515bfad67eec55f0b44a0d7d6bc (diff)
Fix false-positive duplicate format detection
Previously, stem-exports of more than 1 channel always included the export-format, even if only one format was exported.
-rw-r--r--libs/ardour/export_filename.cc3
-rw-r--r--libs/ardour/export_handler.cc11
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc
index 1c8c53d117..511db44a6b 100644
--- a/libs/ardour/export_filename.cc
+++ b/libs/ardour/export_filename.cc
@@ -185,8 +185,7 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const
&& !include_timespan
&& !include_channel_config
&& !include_channel
- && !include_date
- && !include_format_name) {
+ && !include_date) {
with_timespan = true;
}
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index 3cad72c8d9..cd3d61731d 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -227,7 +227,16 @@ ExportHandler::handle_duplicate_format_extensions()
ExtCountMap counts;
for (ConfigMap::iterator it = timespan_bounds.first; it != timespan_bounds.second; ++it) {
- counts[it->second.format->extension()]++;
+ if (it->second.filename->include_channel_config && it->second.channel_config) {
+ /* stem-export has multiple files in the same timestamp, but a different channel_config for each.
+ * However channel_config is only set in ExportGraphBuilder::Encoder::init_writer()
+ * so we cannot yet use it->second.filename->get_path(it->second.format).
+ * We have to explicily check uniqueness of "channel-config + extension" here:
+ */
+ counts[it->second.channel_config->name() + it->second.format->extension()]++;
+ } else {
+ counts[it->second.format->extension()]++;
+ }
}
bool duplicates_found = false;