Commit 91f5b4ea authored by Edward Hervey's avatar Edward Hervey Committed by Edward Hervey
Browse files

rtprtxsend: Update statistics before pushing

If an element queries the number of retransmission buffers pushed
*while* the push is still taking place (and before the object lock
is taken just after) it would end up with the wrong statistic
being reported.

Increment it just before the push, avoids races when getting statistics
parent da025dc8
...@@ -767,11 +767,12 @@ gst_rtp_rtx_send_src_loop (GstRtpRtxSend * rtx) ...@@ -767,11 +767,12 @@ gst_rtp_rtx_send_src_loop (GstRtpRtxSend * rtx)
GST_LOG_OBJECT (rtx, "pushing rtx buffer %p", data->object); GST_LOG_OBJECT (rtx, "pushing rtx buffer %p", data->object);
if (G_LIKELY (GST_IS_BUFFER (data->object))) { if (G_LIKELY (GST_IS_BUFFER (data->object))) {
gst_pad_push (rtx->srcpad, GST_BUFFER (data->object));
/* Update statistics just before pushing. */
rtx->num_rtx_packets++; rtx->num_rtx_packets++;
gst_pad_push (rtx->srcpad, GST_BUFFER (data->object));
} else if (GST_IS_EVENT (data->object)) { } else if (GST_IS_EVENT (data->object)) {
gst_pad_push_event (rtx->srcpad, GST_EVENT (data->object)); gst_pad_push_event (rtx->srcpad, GST_EVENT (data->object));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment