forked from Mirrors/freeswitch
FS-2839
This commit is contained in:
parent
3be3cd762a
commit
cd95138427
@ -78,18 +78,18 @@ extern size_t next_power_of_2(size_t v);
|
||||
|
||||
#define CALC_BUFF_LEN(fl, bl) (((fl) >= (bl))? next_power_of_2((fl) << 1): next_power_of_2((bl) << 1))
|
||||
|
||||
#define INIT_CIRC_BUFFER(bf, bl, fl) \
|
||||
#define INIT_CIRC_BUFFER(bf, bl, fl, s) \
|
||||
{ \
|
||||
(bf)->buf_len = CALC_BUFF_LEN((fl), (bl)); \
|
||||
(bf)->mask = (bf)->buf_len - 1; \
|
||||
(bf)->buf = (BUFF_TYPE *)calloc((bf)->buf_len, sizeof(BUFF_TYPE)); \
|
||||
(bf)->buf = (BUFF_TYPE *) switch_core_session_alloc(s, (bf)->buf_len * sizeof(BUFF_TYPE)); \
|
||||
assert((bf)->buf != NULL); \
|
||||
(bf)->pos = 0; \
|
||||
(bf)->lpos = 0; \
|
||||
(bf)->backlog = 0; \
|
||||
}
|
||||
|
||||
#define DESTROY_CIRC_BUFFER(b) free((b)->buf)
|
||||
//#define DESTROY_CIRC_BUFFER(b) free((b)->buf)
|
||||
#define GET_BACKLOG_POS(b) ((b)->lpos - (b)->backlog)
|
||||
#define GET_CURRENT_POS(b) ((b)->lpos)
|
||||
#define GET_CURRENT_SAMPLE(b) GET_SAMPLE((b), GET_CURRENT_POS((b)))
|
||||
|
@ -130,7 +130,7 @@ static void init_avmd_session_data(avmd_session_t *avmd_session, switch_core_se
|
||||
{
|
||||
/*! This is a worst case sample rate estimate */
|
||||
avmd_session->rate = 48000;
|
||||
INIT_CIRC_BUFFER(&avmd_session->b, BEEP_LEN(avmd_session->rate), FRAME_LEN(avmd_session->rate));
|
||||
INIT_CIRC_BUFFER(&avmd_session->b, BEEP_LEN(avmd_session->rate), FRAME_LEN(avmd_session->rate), fs_session);
|
||||
|
||||
avmd_session->session = fs_session;
|
||||
avmd_session->pos = 0;
|
||||
@ -176,6 +176,7 @@ static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, sw
|
||||
case SWITCH_ABC_TYPE_READ_PING:
|
||||
break;
|
||||
case SWITCH_ABC_TYPE_CLOSE:
|
||||
|
||||
break;
|
||||
case SWITCH_ABC_TYPE_READ:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user