summaryrefslogtreecommitdiff
path: root/tools/iso639.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/iso639.h')
-rw-r--r--tools/iso639.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/iso639.h b/tools/iso639.h
index ae30fa0e..cd0e954f 100644
--- a/tools/iso639.h
+++ b/tools/iso639.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: iso639.h,v 1.4 2009-05-29 14:25:06 phintuka Exp $
+ * $Id: iso639.h,v 1.1.2.1 2008-09-26 13:49:45 phintuka Exp $
*
*/
@@ -60,7 +60,6 @@ static const struct {
{"guj", "gu"},
{"hau", "ha"},
{"heb", "he"},
- {"heb", "iw"},
{"hin", "hi"},
{"hun", "hu"},
{"ice", "is"},
@@ -158,9 +157,9 @@ static const struct {
static const char *iso639_2_to_iso639_1(const char *lang)
{
if (lang && lang[0]) {
- if (lang[1] && !lang[2]) {
+ if(lang[1] && !lang[2]) {
for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++)
- if (!memcmp(ISO639_map[i].iso639_1, lang, 2))
+ if (((uint16_t*)ISO639_map[i].iso639_1)[0] == ((uint16_t*)lang)[0])
return ISO639_map[i].iso639_2;
LOGMSG("Unknown iso639-2 code: %s", lang);
}
@@ -172,9 +171,10 @@ static const char *iso639_2_to_iso639_1(const char *lang)
static const char *iso639_1_to_iso639_2(const char *lang)
{
if (lang && lang[0]) {
- if (lang[1] && lang[2] && !lang[3]) {
+ if(lang[1] && lang[2] && !lang[3]) {
for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++)
- if (!memcmp(ISO639_map[i].iso639_2, lang, 3))
+ if (((uint16_t*)ISO639_map[i].iso639_2)[0] == ((uint16_t*)lang)[0] &&
+ ((uint8_t *)ISO639_map[i].iso639_2)[2] == ((uint8_t *)lang)[2])
return ISO639_map[i].iso639_1;
LOGMSG("Unknown iso639-1 code: %s", lang);
}