From dc408d56c53f4351a4dd285447dbe22c973f38c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 2 Sep 2022 12:17:39 +0300 Subject: [PATCH] rtpjitterbuffer: Only unschedule timers for late packets if they're not RTX packets and only once Timers for RTX packets are dealt with later in update_rtx_timers(), and timers for non-RTX packets would potentially also be unscheduled a second time from there so avoid that. Also don't shadow the timer variable from the outer scope but instead make use of it directly. Part-of: --- .../gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c index d4bc030a33..5f7ad1652d 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c @@ -3161,13 +3161,13 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, do_next_seqnum = FALSE; /* If an out of order packet arrives before its lost timer has expired - * remove it to avoid false positive statistics. */ - RtpTimer *timer = rtp_timer_queue_find (priv->timers, seqnum); - if (timer && timer->queued && timer->type == RTP_TIMER_LOST) { + * remove it to avoid false positive statistics. If this is an RTX + * packet then the timer will be updated later as part of update_rtx_timers() */ + if (!is_rtx && timer && timer->type == RTP_TIMER_LOST) { rtp_timer_queue_unschedule (priv->timers, timer); GST_DEBUG_OBJECT (jitterbuffer, "removing lost timer for late seqnum #%u", seqnum); - rtp_timer_free (timer); + rtp_timer_free (g_steal_pointer (&timer)); } }