From 0fae88b5fd15fd613aa8ae1cb9e8fb56746fddac Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 5 Mar 2019 13:43:12 +0100 Subject: [PATCH] rtpsource: fix stats about received packets The update_receiver_stats() function is called also when sending packets in rtp_source_send_rtp(), and sending packets may happen using a buffer list rather than individual buffers. So update the stats using the actual number of packets sent. NOTE: this is fine for the receive path too (rtp_process_send_rtp) because the receive path does not support buffer lists and pinfo->packets would always be equal to 1 in this case. --- gst/rtpmanager/rtpsource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/rtpmanager/rtpsource.c b/gst/rtpmanager/rtpsource.c index ff6b5d6..d712fc6 100644 --- a/gst/rtpmanager/rtpsource.c +++ b/gst/rtpmanager/rtpsource.c @@ -1178,7 +1178,7 @@ update_receiver_stats (RTPSource * src, RTPPacketInfo * pinfo, src->stats.octets_received += pinfo->payload_len; src->stats.bytes_received += pinfo->bytes; - src->stats.packets_received++; + src->stats.packets_received += pinfo->packets; /* for the bitrate estimation */ src->bytes_received += pinfo->payload_len; -- 2.7.4