Skip to content

Commit ddc0df9

Browse files
committed
[fix] fixed bug that info of destroyed streams still appeared in stat.
1 parent 10ebedb commit ddc0df9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ngx_http_flv_live_module.c

+13
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,7 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,
11991199
ngx_rtmp_live_ctx_t *ctx, **cctx, *unlink;
12001200
ngx_http_request_t *r;
12011201
ngx_rtmp_live_app_conf_t *lacf;
1202+
ngx_rtmp_live_stream_t **stream;
12021203
ngx_flag_t passive;
12031204

12041205
lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
@@ -1269,6 +1270,18 @@ ngx_http_flv_live_close_stream(ngx_rtmp_session_t *s,
12691270

12701271
*cctx = ctx->next;
12711272

1273+
if (ctx->stream->pub_ctx == NULL &&
1274+
ctx->stream->ctx == NULL)
1275+
{
1276+
stream = ngx_rtmp_live_get_stream(s, ctx->stream->name, 0);
1277+
if (stream) {
1278+
*stream = (*stream)->next;
1279+
1280+
ctx->stream->next = lacf->free_streams;
1281+
lacf->free_streams = ctx->stream;
1282+
}
1283+
}
1284+
12721285
ctx->next = NULL;
12731286
ctx->stream = NULL;
12741287

0 commit comments

Comments
 (0)