Index: /pjproject/trunk/pjmedia/build/pjmedia.dsw
===================================================================
--- /pjproject/trunk/pjmedia/build/pjmedia.dsw	(revision 1894)
+++ /pjproject/trunk/pjmedia/build/pjmedia.dsw	(revision 1895)
@@ -4,5 +4,29 @@
 ###############################################################################
 
-Project: "pjaut"=.\pjaut.dsp - Package Owner=<4>
+Project: "libportaudio"="..\..\third_party\build\portaudio\libportaudio.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "libsrtp"="..\..\third_party\build\srtp\libsrtp.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "pjaut"=".\pjaut.dsp" - Package Owner=<4>
 
 Package=<5>
@@ -22,5 +46,5 @@
 ###############################################################################
 
-Project: "pjlib"=..\..\pjlib\build\pjlib.dsp - Package Owner=<4>
+Project: "pjlib"="..\..\pjlib\build\pjlib.dsp" - Package Owner=<4>
 
 Package=<5>
@@ -46,5 +70,5 @@
 ###############################################################################
 
-Project: "pjmedia"=.\pjmedia.dsp - Package Owner=<4>
+Project: "pjmedia"=".\pjmedia.dsp" - Package Owner=<4>
 
 Package=<5>
@@ -61,5 +85,5 @@
 ###############################################################################
 
-Project: "pjmedia_codec"=.\pjmedia_codec.dsp - Package Owner=<4>
+Project: "pjmedia_codec"=".\pjmedia_codec.dsp" - Package Owner=<4>
 
 Package=<5>
@@ -73,5 +97,5 @@
 ###############################################################################
 
-Project: "pjmedia_test"=.\pjmedia_test.dsp - Package Owner=<4>
+Project: "pjmedia_test"=".\pjmedia_test.dsp" - Package Owner=<4>
 
 Package=<5>
@@ -93,4 +117,10 @@
     Project_Dep_Name pjlib_util
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name libportaudio
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name libsrtp
+    End Project Dependency
 }}}
 
Index: /pjproject/trunk/pjmedia/build/pjmedia_test.dsp
===================================================================
--- /pjproject/trunk/pjmedia/build/pjmedia_test.dsp	(revision 1894)
+++ /pjproject/trunk/pjmedia/build/pjmedia_test.dsp	(revision 1895)
@@ -43,5 +43,5 @@
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../pjlib/include" /I "../include" /D "NDEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../pjlib/include" /I "../include" /I "../../pjnath/include" /I "../../pjlib-util/include" /D "NDEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
@@ -67,5 +67,5 @@
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../pjlib/include" /I "../include" /D "_DEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../pjlib/include" /I "../include" /I "../../pjnath/include" /I "../../pjlib-util/include" /D "_DEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
Index: /pjproject/trunk/pjmedia/src/test/jbuf_test.c
===================================================================
--- /pjproject/trunk/pjmedia/src/test/jbuf_test.c	(revision 1894)
+++ /pjproject/trunk/pjmedia/src/test/jbuf_test.c	(revision 1895)
@@ -19,30 +19,32 @@
 #include <stdio.h>
 #include <ctype.h>
-#include <pjmedia/jbuf.h>
 #include <pj/pool.h>
+#include "test.h"
 
-#define JB_MIN	    1
-#define JB_MAX	    8
-#define JB_BUF_SIZE 10
+#define JB_INIT_PREFETCH    0
+#define JB_MIN_PREFETCH	    0
+#define JB_MAX_PREFETCH	    10
+#define JB_PTIME	    20
+#define JB_BUF_SIZE	    20
 
 #define REPORT
 //#define PRINT_COMMENT
 
