mirror of
https://github.com/mpv-player/mpv
synced 2025-02-10 17:07:23 +00:00
Try Real rtsp, then live.com on every rtsp stream (remove extension
based selection) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12207 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
952bdd4ca1
commit
d7f873f469
@ -685,25 +685,10 @@ extension=NULL;
|
||||
|
||||
// Checking for RTSP
|
||||
if( !strcasecmp(url->protocol, "rtsp") ) {
|
||||
// Checking for Real rtsp://
|
||||
// Extension based detection, should be replaced with something based on server answer
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
// Try Real rtsp:// first (it's always built in)
|
||||
// If it fails, try live.com (if compiled in)
|
||||
*file_format = DEMUXER_TYPE_REAL;
|
||||
return 0;
|
||||
#else
|
||||
mp_msg(MSGT_NETWORK,MSGL_ERR,"RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n");
|
||||
return -1;
|
||||
#endif
|
||||
// Checking for SIP
|
||||
} else if( !strcasecmp(url->protocol, "sip") ) {
|
||||
#ifdef STREAMING_LIVE_DOT_COM
|
||||
@ -1217,10 +1202,20 @@ streaming_start(stream_t *stream, int *demuxer_type, URL_t *url) {
|
||||
if( (!strcasecmp( stream->streaming_ctrl->url->protocol, "rtsp")) &&
|
||||
(*demuxer_type == DEMUXER_TYPE_REAL)) {
|
||||
stream->fd = -1;
|
||||
ret = realrtsp_streaming_start( stream );
|
||||
if ((ret = realrtsp_streaming_start( stream )) < 0) {
|
||||
mp_msg(MSGT_NETWORK,MSGL_INFO,"Not a Realmedia rtsp url. Trying standard rtsp protocol.\n");
|
||||
#ifdef STREAMING_LIVE_DOT_COM
|
||||
*demuxer_type = DEMUXER_TYPE_RTP;
|
||||
goto try_livedotcom;
|
||||
#else
|
||||
mp_msg(MSGT_NETWORK,MSGL_ERR,"RTSP support requires the \"LIVE.COM Streaming Media\" libraries!\n");
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
} else
|
||||
|
||||
// For connection-oriented streams, we can usually determine the streaming type.
|
||||
try_livedotcom:
|
||||
switch( *demuxer_type ) {
|
||||
case DEMUXER_TYPE_ASF:
|
||||
// Send the appropriate HTTP request
|
||||
|
@ -137,7 +137,7 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, i
|
||||
|
||||
} else
|
||||
{
|
||||
printf("rtsp_session: rtsp server type is '%s' instead of Real. Please report.\n",server);
|
||||
printf("rtsp_session: Not a Real server. Server type is '%s'.\n",server);
|
||||
rtsp_close(rtsp_session->s);
|
||||
free(server);
|
||||
free(rtsp_session);
|
||||
|
Loading…
Reference in New Issue
Block a user