Permalink
Browse files

fixed out queue allocation & made out_cork default value dependant on…

… out_queue
  • Loading branch information...
1 parent 7c99cfb commit 2fdec454604b76b40d322b83106ec1a35b98dfce @arut arut committed Jun 14, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −1 ngx_rtmp_core_module.c
  2. +3 −2 ngx_rtmp_init.c
View
3 ngx_rtmp_core_module.c
@@ -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);
View
5 ngx_rtmp_init.c
@@ -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;

0 comments on commit 2fdec45

Please sign in to comment.