summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-11-23 13:31:44 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-11-23 13:31:44 +0000
commit8e0dd8484f88ff34477168edd7c5bef883944ea2 (patch)
tree4c15dc1dc93b868205fe3542528f165588f95eee /libmpdemux
parent0b29dddcd66456a48f47c939c1b877d82408fc4b (diff)
downloadmpv-8e0dd8484f88ff34477168edd7c5bef883944ea2.tar.bz2
mpv-8e0dd8484f88ff34477168edd7c5bef883944ea2.tar.xz
Add detection of Real rtsp when there are queries in url.
Patch by rgselk <rgselknospam(at)yahoo(dot)com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11506 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/network.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/libmpdemux/network.c b/libmpdemux/network.c
index d858c3bd0f..c074628745 100644
--- a/libmpdemux/network.c
+++ b/libmpdemux/network.c
@@ -571,7 +571,7 @@ http_authenticate(HTTP_header_t *http_hdr, URL_t *url, int *auth_retry) {
int
autodetectProtocol(streaming_ctrl_t *streaming_ctrl, int *fd_out, int *file_format) {
HTTP_header_t *http_hdr;
- unsigned int i, j;
+ unsigned int i;
int fd=-1;
int redirect;
int auth_retry=0;
@@ -628,29 +628,15 @@ extension=NULL;
if( !strcasecmp(url->protocol, "rtsp") ) {
// Checking for Real rtsp://
// Extension based detection, should be replaced with something based on server answer
- extension = NULL;
- if( url->file!=NULL ) {
- j = strlen(url->file);
- for( i=j; i>0 ; i-- ) {
- if( url->file[i]=='?' )
- j = i;
- if( url->file[i]=='.' ) {
- extension = calloc(j-i, 1);
- for ( i++; i < j; i++)
- extension[strlen(extension)]=url->file[i];
- extension[strlen(extension)]=0;
- break;
+ if( url->file!= NULL ) {
+ char *p;
+ for( p = url->file; p[0]; p++ ) {
+ if( p[0] == '.' && tolower(p[1]) == 'r' && (tolower(p[2]) == 'm' || tolower(p[2]) == 'a') && (!p[3] || p[3] == '?' || p[3] == '&') ) {
+ *file_format = DEMUXER_TYPE_REAL;
+ return 0;
}
}
}
- if (extension != NULL && (!strcasecmp(extension, "rm")
- || !strcasecmp(extension, "ra"))) {
- *file_format = DEMUXER_TYPE_REAL;
- free(extension);
- return 0;
- }
- if (extension != NULL)
- free(extension);
mp_msg(MSGT_NETWORK,MSGL_INFO,"Not a Realmedia rtsp url. Trying standard rtsp protocol.\n");
#ifdef STREAMING_LIVE_DOT_COM
*file_format = DEMUXER_TYPE_RTP;