From 6f9ff9fd66675c7a2582cfd772c2d04eb0b25153 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 4 Mar 2008 16:13:01 +0000 Subject: 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 --- pjmedia/src/pjmedia/wsola.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- cgit v1.2.3