mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-14 00:56:16 +08:00
fixed repeated onMetaData string
This commit is contained in:
@ -440,33 +440,18 @@ static ngx_int_t
|
|||||||
ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
||||||
ngx_chain_t *in)
|
ngx_chain_t *in)
|
||||||
{
|
{
|
||||||
ngx_int_t rc;
|
|
||||||
ngx_rtmp_codec_ctx_t *ctx;
|
ngx_rtmp_codec_ctx_t *ctx;
|
||||||
ngx_rtmp_core_srv_conf_t *cscf;
|
ngx_rtmp_core_srv_conf_t *cscf;
|
||||||
|
|
||||||
static ngx_rtmp_amf_elt_t out_elts[] = {
|
|
||||||
|
|
||||||
{ NGX_RTMP_AMF_STRING,
|
|
||||||
ngx_null_string,
|
|
||||||
"onMetaData", 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_codec_module);
|
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_codec_module);
|
||||||
|
|
||||||
cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
|
cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
|
||||||
|
|
||||||
if (ctx->meta) {
|
if (ctx->meta) {
|
||||||
ngx_rtmp_free_shared_chain(cscf, ctx->meta);
|
ngx_rtmp_free_shared_chain(cscf, ctx->meta);
|
||||||
ctx->meta = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = ngx_rtmp_append_amf(s, &ctx->meta, NULL, out_elts,
|
ctx->meta = ngx_rtmp_append_shared_bufs(cscf, NULL, in);
|
||||||
sizeof(out_elts) / sizeof(out_elts[0]));
|
|
||||||
if (rc != NGX_OK || ctx->meta == NULL) {
|
|
||||||
return NGX_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->meta = ngx_rtmp_append_shared_bufs(cscf, ctx->meta, in);
|
|
||||||
|
|
||||||
if (ctx->meta == NULL) {
|
if (ctx->meta == NULL) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
Reference in New Issue
Block a user