diff options
author | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-02 20:36:50 +0000 |
---|---|---|
committer | rtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-07-02 20:36:50 +0000 |
commit | 21f0a7aeb8a0cc8793058aa7af30991c73f4f3c5 (patch) | |
tree | bdc393fe30407f02b2ac6a60d17359eafbfc732d /libmpdemux | |
parent | 7f03f78675a7215909086a0a1b393df7b58e0919 (diff) | |
download | mpv-21f0a7aeb8a0cc8793058aa7af30991c73f4f3c5.tar.bz2 mpv-21f0a7aeb8a0cc8793058aa7af30991c73f4f3c5.tar.xz |
WMP doesn't encode urls with mmst protocol
Patch by Ilia ( chest4l at mail dot ru )
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12752 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/asf_mmst_streaming.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libmpdemux/asf_mmst_streaming.c b/libmpdemux/asf_mmst_streaming.c index 7059096da0..ab6bc23ae3 100644 --- a/libmpdemux/asf_mmst_streaming.c +++ b/libmpdemux/asf_mmst_streaming.c @@ -467,7 +467,7 @@ int asf_mmst_streaming_start(stream_t *stream) 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 @@ int asf_mmst_streaming_start(stream_t *stream) /* 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 @@ int asf_mmst_streaming_start(stream_t *stream) 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); |