diff options
| author | phintuka <phintuka> | 2011-03-19 16:47:56 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-03-19 16:47:56 +0000 |
| commit | 51f842b97e822376f57d62917f1edb4943bb3fae (patch) | |
| tree | be94c926cf009bb1b3800b3902d497da9ebdac2a | |
| parent | 6a8386bfcb3cba226b8109722ec46322b579b5b1 (diff) | |
| download | xineliboutput-51f842b97e822376f57d62917f1edb4943bb3fae.tar.gz xineliboutput-51f842b97e822376f57d62917f1edb4943bb3fae.tar.bz2 | |
Fixed language code conversion function names
| -rw-r--r-- | frontend.c | 8 | ||||
| -rw-r--r-- | tools/iso639.h | 10 |
2 files changed, 9 insertions, 9 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.93 2010-12-17 13:07:52 phintuka Exp $ + * $Id: frontend.c,v 1.94 2011-03-19 16:47:55 phintuka Exp $ * */ @@ -150,7 +150,7 @@ void cXinelibThread::InfoHandler(const char *info) char *lang = map; while(*map && *map != ' ') map++; if(*map == ' ') { *map = 0; map++; }; - cXinelibDevice::Instance().SetAvailableTrack(ttSubtitle, id, id+1, iso639_2_to_iso639_1(lang) ?: *cString::sprintf("%03d", id+1)); + cXinelibDevice::Instance().SetAvailableTrack(ttSubtitle, id, id+1, iso639_1_to_iso639_2(lang) ?: *cString::sprintf("%03d", id+1)); if (Current) CurrentTrack = id; } @@ -179,7 +179,7 @@ void cXinelibThread::InfoHandler(const char *info) char *lang = map; while(*map && *map != ' ') map++; if(*map == ' ') { *map = 0; map++; }; - cXinelibDevice::Instance().SetAvailableTrack(ttDolby, id, ttDolby+id, iso639_2_to_iso639_1(lang) ?: *cString::sprintf("%03d", id+1)); + cXinelibDevice::Instance().SetAvailableTrack(ttDolby, id, ttDolby+id, iso639_1_to_iso639_2(lang) ?: *cString::sprintf("%03d", id+1)); if(Current) cXinelibDevice::Instance().SetCurrentAudioTrack((eTrackType)(ttDolby+id)); } @@ -775,7 +775,7 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, if (langs) { char lang1[5]; strn0cpy(lang1, langs, 4); /* truncate */ - const char *spu_lang = iso639_1_to_iso639_2(lang1); + const char *spu_lang = iso639_2_to_iso639_1(lang1); LOGMSG("Preferred SPU language: %s (%s)", lang1, spu_lang); if (spu_lang && spu_lang[0] && spu_lang[1] && !spu_lang[2]) Xine_Control(cString::sprintf("SPUSTREAM %s", spu_lang)); diff --git a/tools/iso639.h b/tools/iso639.h index ae30fa0e..f314b876 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.5 2011-03-19 16:47:56 phintuka Exp $ * */ @@ -155,28 +155,28 @@ static const struct { {"zul", "zu"}, }; -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]) { for (unsigned int i = 0 ; i < sizeof(ISO639_map) / sizeof(ISO639_map[0]); i++) if (!memcmp(ISO639_map[i].iso639_1, lang, 2)) return ISO639_map[i].iso639_2; - LOGMSG("Unknown iso639-2 code: %s", lang); + LOGMSG("Unknown iso639-1 code: %s", lang); } return lang; } return NULL; } -static const char *iso639_1_to_iso639_2(const char *lang) +static const char *iso639_2_to_iso639_1(const char *lang) { if (lang && lang[0]) { 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)) return ISO639_map[i].iso639_1; - LOGMSG("Unknown iso639-1 code: %s", lang); + LOGMSG("Unknown iso639-2 code: %s", lang); } return lang; } |
