Set payload length

This commit is contained in:
Sergey Dryabzhinsky 2016-02-28 18:07:29 +03:00
parent 58c4ddd40e
commit 7f64585b75
2 changed files with 6 additions and 6 deletions

View file

@ -323,7 +323,7 @@ ngx_rtmp_bandwidth_detection_start(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
bw_ctx->bytes_out = s->out_bytes;
// Send first packet with empty payload - for latency calculation
return ngx_rtmp_send_bwcheck(s, NULL);
return ngx_rtmp_send_bwcheck(s, NULL, 0);
}
@ -389,7 +389,7 @@ ngx_rtmp_bandwidth_detection_check_result(ngx_rtmp_session_t *s)
bw_ctx->pkt_sent ++;
bw_ctx->cum_latency ++;
return ngx_rtmp_send_bwcheck(s, payload);
return ngx_rtmp_send_bwcheck(s, payload, NGX_RTMP_BANDWIDTH_DETECTION_PAYLOAD_LENGTH);
} else if (bw_ctx->pkt_received == bw_ctx->pkt_sent) {
@ -422,7 +422,7 @@ ngx_rtmp_bandwidth_detection_check_result(ngx_rtmp_session_t *s)
if (bw_ctx->pkt_sent == 1 && bw_ctx->pkt_received == 1) {
// First call
return ngx_rtmp_send_bwcheck(s, payload);
return ngx_rtmp_send_bwcheck(s, payload, NGX_RTMP_BANDWIDTH_DETECTION_PAYLOAD_LENGTH);
}
return NGX_OK;

View file

@ -990,7 +990,7 @@ ngx_rtmp_send_sample_access(ngx_rtmp_session_t *s)
/* -------------------------------------- For bandwidth detection ---------------------------------- */
ngx_chain_t *
ngx_rtmp_create_bwcheck(ngx_rtmp_session_t *s, u_char *payload)
ngx_rtmp_create_bwcheck(ngx_rtmp_session_t *s, u_char *payload, size_t plength)
{
ngx_rtmp_header_t h;
@ -1041,10 +1041,10 @@ ngx_rtmp_create_bwcheck(ngx_rtmp_session_t *s, u_char *payload)
}
ngx_int_t
ngx_rtmp_send_bwcheck(ngx_rtmp_session_t *s, u_char *payload)
ngx_rtmp_send_bwcheck(ngx_rtmp_session_t *s, u_char *payload, size_t plength)
{
return ngx_rtmp_send_shared_packet(s,
ngx_rtmp_create_bwcheck(s, payload));
ngx_rtmp_create_bwcheck(s, payload, plength));
}