[MPlayer-dev-eng] Re: [PATCH] opening urlencoded smb:// urls
adland
adland123 at yahoo.com
Thu Apr 15 03:50:34 CEST 2004
> This patch allows mplayer to open urlencoded url like smb://haluska/a%20b.avi
> (I am used to browse samba shares with smb:// kio in konqueror and this patch
> It's
> needed cause konqueror is passing encoded urls)
>
I also submited a patch to purposefully escape URLs because for some instances
it is needed with playlist http entries.
I would like to suggest the following change merging patches
thanks
--- main/libmpdemux/open.c 2003-09-03 15:26:33.000000000 -0400
+++ updated/libmpdemux/open.c 2004-04-14 21:48:09.000000000 -0400
@@ -115,7 +115,10 @@
stream_t* stream=NULL;
int f=-1;
off_t len;
-*file_format = DEMUXER_TYPE_UNKNOWN;
+char *modfilename;
+
+*file_format=DEMUXER_TYPE_UNKNOWN;
+
if(!filename) {
mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n");
return NULL;
@@ -480,7 +483,18 @@
strncmp("vcd://", filename, 6) && strncmp("dvb://", filename, 6) &&
strncmp("cdda://", filename, 7) && strncmp("cddb://", filename, 7) &&
strstr(filename, "://"))
- url = url_new(filename);
+ {
+ if (!strncmp("http://",filename,7)) {
+ url_escape_string(modfilename, filename);
+ url = url_new(modfilename);
+ } else if (!strncmp("smb://",filename,6)) {
+ url_unescape_string(modfilename, filename);
+ url = url_new(modfilename);
+ } else {
+ url = url_new(filename);
+ }
+ }
+
if(url) {
if (strcmp(url->protocol, "smb")==0){
#ifdef LIBSMBCLIENT
More information about the MPlayer-dev-eng
mailing list