From 4e717815c78650b78c10b0d251ebb56ac92eaef1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 13 Mar 2021 00:12:02 +0100 Subject: [PATCH] GUI: mux: derive track languages from file names case insensitively Fixes #3068. --- NEWS.md | 3 +++ src/mkvtoolnix-gui/merge/source_file.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 93f9e9b3d..9315082c8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,9 @@ * mkvinfo: when compiled with newer versions of the `fmt` library, certain numbers were not output correctly (e.g. a track's audio sampling frequency of 48000 might be output as 48). +* MKVToolNix GUI: multiplexer: deriving the track language from the file name + will match languages case insensitively again (like versions prior to + v55). Fixes #3068. ## Build system changes diff --git a/src/mkvtoolnix-gui/merge/source_file.cpp b/src/mkvtoolnix-gui/merge/source_file.cpp index a8ffb780e..115f612e3 100644 --- a/src/mkvtoolnix-gui/merge/source_file.cpp +++ b/src/mkvtoolnix-gui/merge/source_file.cpp @@ -356,8 +356,8 @@ SourceFile::setupProgramMapFromProperties() { mtx::bcp47::language_c SourceFile::deriveLanguageFromFileName() { auto &cfg = Util::Settings::get(); - auto fileName = QFileInfo{m_fileName}.fileName(); - auto matches = QRegularExpression{Q("s\\d+e\\d{2,}(.+)"), QRegularExpression::CaseInsensitiveOption}.match(fileName); + auto fileName = QFileInfo{m_fileName}.fileName().toLower(); + auto matches = QRegularExpression{Q("s\\d+e\\d{2,}(.+)")}.match(fileName); if (matches.hasMatch()) { fileName = matches.captured(1);