Index: /pjproject/trunk/pjmedia/include/pjmedia/types.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/types.h	(revision 505)
+++ /pjproject/trunk/pjmedia/include/pjmedia/types.h	(revision 506)
@@ -116,6 +116,7 @@
 /**
  * This is a general purpose function set PCM samples to zero.
- * Since this function is needed by many parts of the library, it is important
- * that the library should select the best performance for this.
+ * Since this function is needed by many parts of the library, 
+ * by putting this functionality in one place, it enables some.
+ * clever people to optimize this function.
  *
  * @param samples	The 16bit PCM samples.
@@ -130,4 +131,19 @@
 
 
+/**
+ * This is a general purpose function to copy samples from/to buffers with
+ * equal size. Since this function is needed by many parts of the library, 
+ * by putting this functionality in one place, it enables some.
+ * clever people to optimize this function.
+ */
+PJ_INLINE(void) pjmedia_copy_samples(pj_int16_t *dst, const pj_int16_t *src,
+				     unsigned count)
+{
+    unsigned i;
+    for (i=0; i<count; ++i)
+	dst[i] = src[i];
+}
+
+
 #endif	/* __PJMEDIA_TYPES_H__ */
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 505)
+++ /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 506)
@@ -333,5 +333,5 @@
 {
     struct conf_port *conf_port;
-    pj_str_t name = { "sound-device", 12 };
+    pj_str_t name = { "Master/sound", 12 };
     unsigned i;
     pj_status_t status;
@@ -994,22 +994,4 @@
 }
 
-/* Copy samples */
-PJ_INLINE(void) copy_samples(pj_int16_t *dst, 
-				const pj_int16_t *src,
-				unsigned count)
-{
-    unsigned i;
-    for (i=0; i<count; ++i)
-	dst[i] = src[i];
-}
-
-/* Zero samples. */
-PJ_INLINE(void) zero_samples(pj_int16_t *buf, unsigned count)
-{
-    unsigned i;
-    for (i=0; i<count; ++i)
-	buf[i] = 0;
-}
-
 
 /*
@@ -1074,6 +1056,6 @@
 	    if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) {
 		TRACE_((THIS_FILE, "  get_frame returned non-audio"));
-		zero_samples( cport->rx_buf + cport->rx_buf_count,
-			      cport->samples_per_frame);
+		pjmedia_zero_samples( cport->rx_buf + cport->rx_buf_count,
+				      cport->samples_per_frame);
 	    }
 
@@ -1103,6 +1085,6 @@
 	    cport->rx_buf_count -= src_count;
 	    if (cport->rx_buf_count) {
-		copy_samples(cport->rx_buf, cport->rx_buf+src_count,
-			     cport->rx_buf_count);
+		pjmedia_copy_samples(cport->rx_buf, cport->rx_buf+src_count,
+				     cport->rx_buf_count);
 	    }
 
@@ -1112,9 +1094,9 @@
 	} else {
 
-	    copy_samples(frame, cport->rx_buf, count);
+	    pjmedia_copy_samples(frame, cport->rx_buf, count);
 	    cport->rx_buf_count -= count;
 	    if (cport->rx_buf_count) {
-		copy_samples(cport->rx_buf, cport->rx_buf+count,
-			     cport->rx_buf_count);
+		pjmedia_copy_samples(cport->rx_buf, cport->rx_buf+count,
+				     cport->rx_buf_count);
 	    }
 	}
@@ -1202,5 +1184,5 @@
     } else {
 	// Not necessarry. Buffer has been zeroed before.
-	// zero_samples(buf, conf->samples_per_frame);
+	// pjmedia_zero_samples(buf, conf->samples_per_frame);
 	pj_assert(buf[0] == 0);
     }
@@ -1267,6 +1249,6 @@
 	 * Just copy the samples to tx_buffer.
 	 */
-	copy_samples( cport->tx_buf + cport->tx_buf_count,
-		      buf, conf->samples_per_frame );
+	pjmedia_copy_samples( cport->tx_buf + cport->tx_buf_count,
+			      buf, conf->samples_per_frame );
 	cport->tx_buf_count += conf->samples_per_frame;
     }
@@ -1301,7 +1283,7 @@
 	cport->tx_buf_count -= cport->samples_per_frame;
 	if (cport->tx_buf_count) {
-	    copy_samples(cport->tx_buf, 
-			 cport->tx_buf + cport->samples_per_frame,
-			 cport->tx_buf_count);
+	    pjmedia_copy_samples(cport->tx_buf, 
+				 cport->tx_buf + cport->samples_per_frame,
+				 cport->tx_buf_count);
 	}
 
@@ -1346,5 +1328,5 @@
 	mix_buf = conf_port->mix_buf;
 
-	for (j=0; j<conf->samples_per_frame; ++j) mix_buf[j] = 0;
+	pj_memset(mix_buf, 0, conf->samples_per_frame*sizeof(mix_buf[0]));
     }
 
@@ -1395,7 +1377,5 @@
 
 	    snd_buf = conf_port->snd_buf[conf_port->snd_read_pos];
-	    for (j=0; j<conf->samples_per_frame; ++j) {
-		((pj_int16_t*)frame->buf)[j] = snd_buf[j];
-	    }
+	    pjmedia_copy_samples(frame->buf, snd_buf, conf->samples_per_frame);
 	    conf_port->snd_read_pos = (conf_port->snd_read_pos+1) % RX_BUF_COUNT;
 
@@ -1535,8 +1515,8 @@
 			   conf->samples_per_frame));
 
-	copy_samples( frame->buf, (pj_int16_t*)conf->ports[0]->mix_buf, 
-		      conf->samples_per_frame);
+	pjmedia_copy_samples( frame->buf, (pj_int16_t*)conf->ports[0]->mix_buf, 
+			      conf->samples_per_frame);
     } else {
-	zero_samples( frame->buf, conf->samples_per_frame ); 
+	pjmedia_zero_samples( frame->buf, conf->samples_per_frame ); 
     }
 
@@ -1567,5 +1547,4 @@
     const pj_int16_t *input = frame->buf;
     pj_int16_t *target_snd_buf;
-    unsigned i;
 
     /* Check for correct size. */
@@ -1589,7 +1568,5 @@
     
     /* Copy samples from audio device to target rx_buffer */
-    for (i=0; i<conf->samples_per_frame; ++i) {
-	target_snd_buf[i] = ((pj_int16_t*)input)[i];
-    }
+    pjmedia_copy_samples(target_snd_buf, input, conf->samples_per_frame);
 
     /* Switch buffer */
Index: /pjproject/trunk/pjmedia/src/pjmedia/null_port.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 505)
+++ /pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 506)
@@ -88,11 +88,8 @@
 				  pjmedia_frame *frame)
 {
-    unsigned i, count;
-    pj_int16_t *samples = frame->buf;
-
-    count = this_port->info.samples_per_frame;
-    for (i=0; i<count; ++i) {
-	samples[i] = 0;
-    }
+    frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
+    frame->size = this_port->info.samples_per_frame * 2;
+    frame->timestamp.u32.lo += this_port->info.samples_per_frame;
+    pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame);
 
     return PJ_SUCCESS;
