Index: pjproject/trunk/pjmedia/include/pjmedia/port.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/port.h	(revision 3291)
+++ pjproject/trunk/pjmedia/include/pjmedia/port.h	(revision 3292)
@@ -219,5 +219,5 @@
     unsigned	    bits_per_sample;	/**< Bits/sample		    */
     unsigned	    samples_per_frame;	/**< No of samples per frame.	    */
-    unsigned	    bytes_per_frame;	/**< No of samples per frame.	    */
+    unsigned	    bytes_per_frame;	/**< No of bytes per frame.	    */
 } pjmedia_port_info;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 3291)
+++ pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 3292)
@@ -2031,21 +2031,26 @@
 					  stream->codec_param.setting.frm_per_pkt /
 					  1000;
-    stream->port.info.bytes_per_frame = stream->codec_param.info.max_bps * 
-					stream->codec_param.info.frm_ptime *
-					stream->codec_param.setting.frm_per_pkt /
-					8 / 1000;
-    if ((stream->codec_param.info.max_bps * stream->codec_param.info.frm_ptime *
-	stream->codec_param.setting.frm_per_pkt) % 8000 != 0)
-    {
-	++stream->port.info.bytes_per_frame;
-    }
-
     stream->port.info.format.id = stream->codec_param.info.fmt_id;
     if (stream->codec_param.info.fmt_id == PJMEDIA_FORMAT_L16) {
+	/* Raw format */
+	stream->port.info.bytes_per_frame = stream->port.info.samples_per_frame *
+					    stream->port.info.bits_per_sample / 8;
+
 	stream->port.put_frame = &put_frame;
 	stream->port.get_frame = &get_frame;
     } else {
+	/* Encoded format */
+	stream->port.info.bytes_per_frame = stream->codec_param.info.max_bps * 
+					    stream->codec_param.info.frm_ptime *
+					    stream->codec_param.setting.frm_per_pkt /
+					    8 / 1000;
+	if ((stream->codec_param.info.max_bps * stream->codec_param.info.frm_ptime *
+	    stream->codec_param.setting.frm_per_pkt) % 8000 != 0)
+	{
+	    ++stream->port.info.bytes_per_frame;
+	}
 	stream->port.info.format.bitrate = stream->codec_param.info.avg_bps;
 	stream->port.info.format.vad = (stream->codec_param.setting.vad != 0);
+
 	stream->port.put_frame = &put_frame;
 	stream->port.get_frame = &get_frame_ext;
Index: pjproject/trunk/pjsip-apps/src/samples/streamutil.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/streamutil.c	(revision 3291)
+++ pjproject/trunk/pjsip-apps/src/samples/streamutil.c	(revision 3292)
@@ -90,5 +90,6 @@
 
 /* Prototype */
-static void print_stream_stat(pjmedia_stream *stream);
+static void print_stream_stat(pjmedia_stream *stream, 
+			      const pjmedia_codec_param *codec_param);
 
 /* Prototype for LIBSRTP utility in file datatypes.c */
@@ -274,4 +275,5 @@
     /* Default values */
     const pjmedia_codec_info *codec_info;
+    pjmedia_codec_param codec_param;
     pjmedia_dir dir = PJMEDIA_DIR_DECODING;
     pj_sockaddr_in remote_addr;
@@ -488,4 +490,11 @@
 	goto on_exit;
 
+    /* Get codec default param for info */
+    status = pjmedia_codec_mgr_get_default_param(
+				    pjmedia_endpt_get_codec_mgr(med_endpt), 
+				    codec_info, 
+				    &codec_param);
+    /* Should be ok, as create_stream() above succeeded */
+    pj_assert(status == PJ_SUCCESS);
 
     /* Get the port interface of the stream */
@@ -623,5 +632,5 @@
 
 	if (tmp[0] == 's')
-	    print_stream_stat(stream);
+	    print_stream_stat(stream, &codec_param);
 	else if (tmp[0] == 'q')
 	    break;
@@ -724,5 +733,6 @@
  * Print stream statistics
  */
-static void print_stream_stat(pjmedia_stream *stream)
+static void print_stream_stat(pjmedia_stream *stream,
+			      const pjmedia_codec_param *codec_param)
 {
     char duration[80], last_update[80];
@@ -753,8 +763,9 @@
 	port->info.clock_rate,
 	port->info.samples_per_frame * 1000 / port->info.clock_rate,
-	good_number(bps, port->info.bytes_per_frame * port->info.clock_rate /
-		    port->info.samples_per_frame),
-	good_number(ipbps, (port->info.bytes_per_frame+32) * 
-			    port->info.clock_rate / port->info.clock_rate));
+	good_number(bps, (codec_param->info.avg_bps+7)/8),
+	good_number(ipbps, ((codec_param->info.avg_bps+7)/8) + 
+			   (40 * 1000 /
+			    codec_param->setting.frm_per_pkt /
+			    codec_param->info.frm_ptime)));
 
     if (stat.rx.update_cnt == 0)
