Fix audio source names when importing files with > 2 and <= 26 channels.

This code presumably intended to name sources "foo%a", "foo%b" etc, but
since it was incorrectly appending the character as an integer sources
instead ended up being named "foo%97", "foo%98" etc.

Also changes the branching logic to use this branch upto 26 channels,
rather than just upto 25 channels, as that seems to have been the
intention.
This commit is contained in:
Marijn Kruisselbrink 2023-02-17 12:06:52 -08:00 committed by Robin Gareus
parent 4d7d58196f
commit 8810c36c6e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -4908,9 +4908,9 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan,
sstr << "%R";
}
} else if (nchan > 2) {
if (nchan < 26) {
if (nchan <= 26) {
sstr << '%';
sstr << 'a' + chan;
sstr << static_cast<char>('a' + chan);
} else {
/* XXX what? more than 26 channels! */
sstr << '%';