mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-22 11:14:13 +00:00
add adjustable buffering to mod_shout (see example in config file)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5303 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
5ce66989b6
commit
1b5daa6b59
2 files changed
+17
No files matched your search
@@ -1357,6 +1357,7 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
switch_file_handle_t fh = { 0 };
|
||||
JSFunction *function;
|
||||
switch_input_args_t args = { 0 };
|
||||
char *prebuf;
|
||||
|
||||
if (!jss || !jss->session) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
|
||||
@@ -1404,6 +1405,14 @@ static JSBool session_streamfile(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
JS_ValueToInt32(cx, argv[3], &samps);
|
||||
fh.samples = samps;
|
||||
}
|
||||
|
||||
if ((prebuf = switch_channel_get_variable(channel, "stream_prebuffer"))) {
|
||||
int maybe = atoi(prebuf);
|
||||
if (maybe > 0) {
|
||||
fh.prebuf = maybe;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cb_state.extra = &fh;
|
||||
cb_state.ret = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
|
||||
Reference in new issue
Block a user