Skip to content

Commit

Permalink
[fix] access check must come before gop cache play.
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Nov 19, 2024
1 parent 2cae45c commit cdb396a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions config
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
3 changes: 2 additions & 1 deletion ngx_rtmp_live_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cdb396a

Please sign in to comment.