[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.13,1.14 network.h,1.6,1.7

Bertrand Baudet bertrand at mplayer.dev.hu
Tue Dec 11 02:06:19 CET 2001


Update of /cvsroot/mplayer/main/libmpdemux
In directory mplayer:/var/tmp.root/cvs-serv11751

Modified Files:
	network.c network.h 
Log Message:
Added a data field in the streaming_ctrl_t struct, to store any
kind of data that the protocol need to keep track of.


Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- network.c	10 Dec 2001 01:34:08 -0000	1.13
+++ network.c	11 Dec 2001 01:06:08 -0000	1.14
@@ -152,6 +152,7 @@
 		return -1;
 	}
 
+	if( url->port==0 ) url->port = 80;
 	fd = connect2Server( url->hostname, url->port );
 	if( fd<0 ) {
 		return -1; 
@@ -228,7 +229,7 @@
 			// 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 @@
 		}
 
 		// 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 @@
 					http_free( http_hdr );
 					return DEMUXER_TYPE_UNKNOWN;
 			}
+		} else {
+			printf("Unknown protocol '%s'\n", url->protocol );
+			return DEMUXER_TYPE_UNKNOWN;
 		}
 	} while( redirect );
 

Index: network.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- network.h	10 Dec 2001 01:39:25 -0000	1.6
+++ network.h	11 Dec 2001 01:06:08 -0000	1.7
@@ -34,6 +34,7 @@
 	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);




More information about the MPlayer-cvslog mailing list