summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-03-05 17:41:42 +0000
committerBenny Prijono <bennylp@teluu.com>2008-03-05 17:41:42 +0000
commit9d25d342f4102e6591ec1ffa003dd65572bbc927 (patch)
treeb8e15080c2c72c58dbb2a01776e638e80ddb52f8 /pjmedia
parent9fd0e939e50e39d7f98d0dfb73091851ba571781 (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.c4
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