Index: /pjproject/trunk/pjmedia/include/pjmedia/conference.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 321)
+++ /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 322)
@@ -76,4 +76,9 @@
  *			    is also used to set the sampling rate of the
  *			    sound device.
+ * @param channel_count	    Number of channels in the PCM stream. Normally
+ *			    the value will be 1 for mono, but application may
+ *			    specify a value of 2 for stereo. Note that all
+ *			    ports that will be connected to the bridge MUST 
+ *			    have the same number of channels as the bridge.
  * @param samples_per_frame Set the number of samples per frame. This value
  *			    is also used to set the sound device.
@@ -91,4 +96,5 @@
 					  unsigned max_slots,
 					  unsigned sampling_rate,
+					  unsigned channel_count,
 					  unsigned samples_per_frame,
 					  unsigned bits_per_sample,
Index: /pjproject/trunk/pjmedia/include/pjmedia/null_port.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/null_port.h	(revision 321)
+++ /pjproject/trunk/pjmedia/include/pjmedia/null_port.h	(revision 322)
@@ -34,4 +34,5 @@
  *
  * @param sampling_rate		Sampling rate of the port.
+ * @param channel_count		Number of channels.
  * @param samples_per_frame	Number of samples per frame.
  * @param bits_per_sample	Number of bits per sample.
@@ -42,4 +43,5 @@
 PJ_DECL(pj_status_t) pjmedia_null_port_create( pj_pool_t *pool,
 					       unsigned sampling_rate,
+					       unsigned channel_count,
 					       unsigned samples_per_frame,
 					       unsigned bits_per_sample,
Index: /pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 321)
+++ /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 322)
@@ -137,5 +137,6 @@
     struct conf_port	**ports;	/**< Array of ports.		    */
     pj_uint16_t		 *uns_buf;	/**< Buf for unsigned conversion    */
-    unsigned		  clock_rate;	/**< Sampling rate.	    */
+    unsigned		  clock_rate;	/**< Sampling rate.		    */
+    unsigned		  channel_count;/**< Number of channels (1=mono).   */
     unsigned		  samples_per_frame;	/**< Samples per frame.	    */
     unsigned		  bits_per_sample;	/**< Bits per sample.	    */
@@ -323,4 +324,5 @@
 					 unsigned max_ports,
 					 unsigned clock_rate,
+					 unsigned channel_count,
 					 unsigned samples_per_frame,
 					 unsigned bits_per_sample,
@@ -493,4 +495,12 @@
 
     PJ_ASSERT_RETURN(conf && pool && strm_port && port_name, PJ_EINVAL);
+
+    /* For this version of PJMEDIA, port MUST have the same number of
+     * PCM channels.
+     */
+    if (strm_port->info.channel_count != conf->channel_count) {
+	pj_assert(!"Number of channels mismatch");
+	return PJMEDIA_ENCCHANNEL;
+    }
 
     pj_mutex_lock(conf->mutex);
Index: /pjproject/trunk/pjmedia/src/pjmedia/file_port.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/file_port.c	(revision 321)
+++ /pjproject/trunk/pjmedia/src/pjmedia/file_port.c	(revision 322)
@@ -201,5 +201,4 @@
 
     if (wave_hdr.fmt_hdr.fmt_tag != 1 ||
-	wave_hdr.fmt_hdr.nchan != 1 ||
 	wave_hdr.fmt_hdr.bits_per_sample != 16 ||
 	wave_hdr.fmt_hdr.block_align != 2)
@@ -225,4 +224,5 @@
 
     /* Update port info. */
+    fport->base.info.channel_count = wave_hdr.fmt_hdr.nchan;
     fport->base.info.sample_rate = wave_hdr.fmt_hdr.sample_rate;
     fport->base.info.bits_per_sample = wave_hdr.fmt_hdr.bits_per_sample;
Index: /pjproject/trunk/pjmedia/src/pjmedia/null_port.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 321)
+++ /pjproject/trunk/pjmedia/src/pjmedia/null_port.c	(revision 322)
@@ -33,4 +33,5 @@
 PJ_DEF(pj_status_t) pjmedia_null_port_create( pj_pool_t *pool,
 					      unsigned sampling_rate,
+					      unsigned channel_count,
 					      unsigned samples_per_frame,
 					      unsigned bits_per_sample,
@@ -53,4 +54,5 @@
     port->info.sample_rate = sampling_rate;
     port->info.samples_per_frame = samples_per_frame;
+    port->info.channel_count = channel_count;
     port->info.signature = 0x2411;
     port->info.type = PJMEDIA_TYPE_AUDIO;
Index: /pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 321)
+++ /pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 322)
@@ -660,4 +660,5 @@
     stream->port.info.pt = info->fmt.pt;
     pj_strdup(pool, &stream->port.info.encoding_name, &info->fmt.encoding_name);
+    stream->port.info.channel_count = 1;
     stream->port.info.sample_rate = info->fmt.sample_rate;
     stream->port.user_data = stream;
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 321)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 322)
@@ -761,4 +761,5 @@
 				 pjsua.max_calls+PJSUA_CONF_MORE_PORTS, 
 				 pjsua.clock_rate, 
+				 1, /* mono */
 				 pjsua.clock_rate * 20 / 1000, 16, 
 				 options,
@@ -774,4 +775,5 @@
     /* Add NULL port to the bridge. */
     status = pjmedia_null_port_create( pjsua.pool, pjsua.clock_rate, 
+				       1, /* mono */
 				       pjsua.clock_rate * 20 / 1000, 16,
 				       &pjsua.null_port);
