Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
vacing committed Jan 29, 2024
1 parent 5c0722b commit 813cdb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
22 changes: 10 additions & 12 deletions ngx_rtmp_gop_cache_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion ngx_rtmp_live_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 813cdb6

Please sign in to comment.