[xiph-commits] r12659 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Tue Mar 6 04:01:32 PST 2007


Author: jm
Date: 2007-03-06 04:01:30 -0800 (Tue, 06 Mar 2007)
New Revision: 12659

Modified:
   trunk/speex/libspeex/jitter.c
Log:
Patch by Peter Kirk (pwk) to use LE32 properly.


Modified: trunk/speex/libspeex/jitter.c
===================================================================
--- trunk/speex/libspeex/jitter.c	2007-03-05 22:44:20 UTC (rev 12658)
+++ trunk/speex/libspeex/jitter.c	2007-03-06 12:01:30 UTC (rev 12659)
@@ -144,6 +144,7 @@
    /* Cleanup buffer (remove old packets that weren't played) */
    for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
    {
+      /* Make sure we don't discard a "just-late" packet in case we want to play it next (if we interpolate). */
       if (jitter->buf[i] && LE32(jitter->timestamp[i] + jitter->span[i], jitter->pointer_timestamp))
       {
          /*fprintf (stderr, "cleaned (not played)\n");*/
@@ -338,7 +339,7 @@
    {
       for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
       {
-         if (jitter->buf[i] && jitter->timestamp[i]<=jitter->pointer_timestamp && GE32(jitter->timestamp[i]+jitter->span[i],jitter->pointer_timestamp+chunk_size))
+         if (jitter->buf[i] && LE32(jitter->timestamp[i], jitter->pointer_timestamp) && GE32(jitter->timestamp[i]+jitter->span[i],jitter->pointer_timestamp+chunk_size))
             break;
       }
    }
@@ -348,7 +349,7 @@
    {
       for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
       {
-         if (jitter->buf[i] && jitter->timestamp[i]<=jitter->pointer_timestamp && GT32(jitter->timestamp[i]+jitter->span[i],jitter->pointer_timestamp))
+         if (jitter->buf[i] && LE32(jitter->timestamp[i], jitter->pointer_timestamp) && GT32(jitter->timestamp[i]+jitter->span[i],jitter->pointer_timestamp))
             break;
       }
    }
@@ -437,6 +438,12 @@
    jitter->current_timestamp += jitter->tick_size;
 }
 
+/* Let the jitter buffer know it's the right time to adjust the buffering delay to the network conditions */
+int jitter_buffer_update_delay(JitterBuffer *jitter)
+{
+   
+}
+
 /* Used like the ioctl function to control the jitter buffer parameters */
 int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr)
 {



More information about the commits mailing list