summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-24 13:22:05 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-24 13:22:05 +0000
commit4f80127142d56f57f8ec9c50e73d2ad57adf3e85 (patch)
tree38b93c0b849ebf3ccba38a6065d9c08f3acc8ba7 /libmpdemux
parentcad15646efbeebb61f88fb31091f70f061606cb0 (diff)
downloadmpv-4f80127142d56f57f8ec9c50e73d2ad57adf3e85.tar.bz2
mpv-4f80127142d56f57f8ec9c50e73d2ad57adf3e85.tar.xz
Escape urls (needed for urls in playlists)
Based on an idea by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12271 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/open.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libmpdemux/open.c b/libmpdemux/open.c
index af1eafee28..641dcbeb4b 100644
--- a/libmpdemux/open.c
+++ b/libmpdemux/open.c
@@ -113,6 +113,7 @@ static void smb_auth_fn(const char *server, const char *share,
stream_t* open_stream(char* filename,char** options, int* file_format){
stream_t* stream=NULL;
+char *escfilename=NULL;
int f=-1;
off_t len;
@@ -484,8 +485,13 @@ if(strncmp("dvd://",filename,6) == 0){
if (strncmp("tv://", filename, 5) && strncmp("mf://", filename, 5) &&
strncmp("vcd://", filename, 6) && strncmp("dvb://", filename, 6) &&
strncmp("cdda://", filename, 7) && strncmp("cddb://", filename, 7) &&
- strstr(filename, "://"))
- url = url_new(filename);
+ strstr(filename, "://")) {
+ //fix filenames with special characters
+ escfilename = malloc(strlen(filename)*4);
+ url_escape_string(escfilename,filename);
+ mp_msg(MSGT_OPEN,MSGL_V,"Filename for url is now %s\n",escfilename);
+ url = url_new(escfilename);
+ }
if(url) {
if (strcmp(url->protocol, "smb")==0){
#ifdef LIBSMBCLIENT