Skip to content

Commit

Permalink
improved Envivio fix: now key length can be unfinalized with object
Browse files Browse the repository at this point in the history
  • Loading branch information
arut committed Jan 1, 2014
1 parent 3072454 commit 57a96ac
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ngx_rtmp_amf.c
Expand Up @@ -197,8 +197,15 @@ ngx_rtmp_amf_read_object(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
}
#endif
/* read key */
if (ngx_rtmp_amf_get(ctx, buf, 2) != NGX_OK)
switch (ngx_rtmp_amf_get(ctx, buf, 2)) {
case NGX_DONE:
/* Envivio sends unfinalized arrays */
return NGX_OK;
case NGX_OK:
break;
default:
return NGX_ERROR;
}

ngx_rtmp_amf_reverse_copy(&len, buf, 2);

Expand Down Expand Up @@ -229,14 +236,9 @@ ngx_rtmp_amf_read_object(ngx_rtmp_amf_ctx_t *ctx, ngx_rtmp_amf_elt_t *elts,
return NGX_ERROR;
}

rc = ngx_rtmp_amf_get(ctx, &type, 1);

/* Envivo encoder does not finalize objects properly */
if (rc == NGX_DONE) {
return NGX_OK;
}

if (rc != NGX_OK || type != NGX_RTMP_AMF_END) {
if (ngx_rtmp_amf_get(ctx, &type, 1) != NGX_OK
|| type != NGX_RTMP_AMF_END)
{
return NGX_ERROR;
}

Expand Down

0 comments on commit 57a96ac

Please sign in to comment.