Skip to content

Commit

Permalink
[fix] fixed bug that info of destroyed streams still appeared in stat.
Browse files Browse the repository at this point in the history
  • Loading branch information
winshining committed Dec 31, 2021
1 parent 10ebedb commit ddc0df9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ngx_http_flv_live_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,
ngx_rtmp_live_ctx_t *ctx, **cctx, *unlink;
ngx_http_request_t *r;
ngx_rtmp_live_app_conf_t *lacf;
ngx_rtmp_live_stream_t **stream;
ngx_flag_t passive;

lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
Expand Down Expand Up @@ -1269,6 +1270,18 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,

*cctx = ctx->next;

if (ctx->stream->pub_ctx == NULL &&
ctx->stream->ctx == NULL)
{
stream = ngx_rtmp_live_get_stream(s, ctx->stream->name, 0);
if (stream) {
*stream = (*stream)->next;

ctx->stream->next = lacf->free_streams;
lacf->free_streams = ctx->stream;
}
}

ctx->next = NULL;
ctx->stream = NULL;

Expand Down

0 comments on commit ddc0df9

Please sign in to comment.