changeset 12270:24c13ef4f42b

Escape urls (needed for urls in playlists) Based on an idea by adland
author rtognimp
date Sat, 24 Apr 2004 13:22:05 +0000
parents c0c2eb1bfbf1
children 4adb4a3b52a2
files libmpdemux/open.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/open.c	Sat Apr 24 13:19:20 2004 +0000
+++ b/libmpdemux/open.c	Sat Apr 24 13:22:05 2004 +0000
@@ -113,6 +113,7 @@
 
 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("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