Index: pjproject/trunk/pjmedia/include/pjmedia/jbuf.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/jbuf.h	(revision 1760)
+++ pjproject/trunk/pjmedia/include/pjmedia/jbuf.h	(revision 1761)
@@ -236,4 +236,20 @@
 				      char *p_frm_type);
 
+/**
+ * Get a frame from the jitter buffer. The jitter buffer will return the
+ * oldest frame from it's buffer, when it is available.
+ *
+ * @param jb		The jitter buffer.
+ * @param frame		Buffer to receive the payload from the jitter buffer.
+ *			@see pjmedia_jbuf_get_frame().    
+ * @param size		Pointer to receive frame size.
+ * @param p_frm_type	Pointer to receive frame type.
+ *			@see pjmedia_jbuf_get_frame().    
+ */
+PJ_DECL(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, 
+				      void *frame, 
+				      pj_size_t *size, 
+				      char *p_frm_type);
+
 
 /**
Index: pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 1760)
+++ pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 1761)
@@ -35,4 +35,5 @@
     char	*flist_buffer;
     int		*flist_frame_type;
+    pj_size_t	*flist_content_len;
     unsigned	 flist_frame_size;
     unsigned	 flist_max_count;
@@ -110,4 +111,8 @@
 				framelist->flist_max_count);
 
+    framelist->flist_content_len = (pj_size_t*)
+	pj_pool_zalloc(pool, sizeof(framelist->flist_content_len[0]) * 
+				framelist->flist_max_count);
+
     framelist->flist_empty = 1;
 
@@ -135,5 +140,5 @@
 
 static pj_bool_t jb_framelist_get(jb_framelist_t *framelist,
-				  void *frame,
+				  void *frame, pj_size_t *size,
 				  pjmedia_jb_frame_type *p_type) 
 {
@@ -145,4 +150,5 @@
 	*p_type = (pjmedia_jb_frame_type) 
 		  framelist->flist_frame_type[framelist->flist_head];
+	*size   = framelist->flist_content_len[framelist->flist_head];
 
 	pj_bzero(framelist->flist_buffer + 
@@ -151,4 +157,5 @@
 	framelist->flist_frame_type[framelist->flist_head] = 
 	    PJMEDIA_JB_MISSING_FRAME;
+	framelist->flist_content_len[framelist->flist_head] = 0;
 
 	framelist->flist_origin++;
@@ -195,4 +202,6 @@
 		  PJMEDIA_JB_MISSING_FRAME,
 		  step1*sizeof(framelist->flist_frame_type[0]));
+	pj_bzero(framelist->flist_content_len+framelist->flist_head,
+		  step1*sizeof(framelist->flist_content_len[0]));
 
 	if (step2) {
@@ -202,4 +211,6 @@
 		      PJMEDIA_JB_MISSING_FRAME,
 		      step2*sizeof(framelist->flist_frame_type[0]));
+	    pj_bzero (framelist->flist_content_len,
+		      step2*sizeof(framelist->flist_content_len[0]));
 	}
 
@@ -258,4 +269,5 @@
 
     framelist->flist_frame_type[where] = PJMEDIA_JB_NORMAL_FRAME;
+    framelist->flist_content_len[where] = frame_size;
 
     return PJ_TRUE;
@@ -511,4 +523,17 @@
 				     char *p_frame_type)
 {
+    pj_size_t size;
+
+    pjmedia_jbuf_get_frame2(jb, frame, &size, p_frame_type);
+}
+
+/*
+ * Get frame from jitter buffer.
+ */
+PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, 
+				     void *frame, 
+				     pj_size_t *size,
+				     char *p_frame_type)
+{
     pjmedia_jb_frame_type ftype;
 
@@ -531,12 +556,15 @@
 	    *p_frame_type = PJMEDIA_JB_ZERO_PREFETCH_FRAME;
 
+	*size = 0;
+
 	return;
     }
 
     /* Retrieve a frame from frame list */
-    if (jb_framelist_get(&jb->jb_framelist,frame,&ftype) == PJ_FALSE) {
+    if (jb_framelist_get(&jb->jb_framelist,frame,size,&ftype) == PJ_FALSE) {
 	/* Can't return frame because jitter buffer is empty! */
 	pj_bzero(frame, jb->jb_frame_size);
 	*p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
+	*size = 0;
 
 	return;
Index: pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 1760)
+++ pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 1761)
@@ -193,7 +193,9 @@
     {
 	char frame_type;
+	pj_size_t frame_size;
 
 	/* Get frame from jitter buffer. */
-	pjmedia_jbuf_get_frame(stream->jb, channel->out_pkt, &frame_type);
+	pjmedia_jbuf_get_frame2(stream->jb, channel->out_pkt, &frame_size,
+			        &frame_type);
 	
 	if (frame_type == PJMEDIA_JB_MISSING_FRAME) {
@@ -326,5 +328,5 @@
 	    /* Decode */
 	    frame_in.buf = channel->out_pkt;
-	    frame_in.size = stream->frame_size;
+	    frame_in.size = frame_size;
 	    frame_in.type = PJMEDIA_FRAME_TYPE_AUDIO;  /* ignored */
 
