mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 18:01:08 +02:00
Set payload length
This commit is contained in:
parent
58c4ddd40e
commit
7f64585b75
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue