mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-11 23:01:09 +02:00
implemented amf context flag to save context instead of actual value
This commit is contained in:
parent
fb89d9b931
commit
d0ec6881c1
|
@ -291,14 +291,14 @@ ngx_int_t
|
|||
ngx_rtmp_amf_read(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
|
||||
size_t nelts)
|
||||
{
|
||||
void *data;
|
||||
ngx_int_t type;
|
||||
uint8_t type8;
|
||||
size_t n;
|
||||
uint16_t len;
|
||||
ngx_int_t rc;
|
||||
u_char buf[8];
|
||||
uint32_t max_index;
|
||||
void *data;
|
||||
ngx_int_t type;
|
||||
uint8_t type8;
|
||||
size_t n;
|
||||
uint16_t len;
|
||||
ngx_int_t rc;
|
||||
u_char buf[8];
|
||||
uint32_t max_index;
|
||||
|
||||
for(n = 0; n < nelts; ++n) {
|
||||
|
||||
|
@ -320,6 +320,13 @@ ngx_rtmp_amf_read(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
|
|||
ngx_rtmp_amf_is_compatible_type(elts->type & 0xff, type))
|
||||
? elts->data
|
||||
: NULL;
|
||||
|
||||
if (elts && (elts->type & NGX_RTMP_AMF_CONTEXT)) {
|
||||
if (data) {
|
||||
*(ngx_rtmp_amf_ctx_t *) data = *ctx;
|
||||
}
|
||||
data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
/* r/w flags */
|
||||
#define NGX_RTMP_AMF_OPTIONAL 0x1000
|
||||
#define NGX_RTMP_AMF_TYPELESS 0x2000
|
||||
#define NGX_RTMP_AMF_CONTEXT 0x4000
|
||||
|
||||
#define NGX_RTMP_AMF_VARIANT (NGX_RTMP_AMF_VARIANT_\
|
||||
|NGX_RTMP_AMF_TYPELESS)
|
||||
|
|
Loading…
Reference in a new issue