changeset 4553:bab3aac84143

ehh. i forgot to commit this patch: fix RTP streaming. patch by Dave Chapman <dave@dchapman.com>
author arpi
date Wed, 06 Feb 2002 20:30:34 +0000
parents 46ccfbb41f9c
children 16fdb694cf13
files libmpdemux/network.c
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/network.c	Wed Feb 06 20:26:19 2002 +0000
+++ b/libmpdemux/network.c	Wed Feb 06 20:30:34 2002 +0000
@@ -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 ) {