From cdb396ae0864e055292ac1b821c5b5c0dd8fe053 Mon Sep 17 00:00:00 2001 From: winshining Date: Wed, 20 Nov 2024 02:09:12 +0800 Subject: [PATCH] [fix] access check must come before gop cache play. --- config | 7 ++++--- ngx_rtmp_live_module.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config b/config index 3999993..753acf3 100644 --- a/config +++ b/config @@ -4,10 +4,10 @@ RTMP_CORE_MODULES=" \ ngx_rtmp_module \ ngx_rtmp_core_module \ ngx_rtmp_cmd_module \ + ngx_rtmp_gop_cache_module \ ngx_rtmp_codec_module \ ngx_rtmp_access_module \ ngx_rtmp_record_module \ - ngx_rtmp_gop_cache_module \ ngx_rtmp_live_module \ ngx_rtmp_flv_live_index_module \ ngx_rtmp_play_module \ @@ -37,6 +37,7 @@ RTMP_DEPS=" \ $ngx_addon_dir/ngx_rtmp_amf.h \ $ngx_addon_dir/ngx_rtmp_bandwidth.h \ $ngx_addon_dir/ngx_rtmp_cmd_module.h \ + $ngx_addon_dir/ngx_rtmp_gop_cache_module.h \ $ngx_addon_dir/ngx_rtmp_codec_module.h \ $ngx_addon_dir/ngx_rtmp_eval.h \ $ngx_addon_dir/ngx_rtmp.h \ @@ -45,12 +46,12 @@ RTMP_DEPS=" \ $ngx_addon_dir/ngx_rtmp_netcall_module.h \ $ngx_addon_dir/ngx_rtmp_play_module.h \ $ngx_addon_dir/ngx_rtmp_record_module.h \ - $ngx_addon_dir/ngx_rtmp_gop_cache_module.h \ $ngx_addon_dir/ngx_rtmp_relay_module.h \ $ngx_addon_dir/ngx_rtmp_streams.h \ $ngx_addon_dir/ngx_rtmp_bitop.h \ $ngx_addon_dir/ngx_rtmp_proxy_protocol.h \ $ngx_addon_dir/ngx_rtmp_variables.h \ + $ngx_addon_dir/hls/ngx_rtmp_hls_module.h \ $ngx_addon_dir/hls/ngx_rtmp_mpegts.h \ $ngx_addon_dir/hls/ngx_rtmp_mpegts_crc.h \ $ngx_addon_dir/dash/ngx_rtmp_mp4.h \ @@ -69,10 +70,10 @@ RTMP_CORE_SRCS=" \ $ngx_addon_dir/ngx_rtmp_receive.c \ $ngx_addon_dir/ngx_rtmp_core_module.c \ $ngx_addon_dir/ngx_rtmp_cmd_module.c \ + $ngx_addon_dir/ngx_rtmp_gop_cache_module.c \ $ngx_addon_dir/ngx_rtmp_codec_module.c \ $ngx_addon_dir/ngx_rtmp_access_module.c \ $ngx_addon_dir/ngx_rtmp_record_module.c \ - $ngx_addon_dir/ngx_rtmp_gop_cache_module.c \ $ngx_addon_dir/ngx_rtmp_live_module.c \ $ngx_addon_dir/ngx_rtmp_flv_live_index_module.c \ $ngx_addon_dir/ngx_rtmp_play_module.c \ diff --git a/ngx_rtmp_live_module.c b/ngx_rtmp_live_module.c index 321ed65..59c056a 100644 --- a/ngx_rtmp_live_module.c +++ b/ngx_rtmp_live_module.c @@ -435,8 +435,9 @@ ngx_rtmp_live_set_status(ngx_rtmp_session_t *s, ngx_chain_t *control, for (pctx = ctx->stream->ctx; pctx; pctx = pctx->next) { if (pctx->publishing == 0) { + pctx->session->publisher = s; + if (pctx->protocol == NGX_RTMP_PROTOCOL_HTTP) { - pctx->session->publisher = s; ngx_http_flv_live_set_status(pctx->session, active); } else { ngx_rtmp_live_set_status(pctx->session, control, status,