FSCORE-373
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13508 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
6eb2b39f4d
commit
72c680f005
|
@ -234,6 +234,7 @@ static JSBool teletone_generate(JSContext * cx, JSObject * obj, uintN argc, jsva
|
|||
session = tto->session;
|
||||
write_frame.codec = &tto->codec;
|
||||
write_frame.data = fdata;
|
||||
write_frame.buflen = sizeof(fdata);
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
|
|
|
@ -731,6 +731,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
|
|||
memset(&ts, 0, sizeof(ts));
|
||||
write_frame.codec = &write_codec;
|
||||
write_frame.data = data;
|
||||
write_frame.buflen = sizeof(data);
|
||||
|
||||
switch_buffer_create_dynamic(&audio_buffer, 512, 1024, 0);
|
||||
teletone_init_session(&ts, 0, teletone_handler, audio_buffer);
|
||||
|
|
|
@ -82,12 +82,19 @@ SWITCH_DECLARE(switch_status_t) switch_frame_dup(switch_frame_t *orig, switch_fr
|
|||
{
|
||||
switch_frame_t *new_frame;
|
||||
|
||||
if (!orig) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
switch_assert(orig->buflen);
|
||||
|
||||
new_frame = malloc(sizeof(*new_frame));
|
||||
|
||||
switch_assert(new_frame);
|
||||
|
||||
*new_frame = *orig;
|
||||
switch_set_flag(new_frame, SFF_DYNAMIC);
|
||||
|
||||
new_frame->data = malloc(new_frame->buflen);
|
||||
switch_assert(new_frame->data);
|
||||
|
||||
|
@ -104,8 +111,8 @@ SWITCH_DECLARE(switch_status_t) switch_frame_free(switch_frame_t **frame)
|
|||
if (!frame || !*frame || !switch_test_flag((*frame), SFF_DYNAMIC)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
free((*frame)->data);
|
||||
|
||||
switch_safe_free((*frame)->data);
|
||||
free(*frame);
|
||||
*frame = NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue