- Timestamp:
- Feb 27, 2013 9:50:59 AM (12 years ago)
- Location:
- pjproject/branches/1.x
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x
- Property svn:mergeinfo changed
/pjproject/trunk merged: 4161-4162
- Property svn:mergeinfo changed
-
pjproject/branches/1.x/pjmedia/src/pjmedia/conference.c
r3553 r4378 1801 1801 struct conf_port *conf_port = conf->ports[i]; 1802 1802 1803 /* Skip empty slot. */1803 /* Skip empty port. */ 1804 1804 if (!conf_port) 1805 1805 continue; 1806 1806 1807 /* Var "ci" is to count how many ports have been visited so far. */ 1807 1808 ++ci; 1808 1809 1809 /* Reset buffer & auto adjustment level for mixed signal */ 1810 /* Reset buffer (only necessary if more than one transmitter) and 1811 * reset auto adjustment level for mixed signal. 1812 */ 1810 1813 conf_port->mix_adj = NORMAL_LEVEL; 1811 if (conf_port->transmitter_cnt ) {1814 if (conf_port->transmitter_cnt > 1) { 1812 1815 pj_bzero(conf_port->mix_buf, 1813 1816 conf->samples_per_frame*sizeof(conf_port->mix_buf[0])); … … 1818 1821 * to mix_buf of all listeners of the port. 1819 1822 */ 1820 for (i=0, ci=0; i <conf->max_ports && ci<conf->port_cnt; ++i) {1823 for (i=0, ci=0; i < conf->max_ports && ci < conf->port_cnt; ++i) { 1821 1824 struct conf_port *conf_port = conf->ports[i]; 1822 1825 pj_int32_t level = 0; … … 1946 1949 mix_buf = listener->mix_buf; 1947 1950 1948 /* Mixing signals, 1949 * and calculate appropriate level adjustment if there is 1950 * any overflowed level in the mixed signal. 1951 */ 1952 for (k=0; k<conf->samples_per_frame; ++k) { 1953 mix_buf[k] += p_in[k]; 1954 /* Check if normalization adjustment needed. */ 1955 if (IS_OVERFLOW(mix_buf[k])) { 1956 /* NORMAL_LEVEL * MAX_LEVEL / mix_buf[k]; */ 1957 int tmp_adj = (MAX_LEVEL<<7) / mix_buf[k]; 1958 if (tmp_adj<0) tmp_adj = -tmp_adj; 1959 1960 if (tmp_adj<listener->mix_adj) 1961 listener->mix_adj = tmp_adj; 1962 1963 } /* if any overflow in the mixed signals */ 1964 } /* loop mixing signals */ 1951 if (listener->transmitter_cnt > 1) { 1952 /* Mixing signals, 1953 * and calculate appropriate level adjustment if there is 1954 * any overflowed level in the mixed signal. 1955 */ 1956 for (k=0; k < conf->samples_per_frame; ++k) { 1957 mix_buf[k] += p_in[k]; 1958 /* Check if normalization adjustment needed. */ 1959 if (IS_OVERFLOW(mix_buf[k])) { 1960 /* NORMAL_LEVEL * MAX_LEVEL / mix_buf[k]; */ 1961 int tmp_adj = (MAX_LEVEL<<7) / mix_buf[k]; 1962 if (tmp_adj<0) tmp_adj = -tmp_adj; 1963 1964 if (tmp_adj<listener->mix_adj) 1965 listener->mix_adj = tmp_adj; 1966 1967 } /* if any overflow in the mixed signals */ 1968 } /* loop mixing signals */ 1969 } else { 1970 /* Only 1 transmitter: 1971 * just copy the samples to the mix buffer 1972 * no mixing and level adjustment needed 1973 */ 1974 for (k=0; k<conf->samples_per_frame; ++k) { 1975 mix_buf[k] = p_in[k]; 1976 } 1977 } 1965 1978 } /* loop the listeners of conf port */ 1966 1979 } /* loop of all conf ports */
Note: See TracChangeset
for help on using the changeset viewer.