[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.22,1.23

Bertrand Baudet bertrand at mplayer.dev.hu
Thu Jan 10 02:38:05 CET 2002


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

Modified Files:
	network.c 
Log Message:
Applied RTP patch from Brian Kuschak <bkuschak at yahoo.com> 


Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- network.c	8 Jan 2002 07:31:29 -0000	1.22
+++ network.c	10 Jan 2002 01:37:53 -0000	1.23
@@ -472,13 +472,13 @@
 	stream->streaming_ctrl->buffering = 1;
 //	stream->streaming_ctrl->buffering = 0;
 	stream->streaming_ctrl->status = streaming_playing_e;
-	return fd;
+	return 0;
 }
 
 // Start listening on a UDP port. If multicast, join the group.
 int
 rtp_open_socket( URL_t *url ) {
-	int socket_server_fd;
+	int socket_server_fd, rxsockbufsz;
 	int err, err_len;
 	fd_set set;
 	struct sockaddr_in server_address;
@@ -513,6 +513,13 @@
 			return -1;
 		}
 	}
+
+	// Increase the socket rx buffer size to maximum -- this is UDP
+	rxsockbufsz = 240 * 1024;
+	if( setsockopt( socket_server_fd, SOL_SOCKET, SO_RCVBUF, &rxsockbufsz, sizeof(rxsockbufsz))) {
+		perror("Couldn't set receive socket buffer size");
+	}
+
 	if((ntohl(server_address.sin_addr.s_addr) >> 28) == 0xe) {
 		mcast.imr_multiaddr.s_addr = server_address.sin_addr.s_addr;
 		//mcast.imr_interface.s_addr = inet_addr("10.1.1.2");
@@ -558,17 +565,18 @@
 	if( fd<0 ) {
 		fd = rtp_open_socket( (streaming_ctrl->url) ); 
 		if( fd<0 ) return -1;
+		stream->fd = fd;
 	}
 
 	streaming_ctrl->streaming_read = rtp_streaming_read;
+	streaming_ctrl->streaming_seek = nop_streaming_seek;
 	streaming_ctrl->prebuffer_size = 180000;
 	streaming_ctrl->buffering = 0; //1;
 	streaming_ctrl->status = streaming_playing_e;
-	return fd;
+	return 0;
 }
 
 int
-//streaming_start(stream_t *stream, URL_t *url, int demuxer_type) {
 streaming_start(stream_t *stream, int demuxer_type) {
 	int ret=-1;
 	if( stream==NULL ) return -1;
@@ -580,7 +588,7 @@
 				printf("streaming_start : Closing socket %d failed %s\n",stream->fd,strerror(errno));
 		}
 		stream->fd = -1;
-		stream->fd = rtp_streaming_start( stream );
+		ret = rtp_streaming_start( stream );
 	} else
 	// For connection-oriented streams, we can usually determine the streaming type.
 	switch( demuxer_type ) {




More information about the MPlayer-cvslog mailing list