From 813cdb6769eaaee59ea1a5ff552bb418dbeb3862 Mon Sep 17 00:00:00 2001 From: vacing fang Date: Mon, 29 Jan 2024 15:31:08 +0800 Subject: [PATCH] fix some bugs --- ngx_rtmp_gop_cache_module.c | 22 ++++++++++------------ ngx_rtmp_live_module.c | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ngx_rtmp_gop_cache_module.c b/ngx_rtmp_gop_cache_module.c index 592137e..465219b 100644 --- a/ngx_rtmp_gop_cache_module.c +++ b/ngx_rtmp_gop_cache_module.c @@ -569,14 +569,6 @@ ngx_rtmp_gop_cache_send(ngx_rtmp_session_t *s) pkt = NULL; apkt = NULL; acopkt = NULL; - header = NULL; - coheader = NULL; - meta = NULL; - version = 0; - coversion = 0; - meta_version = 0; - version_send = 0; - coversion_send = 0; pub_ctx = ctx->stream->pub_ctx; rs = pub_ctx->session; @@ -598,6 +590,15 @@ ngx_rtmp_gop_cache_send(ngx_rtmp_session_t *s) } for (cache = gctx->cache_head; cache; cache = cache->next) { + header = NULL; + coheader = NULL; + meta = NULL; + version = 0; + coversion = 0; + meta_version = 0; + version_send = 0; + coversion_send = 0; + if (s->connection == NULL || s->connection->destroyed) { return; } @@ -615,15 +616,12 @@ ngx_rtmp_gop_cache_send(ngx_rtmp_session_t *s) } } - if (meta == NULL && meta_version != cache->meta_version) { + if (meta_version != cache->meta_version) { meta = handler->meta_message_pt(s, cache->meta); if (meta == NULL) { ngx_rtmp_finalize_session(s); return; } - } - - if (meta) { meta_version = cache->meta_version; } diff --git a/ngx_rtmp_live_module.c b/ngx_rtmp_live_module.c index d243886..b2c96fc 100644 --- a/ngx_rtmp_live_module.c +++ b/ngx_rtmp_live_module.c @@ -1098,7 +1098,7 @@ ngx_rtmp_live_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, if (header && version != version_send) { ngx_log_debug2(NGX_LOG_DEBUG_RTMP, ss->connection->log, 0, - "live: %s coheader send, version=%ui", + "live: %s header send, version=%ui", type_s, version); if (handler->apkt == NULL) { handler->apkt = handler->append_message_pt(ss, &lh,