[Mplayer-cvslog] CVS: main/libmpdemux open.c,1.92,1.93

Roberto Togni CVS syncmail at mplayerhq.hu
Sat Apr 24 15:22:08 CEST 2004


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv30600

Modified Files:
	open.c 
Log Message:
Escape urls (needed for urls in playlists)
Based on an idea by adland


Index: open.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/open.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- open.c	24 Apr 2004 13:19:20 -0000	1.92
+++ open.c	24 Apr 2004 13:22:05 -0000	1.93
@@ -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




More information about the MPlayer-cvslog mailing list