diff --git a/ngx_rtmp_bandwidth_detection_module.c b/ngx_rtmp_bandwidth_detection_module.c index 7bacdf0..75009d2 100644 --- a/ngx_rtmp_bandwidth_detection_module.c +++ b/ngx_rtmp_bandwidth_detection_module.c @@ -234,11 +234,15 @@ ngx_rtmp_bandwidth_detection_start(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ngx_rtmp_bandwidth_detection_ctx_t *bw_ctx; ngx_rtmp_live_ctx_t *lv_ctx; + static struct { + double trans; + } v; + static ngx_rtmp_amf_elt_t in_elts[] = { { NGX_RTMP_AMF_NUMBER, ngx_null_string, - "checkBandwidth", 0 }, + &v.trans, 0 }, }; diff --git a/ngx_rtmp_send.c b/ngx_rtmp_send.c index 7087a63..64390d5 100644 --- a/ngx_rtmp_send.c +++ b/ngx_rtmp_send.c @@ -1024,7 +1024,10 @@ ngx_rtmp_create_bwcheck(ngx_rtmp_session_t *s, u_char *payload) sizeof(out_inf) }, }; - out_inf[0].data = payload; + if (payload != NULL) { + out_inf[0].data = payload; + out_inf[0].len = ngx_strlen(payload); + } trans = NGX_RTMP_BANDWIDTH_DETECTION_BWCHECK_TRANS; memset(&h, 0, sizeof(h));