diff --git a/ngx_rtmp_stat_module.c b/ngx_rtmp_stat_module.c index 79e2a34..7e6ef90 100644 --- a/ngx_rtmp_stat_module.c +++ b/ngx_rtmp_stat_module.c @@ -418,7 +418,7 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, ngx_rtmp_record_ctx_t *rctx; ngx_rtmp_record_rec_ctx_t *recctx; ngx_rtmp_session_t *s; - ngx_int_t n; + ngx_int_t n, rn; ngx_uint_t nclients, total_nclients; u_char buf[NGX_INT_T_LEN]; u_char bbuf[NGX_INT32_LEN]; @@ -501,7 +501,7 @@ ngx_rtmp_stat_live(ngx_http_request_t *r, ngx_chain_t ***lll, if (rctx) { recctx = rctx->rec.elts; for (rn = 0; rn < rctx->rec.nelts; ++rn, ++recctx) { - if (recctx->initialized) { + if (recctx->initialized && recctx->file.fd != NGX_INVALID_FILE) { NGX_RTMP_STAT_L(""); is_recording = 1; break;