jitter buffer: minor fix with tick()
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 31 Oct 2007 07:01:12 +0000 (07:01 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 31 Oct 2007 07:01:12 +0000 (07:01 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@14073 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/jitter.c

index e614522..c89ec33 100644 (file)
@@ -292,6 +292,9 @@ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
    float early_ratio_long;
    int incomplete = 0;
    
+   if (jitter->current_timestamp + jitter->sub_clock > jitter->pointer_timestamp)
+      speex_warning("something's wrong with the time");
+
    jitter->sub_clock = -1;
    jitter->current_timestamp = jitter->pointer_timestamp;
    
@@ -473,8 +476,7 @@ void jitter_buffer_tick(JitterBuffer *jitter)
 {
    if (jitter->sub_clock == -1)
       jitter->sub_clock = 0;
-   else
-      jitter->sub_clock += jitter->resolution;
+   jitter->sub_clock += jitter->resolution;
 }
 
 /* Let the jitter buffer know it's the right time to adjust the buffering delay to the network conditions */