Skip to content

Commit

Permalink
bug fix: skip parsing aac non config data in ngx_rtmp_codec_av
Browse files Browse the repository at this point in the history
  • Loading branch information
igorshevach committed May 12, 2024
1 parent 5b80aaf commit f81e98b
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions nginx-rtmp-module/src/ngx_rtmp_codec_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,30 +580,31 @@ ngx_rtmp_codec_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ngx_chain_t *in)
}

/* no conf */
if (h->type == NGX_RTMP_MSG_VIDEO
&& !ngx_rtmp_is_codec_header(ctx->video_codec_id, in))
if (!ngx_rtmp_is_codec_header(ctx->video_codec_id, in))
{
if (ctx->video_captions_tries <= 0) {
return NGX_OK;
}
if(h->type == NGX_RTMP_MSG_VIDEO) {
if (ctx->video_captions_tries <= 0) {
return NGX_OK;
}

switch (ctx->video_codec_id) {
switch (ctx->video_codec_id) {

case NGX_RTMP_VIDEO_H264:
case NGX_RTMP_CODEC_FOURCC_HVC1:
case NGX_RTMP_CODEC_FOURCC_HEV1:
if (ngx_rtmp_codec_detect_cea(s, in)) {
ctx->video_captions = 1;
ctx->video_captions_tries = 0;
case NGX_RTMP_VIDEO_H264:
case NGX_RTMP_CODEC_FOURCC_HVC1:
case NGX_RTMP_CODEC_FOURCC_HEV1:
if (ngx_rtmp_codec_detect_cea(s, in)) {
ctx->video_captions = 1;
ctx->video_captions_tries = 0;

} else {
ctx->video_captions_tries--;
}
} else {
ctx->video_captions_tries--;
}

break;
break;

default:
ctx->video_captions_tries = 0;
default:
ctx->video_captions_tries = 0;
}
}

return NGX_OK;
Expand Down

0 comments on commit f81e98b

Please sign in to comment.