added timestamp to meta-copy packet

This commit is contained in:
Roman Arutyunyan 2013-09-18 16:55:19 +04:00
parent f052e4cc48
commit 67443c28b4

View file

@ -22,7 +22,8 @@ static ngx_int_t ngx_rtmp_codec_postconfiguration(ngx_conf_t *cf);
static ngx_int_t ngx_rtmp_codec_reconstruct_meta(ngx_rtmp_session_t *s);
static ngx_int_t ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s,
ngx_rtmp_header_t *h, ngx_chain_t *in);
static ngx_int_t ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s);
static ngx_int_t ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s,
uint32_t timestamp);
typedef struct {
@ -432,7 +433,7 @@ ngx_rtmp_codec_reconstruct_meta(ngx_rtmp_session_t *s)
return NGX_ERROR;
}
return ngx_rtmp_codec_prepare_meta(s);
return ngx_rtmp_codec_prepare_meta(s, 0);
}
@ -457,12 +458,12 @@ ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
return NGX_ERROR;
}
return ngx_rtmp_codec_prepare_meta(s);
return ngx_rtmp_codec_prepare_meta(s, h->timestamp);
}
static ngx_int_t
ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s)
ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s, uint32_t timestamp)
{
ngx_rtmp_header_t h;
ngx_rtmp_codec_ctx_t *ctx;
@ -473,6 +474,7 @@ ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s)
h.csid = NGX_RTMP_CSID_AMF;
h.msid = NGX_RTMP_MSID;
h.type = NGX_RTMP_MSG_AMF_META;
h.timestamp = timestamp;
ngx_rtmp_prepare_message(s, &h, NULL, ctx->meta);
ctx->meta_version = ngx_rtmp_codec_get_next_version();