Skip to content

Commit

Permalink
fixed out queue allocation & made out_cork default value dependant on…
Browse files Browse the repository at this point in the history
… out_queue
  • Loading branch information
arut committed Jun 14, 2012
1 parent 7c99cfb commit 2fdec45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ngx_rtmp_core_module.c
Expand Up @@ -254,7 +254,8 @@ ngx_rtmp_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_size_value(conf->max_message, prev->max_message,
1 * 1024 * 1024);
ngx_conf_merge_size_value(conf->out_queue, prev->out_queue, 256);
ngx_conf_merge_size_value(conf->out_cork, prev->out_cork, 32);
ngx_conf_merge_size_value(conf->out_cork, prev->out_cork,
conf->out_queue / 8);
ngx_conf_merge_value(conf->play_time_fix, prev->play_time_fix, 1);
ngx_conf_merge_value(conf->publish_time_fix, prev->publish_time_fix, 1);

Expand Down
5 changes: 3 additions & 2 deletions ngx_rtmp_init.c
Expand Up @@ -124,8 +124,9 @@ ngx_rtmp_init_session(ngx_connection_t *c, ngx_rtmp_addr_conf_t *addr_conf)
ngx_rtmp_log_ctx_t *ctx;

s = ngx_pcalloc(c->pool, sizeof(ngx_rtmp_session_t) +
((ngx_rtmp_core_srv_conf_t *)addr_conf->ctx->srv_conf)->out_queue
* sizeof(ngx_chain_t *));
sizeof(ngx_chain_t *) * ((ngx_rtmp_core_srv_conf_t *)
addr_conf->ctx-> srv_conf[ngx_rtmp_core_module
.ctx_index])->out_queue);
if (s == NULL) {
ngx_rtmp_close_connection(c);
return NULL;
Expand Down

0 comments on commit 2fdec45

Please sign in to comment.