[xiph-commits] r8860 - trunk/xiph-rtp
giles at motherfish-iii.xiph.org
giles at motherfish-iii.xiph.org
Mon Feb 7 11:47:31 PST 2005
Author: giles
Date: 2005-02-07 11:47:30 -0800 (Mon, 07 Feb 2005)
New Revision: 8860
Modified:
trunk/xiph-rtp/vorbisrtp.c
Log:
Minor cleanup. Document the need for a flush function, update referenced spec.
Modified: trunk/xiph-rtp/vorbisrtp.c
===================================================================
--- trunk/xiph-rtp/vorbisrtp.c 2005-02-07 19:46:21 UTC (rev 8859)
+++ trunk/xiph-rtp/vorbisrtp.c 2005-02-07 19:47:30 UTC (rev 8860)
@@ -395,16 +395,18 @@
vorbheader -> reserved = 0;
vorbheader -> pkts = 0;
- packet = malloc (max_payload + 6);
+ framesize = max_payload;
- makevorbisheader (packet, max_payload + 6, vorbheader);
+ packet = malloc (framesize + 6);
+
+ makevorbisheader (packet, framesize + 6, vorbheader);
memcpy (packet + 5, &framesize, 1);
- memmove (packet + 6, vorbdata, max_payload);
+ memcpy (packet + 6, vorbdata + position, framesize);
/* Swap RTP headers from host to network order */
RTPHeaders.sequence = htons (RTPHeaders.sequence);
- sendrtp (&RTPHeaders, rtpsocket, &rtpsock, packet, max_payload + 6);
+ sendrtp (&RTPHeaders, rtpsocket, &rtpsock, packet, framesize + 6);
/* Swap headers back to host order */
RTPHeaders.sequence = ntohs (RTPHeaders.sequence);
@@ -470,8 +472,10 @@
stacksize += (length + 1);
}
- if (length + stacksize > max_payload || stackcount > 15) {
+ /* todo: we also need to be able to flush this at end-of-stream */
+ if (length + stacksize > max_payload || stackcount >= 15) {
+
/* Set Vorbis header flags */
vorbheader -> continuation = 0;
vorbheader -> fragment = 0;
@@ -604,7 +608,7 @@
unsigned int ttl = 1;
fprintf (stderr, "||---------------------------------------------------------------------------||\n");
- fprintf (stderr, "|| Vorbis RTP Server (draft-kerr-avt-vorbis-rtp-04)\n");
+ fprintf (stderr, "|| Vorbis RTP Server (draft-ietf-avt-vorbis-rtp-00)\n");
/*===========================================================================*/
/* Command-line args processing */
More information about the commits
mailing list