[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.31,1.32

Arpi of Ize arpi at mplayer.dev.hu
Wed Feb 6 21:30:36 CET 2002


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

Modified Files:
	network.c 
Log Message:
ehh. i forgot to commit this patch: fix RTP streaming. patch by Dave Chapman <dave at dchapman.com>

Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- network.c	22 Jan 2002 06:12:18 -0000	1.31
+++ network.c	6 Feb 2002 20:30:34 -0000	1.32
@@ -97,12 +97,12 @@
 	char *data;
 	int len;
 	static int got_first = 0;
-	static int sequence;
+	static unsigned short sequence;
 
 	if( buffer==NULL || length<0 ) return -1;
 
 	getrtp2(fd, &rh, &data, &len);
-	if( got_first && rh.b.sequence != sequence+1 )
+	if( got_first && rh.b.sequence != (unsigned short)(sequence+1) )
 		printf("RTP packet sequence error!  Expected: %d, received: %d\n", 
 			sequence+1, rh.b.sequence);
 	got_first = 1;
@@ -366,7 +366,7 @@
 				printf("You must enter a port number for RTP streams!\n");
 				return -1;
 			}
-			return -1; 
+			return 0;
 		}
 
 		// Checking for ASF
@@ -562,6 +562,7 @@
 	fd_set set;
 	struct sockaddr_in server_address;
 	struct ip_mreq mcast;
+        struct timeval tv;
 
 	printf("Listening for traffic on %s:%d ...\n", url->hostname, url->port );
 
@@ -609,12 +610,12 @@
 		}
 	}
 
-	//tv.tv_sec = 0;
-	//tv.tv_usec = (10 * 1000000);	// 10 seconds timeout
+	tv.tv_sec = 0;
+	tv.tv_usec = (1 * 1000000);	// 1 second timeout
 	FD_ZERO( &set );
 	FD_SET( socket_server_fd, &set );
-	//if( select(socket_server_fd+1, &set, NULL, NULL, &tv)>0 ) {
-	if( select(socket_server_fd+1, &set, NULL, NULL, NULL)>0 ) {
+	if( select(socket_server_fd+1, &set, NULL, NULL, &tv)>0 ) {
+        //if( select(socket_server_fd+1, &set, NULL, NULL, NULL)>0 ) {
 		err_len = sizeof( err );
 		getsockopt( socket_server_fd, SOL_SOCKET, SO_ERROR, &err, &err_len );
 		if( err ) {




More information about the MPlayer-cvslog mailing list