diff options
author | clsid2 <clsid2@users.sourceforge.net> | 2017-07-27 18:47:51 +0300 |
---|---|---|
committer | Kacper Michajłow <kasper93@users.noreply.github.com> | 2017-08-02 00:21:24 +0300 |
commit | 57e7ee54ffeb60ee0699401be4b56b5e2a7b3958 (patch) | |
tree | 91697594c0373f6e588be9e223d7faee80dcdd6b | |
parent | 3e90bc199dabefb532bd3a2fceaca7595ffb59d9 (diff) |
Improved subtitle selection when no LCID value is available.
Fixes ticket #4112
Signed-off-by: clsid2 <clsid2@users.sourceforge.net>
-rw-r--r-- | src/mpc-hc/MainFrm.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp index 9b308480b..f645c54d6 100644 --- a/src/mpc-hc/MainFrm.cpp +++ b/src/mpc-hc/MainFrm.cpp @@ -11724,7 +11724,8 @@ int CMainFrame::SetupSubtitleStreams() auto findCode = [](const CString & name, const CString & code) {
int nPos = code.IsEmpty() ? -1 : name.Find(code);
return ((nPos == 0 && name.GetLength() == code.GetLength())
- || (nPos > 0 && (name[nPos - 1] == _T('[') || name[nPos - 1] == _T('\t'))));
+ || (nPos > 0 && (name[nPos - 1] == _T('[') || name[nPos - 1] == _T('\t'))))
+ || (nPos > 0 && name[nPos - 1] == _T('.') && (name.GetLength() >= (nPos + code.GetLength() + 1)) && name[nPos + code.GetLength()] == _T('.'));
};
// match anything that starts with the language name or that seems to use a code that matches
if (name.Find(l.name) != 0 && !findCode(name, l.name) && !findCode(name, l.iso6392) && !findCode(name, l.iso6391)) {
|