diff --git a/nginx-rtmp-module/src/ngx_rtmp_codec_module.c b/nginx-rtmp-module/src/ngx_rtmp_codec_module.c index 52b71e2f..9ac8a7ea 100644 --- a/nginx-rtmp-module/src/ngx_rtmp_codec_module.c +++ b/nginx-rtmp-module/src/ngx_rtmp_codec_module.c @@ -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;