-int jbuf_main(pj_pool_factory *pf)
+int jbuf_main(void)
 {
-    pj_jitter_buffer jb;
+    pjmedia_jbuf *jb;
     FILE *input = fopen("JBTEST.DAT", "rt");
-    unsigned lastseq;
-    void *data = "Hello world";
-    char line[1024], *p;
-    int lastget = 0, lastput = 0;
+    unsigned seq;
+    char line[1024 * 10], *p;
     pj_pool_t *pool;
+    pjmedia_jb_state state;
+    pj_str_t jb_name = {"JBTEST", 6};
 
     pj_init();
-    pool = pj_pool_create(pf, "JBPOOL", 256*16, 256*16, NULL);
+    pool = pj_pool_create(mem, "JBPOOL", 256*16, 256*16, NULL);
 
-    pj_jb_init(&jb, pool, JB_MIN, JB_MAX, JB_BUF_SIZE);
-
-    lastseq = 1;
+    pjmedia_jbuf_create(pool, &jb_name, 1, JB_PTIME, JB_BUF_SIZE, &jb);
+    pjmedia_jbuf_set_adaptive(jb, JB_INIT_PREFETCH, JB_MIN_PREFETCH, 
+			      JB_MAX_PREFETCH);
 
     while ((p=fgets(line, sizeof(line), input)) != NULL) {
@@ -56,20 +58,22 @@
 	if (*p == '#') {
 #ifdef PRINT_COMMENT
-	    printf("\n%s", p);
+	    printf("%s", p);
 #endif
 	    continue;
 	}
 
-	pj_jb_reset(&jb);
+	pjmedia_jbuf_reset(jb);
+	seq = 1;
+
 #ifdef REPORT
-	printf( "Initial\t%c   size=%d  prefetch=%d level=%d\n", 
-	        ' ', jb.lst.count, jb.prefetch, jb.level);
+	pjmedia_jbuf_get_state(jb, &state);
+	printf("Initial\tsize=%d\tprefetch=%d\tmin.pftch=%d\tmax.pftch=%d\n", 
+	    state.size, state.prefetch, state.min_prefetch, state.max_prefetch);
 #endif
 
 	while (*p) {
 	    int c;
-	    unsigned seq = 0;
-	    void *thedata;
-	    int status = 1234;
+	    char frame[1];
+	    char f_type;
 	    
 	    c = *p++;
@@ -78,54 +82,28 @@
 	    
 	    if (c == '/') {
-		char *end;
+		putchar('\n');
 
-		printf("/*");
-
-		do {
-		    putchar(*++p);
-		} while (*p != '/');
+		while (*++p && *p != '/')
+		    putchar(*p);
 
 		putchar('\n');
 
-		c = *++p;
-		end = p;
+		if (*++p == 0)
+		    break;
 
+		continue;
 	    }
-
-	    if (isspace(c))
-		continue;
-
-	    if (isdigit(c)) {
-		seq = c - '0';
-		while (*p) {
-		    c = *p++;
-		    
-		    if (isspace(c))
-			continue;
-		    
-		    if (!isdigit(c))
-			break;
-		    
-		    seq = seq * 10 + c - '0';
-		}
-	    }
-
-	    if (!*p)
-		break;
 
 	    switch (toupper(c)) {
 	    case 'G':
-		seq = -1;
-		status = pj_jb_get(&jb, &seq, &thedata);
-		lastget = seq;
+		pjmedia_jbuf_get_frame(jb, frame, &f_type);
 		break;
 	    case 'P':
-		if (seq == 0) 
-		    seq = lastseq++;
-		else
-		    lastseq = seq;
-		status = pj_jb_put(&jb, seq, data);
-		if (status == 0)
-		    lastput = seq;
+		pjmedia_jbuf_put_frame(jb, (void*)frame, 1, seq);
+		seq++;
+		break;
+	    case 'L':
+		seq++;
+		printf("Lost\n");
 		break;
 	    default:
@@ -135,15 +113,14 @@
 
 #ifdef REPORT
-	    printf("seq=%d\t%c rc=%d\tsize=%d\tpfch=%d\tlvl=%d\tmxl=%d\tdelay=%d\n", 
-		    seq, toupper(c), status, jb.lst.count, jb.prefetch, jb.level, jb.max_level,
-		    (lastget>0 && lastput>0) ? lastput-lastget : -1);
+	    if (toupper(c) != 'L') {
+		pjmedia_jbuf_get_state(jb, &state);
+		printf("seq=%d\t%c\tsize=%d\tprefetch=%d\n", 
+		       seq, toupper(c), state.size, state.prefetch);
+	    }
 #endif
 	}
     }
 
-#ifdef REPORT
-    printf("0\t%c   size=%d  prefetch=%d level=%d\n", 
-	    ' ', jb.lst.count, jb.prefetch, jb.level);
-#endif
+    pjmedia_jbuf_destroy(jb);
 
     if (input != stdin)
Index: /pjproject/trunk/pjmedia/src/test/test.c
===================================================================
--- /pjproject/trunk/pjmedia/src/test/test.c	(revision 1894)
+++ /pjproject/trunk/pjmedia/src/test/test.c	(revision 1895)
@@ -36,5 +36,5 @@
 void app_perror(pj_status_t status, const char *msg)
 {
-    char errbuf[PJMEDIA_ERR_MSG_SIZE];
+    char errbuf[PJ_ERR_MSG_SIZE];
     
     pjmedia_strerror(status, errbuf, sizeof(errbuf));
@@ -45,5 +45,5 @@
 int test_main(void)
 {
-    int rc;
+    int rc = 0;
     pj_caching_pool caching_pool;
 
@@ -55,13 +55,11 @@
     mem = &caching_pool.factory;
 
-    DO_TEST(sdp_neg_test());
+    //DO_TEST(sdp_neg_test());
     //sdp_test (&caching_pool.factory);
     //rtp_test(&caching_pool.factory);
     //session_test (&caching_pool.factory);
-    //jbuf_main(&caching_pool.factory);
+    jbuf_main();
 
     PJ_LOG(3,(THIS_FILE," "));
-
-on_return:
 
     if (rc != 0) {
