Changeset 2747 for pjproject/trunk/pjmedia/src/pjmedia/conference.c
- Timestamp:
- Jun 4, 2009 6:48:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r2728 r2747 237 237 unsigned samples_per_frame; /**< Samples per frame. */ 238 238 unsigned bits_per_sample; /**< Bits per sample. */ 239 pj_int16_t *master_port_buf; 239 240 }; 240 241 … … 458 459 459 460 460 status = create_ pasv_port(conf, pool, &name, NULL, &conf_port);461 status = create_conf_port(conf, pool, &name, NULL, &conf_port); 461 462 if (status != PJ_SUCCESS) 462 463 return status; … … 557 558 conf->master_port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 558 559 PJ_ASSERT_RETURN(conf->master_port, PJ_ENOMEM); 560 561 conf->master_port_buf = (pj_int16_t*) 562 pj_pool_zalloc(pool, conf->samples_per_frame<<1); 563 PJ_ASSERT_RETURN(conf->master_port_buf, PJ_ENOMEM); 559 564 560 565 pjmedia_port_info_init(&conf->master_port->info, &name, SIGNATURE, … … 1052 1057 1053 1058 /* if source port is passive port and has no listener, reset delaybuf */ 1054 if (src_port->delay_buf && src_port->listener_cnt == 0) 1055 pjmedia_delay_buf_reset(src_port->delay_buf); 1059 if (src_port->listener_cnt == 0) { 1060 if (src_port->delay_buf) 1061 pjmedia_delay_buf_reset(src_port->delay_buf); 1062 if (src_port->port == NULL) 1063 pjmedia_zero_samples(conf->master_port_buf, 1064 conf->samples_per_frame); 1065 } 1056 1066 } 1057 1067 … … 1842 1852 1843 1853 /* Get frame from this port. 1854 * For port 0 (master port), get the frame from master_port_buf. 1844 1855 * For passive ports, get the frame from the delay_buf. 1845 1856 * For other ports, get the frame from the port. 1846 1857 */ 1847 if (conf_port->delay_buf != NULL) { 1858 if (conf_port->port == NULL) { 1859 1860 pjmedia_copy_samples((pj_int16_t*)frame->buf, conf->master_port_buf, 1861 conf->samples_per_frame); 1862 1863 } else if (conf_port->delay_buf != NULL) { 1864 1848 1865 pj_status_t status; 1849 1866 … … 2055 2072 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 2056 2073 struct conf_port *port = conf->ports[this_port->port_data.ldata]; 2057 pj_status_t status;2058 2074 2059 2075 /* Check for correct size. */ … … 2062 2078 PJMEDIA_ENCSAMPLESPFRAME); 2063 2079 2064 /* Check existance of delay_buf instance */2065 PJ_ASSERT_RETURN( port->delay_buf, PJ_EBUG );2066 2067 2080 /* Skip if this port is muted/disabled. */ 2068 2081 if (port->rx_setting != PJMEDIA_PORT_ENABLE) { … … 2075 2088 } 2076 2089 2077 status = pjmedia_delay_buf_put(port->delay_buf, (pj_int16_t*)frame->buf); 2078 2079 return status; 2090 pjmedia_copy_samples(conf->master_port_buf, (pj_int16_t*)frame->buf, 2091 conf->samples_per_frame); 2092 2093 return PJ_SUCCESS; 2080 2094 } 2081 2095
Note: See TracChangeset
for help on using the changeset viewer.