diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/iconv.h | 6 | ||||
-rw-r--r-- | tools/iso639.h | 17 | ||||
-rw-r--r-- | tools/metainfo_menu.c | 3 | ||||
-rw-r--r-- | tools/pes.c | 10 | ||||
-rw-r--r-- | tools/playlist.c | 5 |
5 files changed, 27 insertions, 14 deletions
diff --git a/tools/iconv.h b/tools/iconv.h index 3ce0fb28..947ecd50 100644 --- a/tools/iconv.h +++ b/tools/iconv.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: iconv.h,v 1.5 2007-09-18 09:13:13 phintuka Exp $ + * $Id: iconv.h,v 1.5.2.1 2008-09-26 13:14:37 phintuka Exp $ * */ @@ -74,11 +74,7 @@ cString cIConv::Translate(const char *Text) const size_t inc = strlen(Text); size_t outc = inc<2048 ? 2048 : inc+1; -#ifdef __APPLE__ - const char *in = Text; -#else char *in = (char*)Text; -#endif char *buf = (char*)malloc(outc+1); char *out = buf; diff --git a/tools/iso639.h b/tools/iso639.h index 66438f13..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.1 2008-02-20 03:55:11 phintuka Exp $ + * $Id: iso639.h,v 1.1.2.1 2008-09-26 13:49:45 phintuka Exp $ * */ @@ -168,4 +168,19 @@ static const char *iso639_2_to_iso639_1(const char *lang) return NULL; } +static const char *iso639_1_to_iso639_2(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 (((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); + } + return lang; + } + return NULL; +} + #endif diff --git a/tools/metainfo_menu.c b/tools/metainfo_menu.c index 56a3f388..0477916d 100644 --- a/tools/metainfo_menu.c +++ b/tools/metainfo_menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: metainfo_menu.c,v 1.1 2008-05-07 13:27:15 phintuka Exp $ + * $Id: metainfo_menu.c,v 1.1.2.1 2008-09-26 13:16:49 phintuka Exp $ * */ @@ -47,6 +47,7 @@ void cMetainfoMenu::Display(void) md_list = EXTRACTOR_getKeywords(plugins, m_Filename); md_list = EXTRACTOR_removeEmptyKeywords (md_list); md_list = EXTRACTOR_removeDuplicateKeywords(md_list, 0); + md_list = EXTRACTOR_removeKeywordsOfType(md_list, EXTRACTOR_THUMBNAILS); const char *key; char * buf; diff --git a/tools/pes.c b/tools/pes.c index 2845bf07..c2d54a30 100644 --- a/tools/pes.c +++ b/tools/pes.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: pes.c,v 1.2 2008-02-04 23:49:50 phintuka Exp $ + * $Id: pes.c,v 1.2.2.1 2008-09-26 19:08:25 phintuka Exp $ * */ @@ -24,7 +24,7 @@ int64_t pes_get_pts(const uint8_t *buf, int len) if ((buf[6] & 0x30) != 0) return INT64_C(-1); - if ((len > 14) && (buf[7] & 0x80)) { /* pts avail */ + if ((len > 13) && (buf[7] & 0x80)) { /* pts avail */ int64_t pts; pts = ((int64_t)(buf[ 9] & 0x0E)) << 29 ; pts |= ((int64_t) buf[10]) << 22 ; @@ -69,7 +69,7 @@ void pes_change_pts(uint8_t *buf, int len, int64_t new_pts) if ((buf[6] & 0x30) != 0) return; - if ((len > 14) && (buf[7] & 0x80)) { /* pts avail */ + if ((len > 13) && (buf[7] & 0x80)) { /* pts avail */ buf[ 9] = ((new_pts >> 29) & 0x0E) | (buf[ 9] & 0xf1); buf[10] = ((new_pts >> 22) & 0xFF); buf[11] = ((new_pts >> 14) & 0xFE) | (buf[11] & 0x01); @@ -94,8 +94,8 @@ int pes_strip_pts_dts(uint8_t *buf, int size) pes_len -= n; /* update packet len */ buf[4] = pes_len >> 8; /* packet len (hi) */ buf[5] = pes_len & 0xff; /* packet len (lo) */ - buf[7] &= 0x7f; /* clear pts flag */ - buf[8] -= 5; /* update header len */ + buf[7] &= 0x3f; /* clear pts and dts flags */ + buf[8] -= n; /* update header len */ memmove(buf+4+n, buf+9+n, size-9-n); return size - n; } diff --git a/tools/playlist.c b/tools/playlist.c index 9f4c85c3..0217eca7 100644 --- a/tools/playlist.c +++ b/tools/playlist.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: playlist.c,v 1.17 2008-04-03 15:11:26 phelin Exp $ + * $Id: playlist.c,v 1.17.2.1 2008-09-26 19:09:29 phintuka Exp $ * */ @@ -873,7 +873,8 @@ bool cPlaylist::Read(const char *PlaylistFile, bool Recursive) if(strrchr(m_Name, '.')) *(strrchr(m_Name, '.')) = 0; - } else if(PlaylistFile[strlen(PlaylistFile)-1] == '/') { + } else if(PlaylistFile[ 0] == '/' && + PlaylistFile[strlen(PlaylistFile)-1] == '/') { // Scan folder Result = ScanFolder(PlaylistFile, Recursive) > 0; m_Origin = eImplicit; |