From 98f5224d4c97f5259d7108c6f2bef48518fe779c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 May 2021 04:16:05 +0200 Subject: [PATCH] Fix incorrect port lists due to custom sort Previously the following were treated as equal "MIDI_foo" == "MIDI bar" So std::map<> PortManager::_ports and PortEngineSharedImpl:_ports could only have either. This resulted in missing ports and missing calls to existing ports in cycle_start(). This mainly affected MIDI tracks with imported files, since there is "MIDI Clock in", and imported files result in tracks "MIDI_file-name". This issue was introduced in 6.6-200-g60ff3ef764 --- libs/pbd/pbd/natsort.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/pbd/pbd/natsort.h b/libs/pbd/pbd/natsort.h index bd03b555a4..e69974e050 100644 --- a/libs/pbd/pbd/natsort.h +++ b/libs/pbd/pbd/natsort.h @@ -139,6 +139,12 @@ naturally_less (const char* a, const char* b) #if 1 /* treat underscore as space, this works around idiosyncratic * ffado port-names: "foo_in", "foo0_in", "foo2_in", etc */ + if (*a == '_' && *b == ' ') { + continue; + } + if (*b == '_' && *a == ' ') { + continue; + } if (*a == '_') { return ' ' < *b; } else if (*b == '_') {