5 #include <speex/speex_jitter.h>
10 unsigned char data[4];
13 void synthIn(JitterBufferPacket *in, int idx, int span) {
19 in->timestamp = idx * 10;
25 void jitterFill(JitterBuffer *jb) {
27 JitterBufferPacket in, out;
32 jitter_buffer_reset(jb);
36 jitter_buffer_put(jb, &in);
39 if (jitter_buffer_get(jb, &out, 10, NULL) != JITTER_BUFFER_OK) {
40 printf("Fill test failed iteration %d\n", i);
42 if (out.timestamp != i * 10) {
43 printf("Fill test expected %d got %d\n", i*10, out.timestamp);
45 jitter_buffer_tick(jb);
52 JitterBufferPacket in, out;
55 JitterBuffer *jb = jitter_buffer_init(10);
59 /* Frozen sender case */
63 jitter_buffer_get(jb, &out, 10, NULL);
64 jitter_buffer_tick(jb);
67 jitter_buffer_put(jb, &in);
69 if (jitter_buffer_get(jb, &out, 10, NULL) != JITTER_BUFFER_OK) {
70 printf("Failed frozen sender resynchronize\n");
72 printf("Frozen sender: Jitter %d\n", out.timestamp - 100*10);