mirror of
https://github.com/mpv-player/mpv
synced 2025-01-24 08:33:34 +00:00
Recognize ra and rm extensions even with query strings,
eg: rstp://www.addr.com/file.rm?var=123 Based on an idea by Felix Buenemann git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10172 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8b1d077bf4
commit
ceda9eac3d
@ -528,7 +528,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;
|
||||
unsigned int i, j;
|
||||
int fd=-1;
|
||||
int redirect;
|
||||
int auth_retry=0;
|
||||
@ -586,17 +586,28 @@ extension=NULL;
|
||||
// Checking for Real rtsp://
|
||||
// Extension based detection, should be replaced with something based on server answer
|
||||
extension = NULL;
|
||||
if( url->file!=NULL )
|
||||
for( i=strlen(url->file) ; i>0 ; i-- )
|
||||
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=(url->file)+i+1;
|
||||
extension = calloc(j-i, 1);
|
||||
for ( i++; i < j; i++)
|
||||
extension[strlen(extension)]=url->file[i];
|
||||
extension[strlen(extension)]=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user