RTMP with multiple worker processes and rtmp_auto_push

胡聪 (hucc) hucong.c at foxmail.com
Mon Aug 5 11:46:02 UTC 2019


On Friday, July 26, 2019 11:08, Carey Gister wrote:

>Hi,
>
>I hope someone can help illuminate some background information related to this
>module. I understand that the rtmp_auto_push directive worked with multiple
>workers through nginx 1.7.x and then something changed in the nginx internals
>and it stopped working and was no longer supported for multiple workers.
>
>Can someone provide background on what changed that had this feature stop
>working? My manager has tasked me with getting this feature to work, if possible.
>
>Thanks,
>
>Carey Gister
>415-310-5304

The following patch may solve your problem.

diff --git a/ngx_rtmp_auto_push_module.c b/ngx_rtmp_auto_push_module.c
index 60c85d7..436b176 100644
--- a/ngx_rtmp_auto_push_module.c
+++ b/ngx_rtmp_auto_push_module.c
@@ -140,6 +140,8 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
         return NGX_OK;
     }

+    ngx_rtmp_auto_push_module.ctx_index = 0;
+
     apcf = (ngx_rtmp_auto_push_conf_t *) ngx_get_conf(cycle->conf_ctx,
                                                     ngx_rtmp_auto_push_module);
     if (apcf->auto_push == 0) {


More information about the nginx-devel mailing list