diff options
author | rsf <rsf@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-03 06:16:07 +0000 |
---|---|---|
committer | rsf <rsf@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-03 06:16:07 +0000 |
commit | 59e227a8668c3293b18c87511827864cda13195e (patch) | |
tree | 4001d859c0b759d2bc22c002d013ba300e83d1ae /libmpdemux | |
parent | 72a3c35bb571fd3a2bc99f8d2185427c76a90843 (diff) |
Added some special-case code for checking for "sip:" URLs (because they
don't include a "//" like other URLs).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10057 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/url.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libmpdemux/url.c b/libmpdemux/url.c index d185e5c9e1..d14f9ce056 100644 --- a/libmpdemux/url.c +++ b/libmpdemux/url.c @@ -17,6 +17,7 @@ url_new(const char* url) { int pos1, pos2; URL_t* Curl; char *ptr1=NULL, *ptr2=NULL, *ptr3=NULL; + int jumpSize = 3; if( url==NULL ) return NULL; @@ -40,9 +41,15 @@ url_new(const char* url) { // extract the protocol ptr1 = strstr(url, "://"); if( ptr1==NULL ) { - mp_msg(MSGT_NETWORK,MSGL_V,"Not an URL!\n"); - url_free(Curl); - return NULL; + // Check for a special case: "sip:" (without "//"): + if (strstr(url, "sip:") == url) { + ptr1 = &url[3]; // points to ':' + jumpSize = 1; + } else { + mp_msg(MSGT_NETWORK,MSGL_V,"Not an URL!\n"); + url_free(Curl); + return NULL; + } } pos1 = ptr1-url; Curl->protocol = (char*)malloc(pos1+1); @@ -55,8 +62,8 @@ url_new(const char* url) { Curl->protocol[pos1] = '\0'; // jump the "://" - ptr1 += 3; - pos1 += 3; + ptr1 += jumpSize; + pos1 += jumpSize; // check if a username:password is given ptr2 = strstr(ptr1, "@"); |