diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-03-05 17:41:42 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-03-05 17:41:42 +0000 |
commit | 9d25d342f4102e6591ec1ffa003dd65572bbc927 (patch) | |
tree | b8e15080c2c72c58dbb2a01776e638e80ddb52f8 /pjmedia | |
parent | 9fd0e939e50e39d7f98d0dfb73091851ba571781 (diff) |
More ticket #438: wrong param passed to shrink_buffer() in set_max_cnt(), should be (buf_cnt - new_max_cnt), instead of (old_max_cnt - new_max_cnt)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1847 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/src/pjmedia/delaybuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia/delaybuf.c b/pjmedia/src/pjmedia/delaybuf.c index 09903511..2c6aa37b 100644 --- a/pjmedia/src/pjmedia/delaybuf.c +++ b/pjmedia/src/pjmedia/delaybuf.c @@ -280,7 +280,9 @@ static void set_max_cnt(pjmedia_delay_buf *b, unsigned new_max_cnt) return; } - shrink_buffer(b, old_max_cnt - new_max_cnt); + /* If samples number in the buffer > new_max_cnt, reduce samples first */ + if (b->buf_cnt > new_max_cnt) + shrink_buffer(b, b->buf_cnt - new_max_cnt); /* Adjust buffer to accomodate the new max_cnt so the samples is secured. * This is done by make get_pos = 0 |