diff options
author | phintuka <phintuka> | 2010-03-12 22:47:28 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2010-03-12 22:47:28 +0000 |
commit | 9a1d7901520ec76010917ccba636636bd2eae725 (patch) | |
tree | 8f8d39a3ca83c301c3a32289b02c713d808a7c9e | |
parent | 40c9437bc979460c92d0c7e47ee9d64d25980428 (diff) | |
download | xineliboutput-9a1d7901520ec76010917ccba636636bd2eae725.tar.gz xineliboutput-9a1d7901520ec76010917ccba636636bd2eae725.tar.bz2 |
Removed deprecated EscapeMrl()
-rw-r--r-- | tools/playlist.c | 63 | ||||
-rw-r--r-- | tools/playlist.h | 4 |
2 files changed, 2 insertions, 65 deletions
diff --git a/tools/playlist.c b/tools/playlist.c index 5ea22c7f..65fe4057 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.28 2010-02-23 22:35:54 phintuka Exp $ + * $Id: playlist.c,v 1.29 2010-03-12 22:47:28 phintuka Exp $ * */ @@ -1007,67 +1007,6 @@ cString cPlaylist::BuildMrl(const char *proto, const char *s1, const char *s2, c s4 ? *EscapeString(s4) : ""); } -cString cPlaylist::EscapeMrl(const char *mrl) -{ - static const uint8_t hex[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; - const uint8_t *fn = (const uint8_t*)mrl; - int size = strlen(mrl) + 16; - char *buf = (char *)malloc(size); - int i = 0, found = 0; - LOGVERBOSE("cPlaylist::EscapeMrl('%s')", fn); - - // Wait for first '/' (do not escape mrl start dvd:/, http://a@b/, ...) - if (*fn == '/') - found = 3; - - while (*fn) { - if(size-7 < i) - buf = (char *)realloc(buf, (size=size+16)); - switch (*fn) { - case 1 ... ' ': - case 127 ... 255: - case '#': - case '%': - case ':': - case ';': - case '\'': - case '\"': - case '(': - case ')': - if (found > 2) { - buf[i++] = '%'; - buf[i++] = hex[(*fn & 0xf0)>>4]; - buf[i++] = hex[(*fn & 0x0f)]; - break; - } - default: - // file:/... -> only one '/' before escaping - // http://.../ --> three '/' before escaping - if(!found && (fn[0] == ':' && fn[1] == '/')) { - if(fn[2] == '/') { - // ex. http://user:pass@host/... --> wait for third '/' - buf[i++] = *fn++; - buf[i++] = *fn++; - found += 2; - } else { - // ex. file:/local_file - buf[i++] = *fn++; - found += 3; - } - } else if(*fn == '/') { - found++; - } - buf[i++] = *fn; - break; - } - fn++; - } - - buf[i] = 0; - LOGVERBOSE(" --> '%s'", buf); - return cString(buf, true); -} - cString cPlaylist::GetEntry(cPlaylistItem *i, bool isPlaylist, bool isCurrent) { cString Entry = ""; diff --git a/tools/playlist.h b/tools/playlist.h index 947bb9c7..3becbeb4 100644 --- a/tools/playlist.h +++ b/tools/playlist.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: playlist.h,v 1.11 2010-02-03 11:23:11 phintuka Exp $ + * $Id: playlist.h,v 1.12 2010-03-12 22:47:28 phintuka Exp $ * */ @@ -126,8 +126,6 @@ class cPlaylist : protected cList<cPlaylistItem> static cString BuildMrl(const char *proto, const char *s1, const char *s2 = NULL, const char *s3 = NULL, const char *s4 = NULL); - static cString EscapeMrl(const char *name); - static cString GetEntry(cPlaylistItem *i, bool isPlaylist = false, bool isCurrent = false); }; |