diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-01-14 18:35:51 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-01-14 18:35:51 +0000 |
commit | ceb6d9319ccb5da56bdc1cd74fd4896806ca34f6 (patch) | |
tree | a9dc1e9f7045ff8ae589aec4a0cc76aa6ea89a63 /pjmedia | |
parent | 80e822f3787fe4f8eaef10496244db263c786e35 (diff) |
Related to ticket #449: fixed bug when rx volume adjustment caused static noise (thanks Norman Franke)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1692 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/src/pjmedia/conference.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia/conference.c b/pjmedia/src/pjmedia/conference.c index cfc4c912..a0a0d16f 100644 --- a/pjmedia/src/pjmedia/conference.c +++ b/pjmedia/src/pjmedia/conference.c @@ -1412,7 +1412,10 @@ static pj_status_t write_port(pjmedia_conf *conf, struct conf_port *cport, SIMPLE_AGC(cport->last_mix_adj, cport->mix_adj); cport->last_mix_adj = cport->mix_adj; - adj_level = cport->tx_adj_level * cport->mix_adj / NORMAL_LEVEL; + /* adj_level = cport->tx_adj_level * cport->mix_adj / NORMAL_LEVEL;*/ + adj_level = cport->tx_adj_level * cport->mix_adj; + adj_level >>= 7; + tx_level = 0; for (j=0; j<conf->samples_per_frame; ++j) { @@ -1676,7 +1679,11 @@ static pj_status_t get_frame(pjmedia_port *this_port, itemp = p_in[j]; /*itemp = itemp * adj / NORMAL_LEVEL;*/ - itemp = (itemp * conf_port->rx_adj_level) >> 7; + /* bad code (signed/unsigned badness): + * itemp = (itemp * conf_port->rx_adj_level) >> 7; + */ + itemp *= conf_port->rx_adj_level; + itemp >>= 7; /* Clip the signal if it's too loud */ if (itemp > MAX_LEVEL) itemp = MAX_LEVEL; |