diff --git a/ngx_rtmp_live_module.c b/ngx_rtmp_live_module.c
index 66c99e4..ca339ef 100644
--- a/ngx_rtmp_live_module.c
+++ b/ngx_rtmp_live_module.c
@@ -16,7 +16,9 @@ static ngx_rtmp_close_stream_pt next_close_stream;
static ngx_int_t ngx_rtmp_live_postconfiguration(ngx_conf_t *cf);
static void * ngx_rtmp_live_create_app_conf(ngx_conf_t *cf);
static char * ngx_rtmp_live_merge_app_conf(ngx_conf_t *cf,
- void *parent, void *child);
+ void *parent, void *child);
+static char *ngx_rtmp_live_sync(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
#define NGX_RTMP_LIVE_TIME_ABSOLUTE 0x01
@@ -55,7 +57,7 @@ static ngx_command_t ngx_rtmp_live_commands[] = {
{ ngx_string("sync"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
+ ngx_rtmp_live_sync,
NGX_RTMP_APP_CONF_OFFSET,
offsetof(ngx_rtmp_live_app_conf_t, sync),
NULL },
@@ -154,7 +156,7 @@ ngx_rtmp_live_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_value(conf->meta, prev->meta, 1);
ngx_conf_merge_value(conf->nbuckets, prev->nbuckets, 1024);
ngx_conf_merge_msec_value(conf->buflen, prev->buflen, 0);
- ngx_conf_merge_msec_value(conf->sync, prev->sync, 0);
+ ngx_conf_merge_msec_value(conf->sync, prev->sync, 300);
ngx_conf_merge_value(conf->interleave, prev->interleave, 0);
ngx_conf_merge_value(conf->wait_key, prev->wait_key, 0);
ngx_conf_merge_value(conf->publish_notify, prev->publish_notify, 0);
@@ -172,6 +174,25 @@ ngx_rtmp_live_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
}
+static char *
+ngx_rtmp_live_sync(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_rtmp_live_app_conf_t *lacf = conf;
+ ngx_str_t *value;
+
+ value = cf->args->elts;
+
+ if (value->len == sizeof("off") - 1 &&
+ ngx_strncasecmp(value->data, (u_char *) "off", value->len))
+ {
+ lacf->sync = 0;
+ return NGX_CONF_OK;
+ }
+
+ return ngx_conf_set_msec_slot(cf, cmd, conf);
+}
+
+
static ngx_rtmp_live_stream_t **
ngx_rtmp_live_get_stream(ngx_rtmp_session_t *s, u_char *name, int create)
{
diff --git a/ngx_rtmp_stat_module.c b/ngx_rtmp_stat_module.c
index 0c633e5..eb8ec5c 100644
--- a/ngx_rtmp_stat_module.c
+++ b/ngx_rtmp_stat_module.c
@@ -258,7 +258,6 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
ngx_rtmp_session_t *s;
ngx_int_t n;
size_t nclients, total_nclients;
- ngx_int_t publishing;
u_char buf[NGX_OFF_T_LEN + 1];
ngx_rtmp_stat_loc_conf_t *slcf;
u_char *cname;
@@ -270,7 +269,6 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll,
total_nclients = 0;
for (n = 0; n < lacf->nbuckets; ++n) {
for (stream = lacf->streams[n]; stream; stream = stream->next) {
- publishing = 0;
NGX_RTMP_STAT_L("