diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-26 11:23:07 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-26 11:23:07 +0000 |
commit | d80219f36636faa876c84b586e7b4b4815767be3 (patch) | |
tree | 56d336b8a7467902fd0fb7cdfebf4b98c81c81e4 /pjmedia/src/pjmedia-codec/gsm.c | |
parent | d07ab9c6afb0fd00a30d503bc87786e895359f9c (diff) |
Fixed rather loud clicking/tick noise when call is established. This was caused by the PLC not properly cleared before it is reused for the next call
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@627 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-codec/gsm.c')
-rw-r--r-- | pjmedia/src/pjmedia-codec/gsm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia-codec/gsm.c b/pjmedia/src/pjmedia-codec/gsm.c index 57eb1900..633ddc1b 100644 --- a/pjmedia/src/pjmedia-codec/gsm.c +++ b/pjmedia/src/pjmedia-codec/gsm.c @@ -343,6 +343,8 @@ static pj_status_t gsm_dealloc_codec( pjmedia_codec_factory *factory, pjmedia_codec *codec ) { struct gsm_data *gsm_data; + pj_int16_t frame[160]; + int i; PJ_ASSERT_RETURN(factory && codec, PJ_EINVAL); PJ_ASSERT_RETURN(factory == &gsm_codec_factory.base, PJ_EINVAL); @@ -352,6 +354,14 @@ static pj_status_t gsm_dealloc_codec( pjmedia_codec_factory *factory, /* Close codec, if it's not closed. */ gsm_codec_close(codec); + /* Clear left samples in the PLC, since codec+plc will be reused + * next time. + */ + for (i=0; i<2; ++i) { + pjmedia_zero_samples(frame, PJ_ARRAY_SIZE(frame)); + pjmedia_plc_save(gsm_data->plc, frame); + } + /* Put in the free list. */ pj_mutex_lock(gsm_codec_factory.mutex); pj_list_push_front(&gsm_codec_factory.codec_list, codec); |