mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
rtpsession: Count sent RTCP packets after they have been finished
If they are counted before calling gst_rtcp_buffer_end(), then the size is way too big.
This commit is contained in:
parent
306ee454c6
commit
64e4ffa25b
1 changed files with 4 additions and 8 deletions
|
@ -2570,8 +2570,6 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.rtcp) {
|
if (data.rtcp) {
|
||||||
guint size;
|
|
||||||
|
|
||||||
/* we keep track of the last report time in order to timeout inactive
|
/* we keep track of the last report time in order to timeout inactive
|
||||||
* receivers or senders */
|
* receivers or senders */
|
||||||
sess->last_rtcp_send_time = data.current_time;
|
sess->last_rtcp_send_time = data.current_time;
|
||||||
|
@ -2580,10 +2578,6 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
|
||||||
/* add SDES for this source when not already added */
|
/* add SDES for this source when not already added */
|
||||||
if (!data.has_sdes)
|
if (!data.has_sdes)
|
||||||
session_sdes (sess, &data);
|
session_sdes (sess, &data);
|
||||||
|
|
||||||
/* update average RTCP size before sending */
|
|
||||||
size = GST_BUFFER_SIZE (data.rtcp) + sess->header_len;
|
|
||||||
UPDATE_AVG (sess->stats.avg_rtcp_packet_size, size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for outdated collisions */
|
/* check for outdated collisions */
|
||||||
|
@ -2620,10 +2614,12 @@ rtp_session_on_timeout (RTPSession * sess, GstClockTime current_time,
|
||||||
gst_rtcp_buffer_end (data.rtcp);
|
gst_rtcp_buffer_end (data.rtcp);
|
||||||
|
|
||||||
GST_DEBUG ("sending packet");
|
GST_DEBUG ("sending packet");
|
||||||
if (sess->callbacks.send_rtcp)
|
if (sess->callbacks.send_rtcp) {
|
||||||
|
UPDATE_AVG (sess->stats.avg_rtcp_packet_size,
|
||||||
|
GST_BUFFER_SIZE (data.rtcp));
|
||||||
result = sess->callbacks.send_rtcp (sess, own, data.rtcp,
|
result = sess->callbacks.send_rtcp (sess, own, data.rtcp,
|
||||||
sess->sent_bye, sess->send_rtcp_user_data);
|
sess->sent_bye, sess->send_rtcp_user_data);
|
||||||
else {
|
} else {
|
||||||
GST_DEBUG ("freeing packet");
|
GST_DEBUG ("freeing packet");
|
||||||
gst_buffer_unref (data.rtcp);
|
gst_buffer_unref (data.rtcp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue