[MPlayer-cvslog] r18808 - trunk/libmpdemux/rtp.c

nicodvb subversion at mplayerhq.hu
Sat Jun 24 11:41:41 CEST 2006


Author: nicodvb
Date: Sat Jun 24 11:41:41 2006
New Revision: 18808

Modified:
   trunk/libmpdemux/rtp.c

Log:
exit() is not allowed in any other function than main(); removed

Modified: trunk/libmpdemux/rtp.c
==============================================================================
--- trunk/libmpdemux/rtp.c	(original)
+++ trunk/libmpdemux/rtp.c	Sat Jun 24 11:41:41 2006
@@ -84,6 +84,8 @@
 	static int is_first = 1;
 	
 	getrtp2(fd, &rh, &data, &length);
+	if(!length)
+		return 0;
 	seq = rh.b.sequence;
 	
 	newseq = seq - rtpbuf.seq[rtpbuf.first];
@@ -350,15 +352,13 @@
   int headerSize;
   int lengthPacket;
   lengthPacket=recv(fd,buf,1590,0);
-  if (lengthPacket==0)
-    exit(1);
-  if (lengthPacket<0) {
+  if (lengthPacket<0)
     mp_msg(MSGT_NETWORK,MSGL_ERR,"rtp: socket read error\n");
-    exit(2);
-  }
-  if (lengthPacket<12) {
+  else if (lengthPacket<12)
     mp_msg(MSGT_NETWORK,MSGL_ERR,"rtp: packet too small (%d) to be an rtp frame (>12bytes)\n", lengthPacket);
-    exit(3);
+  if(lengthPacket<12) {
+    *lengthData = 0;
+    return 0;
   }
   rh->b.v  = (unsigned int) ((buf[0]>>6)&0x03);
   rh->b.p  = (unsigned int) ((buf[0]>>5)&0x01);



More information about the MPlayer-cvslog mailing list