[xiph-commits] r10196 - trunk/xiph-rtp

lu_zero at svn.xiph.org lu_zero at svn.xiph.org
Wed Oct 19 15:54:21 PDT 2005


Author: lu_zero
Date: 2005-10-19 15:54:19 -0700 (Wed, 19 Oct 2005)
New Revision: 10196

Modified:
   trunk/xiph-rtp/vorbisrtp2.c
Log:
Hopefully a more correct timestamp handling.



Modified: trunk/xiph-rtp/vorbisrtp2.c
===================================================================
--- trunk/xiph-rtp/vorbisrtp2.c	2005-10-19 22:52:18 UTC (rev 10195)
+++ trunk/xiph-rtp/vorbisrtp2.c	2005-10-19 22:54:19 UTC (rev 10196)
@@ -424,7 +424,7 @@
             else
                 progressmarker (5);
 
-            usleep (sleeptime/2);
+            usleep (sleeptime);
 
             RTPHeaders.sequence++;
             RTPHeaders.timestamp += sleeptime;
@@ -549,7 +549,7 @@
     char *ip = "227.0.0.1";
     unsigned int port = 4044;
     unsigned int ttl  = 1;
-    long timestamp = 0;
+    long timestamp = 0, prev = 0;
 
     fprintf (stderr, "||---------------------------------------------------------------------------||\n");
     fprintf (stderr, "||  Vorbis RTP Server (draft-ietf-avt-vorbis-rtp-01)\n");	  
@@ -766,9 +766,8 @@
 #endif
 			creatertp ( op.packet, op.bytes, 
 					timestamp, &VorbisBitfields, 0);
-			//FIXME: double check
-			timestamp = vorbis_packet_blocksize(&vi,&op)*1000000L/vi.rate;
-
+			timestamp = (vorbis_packet_blocksize(&vi,&op)+prev)/4*1000000L/vi.rate;
+			prev = vorbis_packet_blocksize(&vi,&op);
             	    }
                 }
 



More information about the commits mailing list