diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-03-04 16:13:01 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-03-04 16:13:01 +0000 |
commit | 6f9ff9fd66675c7a2582cfd772c2d04eb0b25153 (patch) | |
tree | 2c572f57b7e013d6d6116cfb632a7333bf4208b0 /pjmedia/src | |
parent | 23b72a335dc2dfbec1145ffa6b886c5af925e588 (diff) |
More ticket #497: bug on pjmedia_wsola_save() when extra samples exceed samples_per_frame
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1845 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src')
-rw-r--r-- | pjmedia/src/pjmedia/wsola.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia/wsola.c b/pjmedia/src/pjmedia/wsola.c index 2be14ea7..0740c16f 100644 --- a/pjmedia/src/pjmedia/wsola.c +++ b/pjmedia/src/pjmedia/wsola.c @@ -36,7 +36,7 @@ #define TEMPLATE_PTIME (5) /* Generate extra samples, in msec */ -#define GEN_EXTRA_PTIME (5) +#define GEN_EXTRA_PTIME (1) /* Number of frames in erase buffer */ #define ERASE_CNT ((unsigned)3) @@ -513,6 +513,9 @@ PJ_DEF(pj_status_t) pjmedia_wsola_save( pjmedia_wsola *wsola, if (prev_lost && extra >= wsola->min_extra) { short *dst = wsola->buf + wsola->hist_cnt + wsola->samples_per_frame; + if (extra > wsola->samples_per_frame) + extra = wsola->samples_per_frame; + /* Smoothen the transition. This will also erase the excess * samples */ |