[Mplayer-cvslog] CVS: main/libmpdemux asf_mmst_streaming.c, 1.22, 1.23

Roberto Togni CVS syncmail at mplayerhq.hu
Fri Jul 2 22:36:53 CEST 2004


CVS change done by Roberto Togni CVS

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

Modified Files:
	asf_mmst_streaming.c 
Log Message:
WMP doesn't encode urls with mmst protocol
Patch by Ilia ( chest4l at mail dot ru )


Index: asf_mmst_streaming.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asf_mmst_streaming.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- asf_mmst_streaming.c	26 Jun 2004 09:55:17 -0000	1.22
+++ asf_mmst_streaming.c	2 Jul 2004 20:36:50 -0000	1.23
@@ -467,7 +467,7 @@
   uint8_t              asf_header[8192];
   int                  asf_header_len;
   int                  len, i, packet_length;
-  char                *path;
+  char                *path, *unescpath;
   URL_t *url1 = stream->streaming_ctrl->url;
   int s = stream->fd;
 
@@ -479,9 +479,22 @@
   /* parse url */
   path = strchr(url1->file,'/') + 1;
 
+  /* mmst filename are not url_escaped by MS MediaPlayer and are expected as
+   * "plain text" by the server, so need to decode it here
+   */
+  unescpath=malloc(strlen(path)+1);
+  if (!unescpath) {
+	mp_msg(MSGT_NETWORK,MSGL_FATAL,"Memory allocation failed!\n");
+	return -1; 
+  }
+  url_unescape_string(unescpath,path);
+  path=unescpath;
+  
+
   url1->port=1755;
   s = connect2Server( url1->hostname, url1->port, 1);
   if( s<0 ) {
+	  free(path);
 	  return s;
   }
   printf ("connected\n");
@@ -531,6 +544,7 @@
   string_utf16 (&data[8], path, strlen(path));
   memset (data, 0, 8);
   send_command (s, 5, 0, 0, strlen(path)*2+10, data);
+  free(path);
 
   get_answer (s);
 




More information about the MPlayer-cvslog mailing list