[MPlayer-dev-eng] Re: [PATCH] fix for issue cant play filenames with spaces

adland adland123 at yahoo.com
Thu Apr 29 23:38:23 CEST 2004


>  - unescape url before escaping it

I tried testing this change alone and it does not work due to a double
 escapeing issue.

and the escape url function is now broken.

%20 or space
becomes
%2520
which fails at the server

>  - do not overallocate escfilename
>  - fix memleak of escfilename
> 

could we do these 2 parts of your patch and merge with other patch I sent
as this would be a better fix.

new diff is below which I retested with my change.

thanks

--- main/libmpdemux/open.c      2004-04-24 09:22:05.000000000 -0400
+++ updated/libmpdemux/open.c   2004-04-29 17:33:32.000000000 -0400
@@ -487,10 +487,11 @@
     strncmp("cdda://", filename, 7) && strncmp("cddb://", filename, 7) &&
     strstr(filename, "://")) {
      //fix filenames with special characters
-     escfilename = malloc(strlen(filename)*4);
+     escfilename = malloc(strlen(filename)*3+1);
      url_escape_string(escfilename,filename);
      mp_msg(MSGT_OPEN,MSGL_V,"Filename for url is now %s\n",escfilename);
      url = url_new(escfilename);
+     free(escfilename);
     }
   if(url) {
        if (strcmp(url->protocol, "smb")==0){






More information about the MPlayer-dev-eng mailing list