mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 16:33:34 +00:00
Merge "res_rtp_asterisk: Fix placement of txcount increment" into 13
This commit is contained in:
@@ -2252,7 +2252,6 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz
|
|||||||
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
||||||
struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
|
struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
|
||||||
int res;
|
int res;
|
||||||
int hdrlen = 12;
|
|
||||||
|
|
||||||
*ice = 0;
|
*ice = 0;
|
||||||
|
|
||||||
@@ -2260,9 +2259,6 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rtp->txcount++;
|
|
||||||
rtp->txoctetcount += (len - hdrlen);
|
|
||||||
|
|
||||||
#ifdef HAVE_PJPROJECT
|
#ifdef HAVE_PJPROJECT
|
||||||
if (rtp->ice) {
|
if (rtp->ice) {
|
||||||
pj_thread_register_check();
|
pj_thread_register_check();
|
||||||
@@ -2289,7 +2285,16 @@ static int rtcp_sendto(struct ast_rtp_instance *instance, void *buf, size_t size
|
|||||||
|
|
||||||
static int rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int *ice)
|
static int rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int *ice)
|
||||||
{
|
{
|
||||||
return __rtp_sendto(instance, buf, size, flags, sa, 0, ice, 1);
|
struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
|
||||||
|
int hdrlen = 12;
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if ((res = __rtp_sendto(instance, buf, size, flags, sa, 0, ice, 1)) > 0) {
|
||||||
|
rtp->txcount++;
|
||||||
|
rtp->txoctetcount += (res - hdrlen);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtp_get_rate(struct ast_format *format)
|
static int rtp_get_rate(struct ast_format *format)
|
||||||
|
Reference in New Issue
Block a user