summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
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