tweak js
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2194 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8246f730fc
commit
db10a61d5c
|
@ -1705,12 +1705,15 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
}
|
||||
|
||||
} else {
|
||||
if (switch_core_session_read_frame(session, &read_frame, -1, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_status_t status;
|
||||
status = switch_core_session_read_frame(session, &read_frame, -1, 0);
|
||||
|
||||
if (!SWITCH_READ_ACCEPTABLE(status)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
|
||||
if (loops > 0) {
|
||||
if (loops) {
|
||||
switch_buffer_t *tmp;
|
||||
|
||||
/* Switcharoo*/
|
||||
|
@ -1719,11 +1722,12 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||
tto->loop_buffer = tmp;
|
||||
loops--;
|
||||
/* try again */
|
||||
if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
|
||||
if ((write_frame.datalen =
|
||||
(uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue