[MPlayer-cvslog] CVS: main/libmpdemux network.c,1.109,1.110

Nico Sabbi CVS syncmail at mplayerhq.hu
Thu Feb 17 21:56:00 CET 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv14334

Modified Files:
	network.c 
Log Message:
added support for raw udp:// streaming

Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- network.c	4 Feb 2005 18:31:04 -0000	1.109
+++ network.c	17 Feb 2005 20:55:57 -0000	1.110
@@ -700,6 +700,11 @@
 #endif
 		}
 
+		if(!strcasecmp(url->protocol, "udp") ) {
+			*file_format = DEMUXER_TYPE_UNKNOWN;
+			return 0;
+		}
+
 	// Old, hacked RTP support, which works for MPEG Streams
 	//   RTP streams only:
 		// Checking for RTP
@@ -1185,7 +1190,7 @@
 }
 
 static int
-rtp_streaming_start( stream_t *stream ) {
+rtp_streaming_start( stream_t *stream, int raw_udp ) {
 	streaming_ctrl_t *streaming_ctrl;
 	int fd;
 
@@ -1199,7 +1204,10 @@
 		stream->fd = fd;
 	}
 
-	streaming_ctrl->streaming_read = rtp_streaming_read;
+	if(raw_udp)
+		streaming_ctrl->streaming_read = nop_streaming_read;
+	else
+		streaming_ctrl->streaming_read = rtp_streaming_read;
 	streaming_ctrl->streaming_seek = nop_streaming_seek;
 	streaming_ctrl->prebuffer_size = 64*1024;	// 64 KBytes	
 	streaming_ctrl->buffering = 0;
@@ -1244,7 +1252,7 @@
 				mp_msg(MSGT_NETWORK,MSGL_ERR,"streaming_start : Closing socket %d failed %s\n",stream->fd,strerror(errno));
 		}
 		stream->fd = -1;
-		ret = rtp_streaming_start( stream );
+		ret = rtp_streaming_start( stream, 0);
 	} else
 
 	if( !strcasecmp( stream->streaming_ctrl->url->protocol, "pnm")) {
@@ -1269,6 +1277,14 @@
 		    return -1;
 #endif
 		}
+	} else if(!strcasecmp( stream->streaming_ctrl->url->protocol, "udp")) {
+		stream->fd = -1;
+		ret = rtp_streaming_start(stream, 1);
+		if(ret<0) {
+			mp_msg(MSGT_NETWORK,MSGL_ERR,"rtp_streaming_start(udp) failed\n");
+			return -1;
+		}
+		*demuxer_type =  DEMUXER_TYPE_UNKNOWN;
 	} else
 
 	// For connection-oriented streams, we can usually determine the streaming type.




More information about the MPlayer-cvslog mailing list