mirror of
https://github.com/mpv-player/mpv
synced 2025-01-16 22:37:28 +01:00
Added a data field in the streaming_ctrl_t struct, to store any
kind of data that the protocol need to keep track of. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3454 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c86363fd08
commit
dbfbbbae3d
@ -152,6 +152,7 @@ http_send_request( URL_t *url ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( url->port==0 ) url->port = 80;
|
||||
fd = connect2Server( url->hostname, url->port );
|
||||
if( fd<0 ) {
|
||||
return -1;
|
||||
@ -228,7 +229,7 @@ extension=NULL;
|
||||
// Look for the extension in the extensions table
|
||||
for( i=0 ; i<(sizeof(extensions_table)/sizeof(extensions_table[0])) ; i++ ) {
|
||||
if( !strcasecmp(extension, extensions_table[i].extension) ) {
|
||||
if( url->port==0 ) url->port = 80;
|
||||
//if( url->port==0 ) url->port = 80;
|
||||
return extensions_table[i].demuxer_type;
|
||||
}
|
||||
}
|
||||
@ -241,8 +242,8 @@ extension=NULL;
|
||||
}
|
||||
|
||||
// Checking for ASF
|
||||
if( !strcasecmp(url->protocol, "mms") ) {
|
||||
if( url->port==0 ) url->port = 80;
|
||||
if( !strncasecmp(url->protocol, "mms", 3) ) {
|
||||
//if( url->port==0 ) url->port = 80;
|
||||
return DEMUXER_TYPE_ASF;
|
||||
}
|
||||
|
||||
@ -309,6 +310,9 @@ extension=NULL;
|
||||
http_free( http_hdr );
|
||||
return DEMUXER_TYPE_UNKNOWN;
|
||||
}
|
||||
} else {
|
||||
printf("Unknown protocol '%s'\n", url->protocol );
|
||||
return DEMUXER_TYPE_UNKNOWN;
|
||||
}
|
||||
} while( redirect );
|
||||
|
||||
|
@ -34,6 +34,7 @@ typedef struct streaming_control {
|
||||
unsigned int buffer_pos;
|
||||
int (*streaming_read)( int fd, char *buffer, int buffer_size, struct streaming_control *stream_ctrl );
|
||||
int (*streaming_seek)( int fd, off_t pos, struct streaming_control *stream_ctrl );
|
||||
void *data;
|
||||
} streaming_ctrl_t;
|
||||
|
||||
int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
|
||||
|
Loading…
Reference in New Issue
Block a user