mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed selecting preferred audio for multi audio channels (cont'd)
This commit is contained in:
parent
7673d5124a
commit
defe0831f9
6
i18n.c
6
i18n.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: i18n.c 1.207 2005/09/09 15:14:16 kls Exp $
|
* $Id: i18n.c 1.208 2005/09/10 10:20:48 kls Exp $
|
||||||
*
|
*
|
||||||
* Translations provided by:
|
* Translations provided by:
|
||||||
*
|
*
|
||||||
@ -5539,6 +5539,7 @@ const char *I18nNormalizeLanguageCode(const char *Code)
|
|||||||
bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, int &OldPreference, int *Position)
|
bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, int &OldPreference, int *Position)
|
||||||
{
|
{
|
||||||
int pos = 1;
|
int pos = 1;
|
||||||
|
bool found = false;
|
||||||
while (LanguageCode) {
|
while (LanguageCode) {
|
||||||
int LanguageIndex = I18nLanguageIndex(LanguageCode);
|
int LanguageIndex = I18nLanguageIndex(LanguageCode);
|
||||||
for (int i = 0; i < I18nNumLanguages; i++) {
|
for (int i = 0; i < I18nNumLanguages; i++) {
|
||||||
@ -5549,6 +5550,7 @@ bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode,
|
|||||||
OldPreference = i;
|
OldPreference = i;
|
||||||
if (Position)
|
if (Position)
|
||||||
*Position = pos;
|
*Position = pos;
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5564,5 +5566,5 @@ bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode,
|
|||||||
OldPreference = I18nNumLanguages; // higher than the maximum possible value
|
OldPreference = I18nNumLanguages; // higher than the maximum possible value
|
||||||
return true; // if we don't find a preferred one, we take the first one
|
return true; // if we don't find a preferred one, we take the first one
|
||||||
}
|
}
|
||||||
return OldPreference >= 0;
|
return found;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user