From cb36f9c23c94d2443d4b0311db08fe0d883a2d35 Mon Sep 17 00:00:00 2001 From: BeenWoo Date: Tue, 3 Feb 2015 15:37:46 +0800 Subject: [PATCH] Update ngx_rtmp_codec_module.c Some encoders send "setDataFrame" instead of "@setDataFrame", which makes rtmp module can't show correct video frame rate in stat page. --- ngx_rtmp_codec_module.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ngx_rtmp_codec_module.c b/ngx_rtmp_codec_module.c index ddc9273..f7e62ec 100644 --- a/ngx_rtmp_codec_module.c +++ b/ngx_rtmp_codec_module.c @@ -943,7 +943,15 @@ ngx_rtmp_codec_postconfiguration(ngx_conf_t *cf) } ngx_str_set(&ch->name, "@setDataFrame"); ch->handler = ngx_rtmp_codec_meta_data; - + + // some encoders send setDataFrame instead of @setDataFrame + ch = ngx_array_push(&cmcf->amf); + if (ch == NULL) { + return NGX_ERROR; + } + ngx_str_set(&ch->name, "setDataFrame"); + ch->handler = ngx_rtmp_codec_meta_data; + ch = ngx_array_push(&cmcf->amf); if (ch == NULL) { return NGX_ERROR;