From: Nicolas Dufresne Date: Thu, 20 Jun 2019 19:59:48 +0000 (-0400) Subject: rtpjitterbuffer: No need to wake the timer thread on head changes X-Git-Tag: 1.19.3~509^2~858 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4c6c335c5b3b6037cc79ecf770043845bf653e5;p=platform%2Fupstream%2Fgstreamer.git rtpjitterbuffer: No need to wake the timer thread on head changes If the jitterbuffer head change, there is no need to systematically wakeup the timer thread. The timer thread will be waken up on if an earlier timeout has been pushed. This prevent some more spurious wakeup when the system is loaded. As a side effect, cranking the clock may set the clock at an earlier position. --- diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 1ed9118..12bdedb 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -3009,13 +3009,6 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent, /* signal addition of new buffer when the _loop is waiting. */ if (G_LIKELY (priv->active)) JBUF_SIGNAL_EVENT (priv); - - /* let's unschedule and unblock any waiting buffers. We only want to do this - * when the head buffer changed */ - if (G_UNLIKELY (priv->clock_id)) { - GST_DEBUG_OBJECT (jitterbuffer, "Unscheduling waiting new buffer"); - unschedule_current_timer (jitterbuffer); - } } GST_DEBUG_OBJECT (jitterbuffer, diff --git a/tests/check/elements/rtpjitterbuffer.c b/tests/check/elements/rtpjitterbuffer.c index 6e07b4d..1ce01ce 100644 --- a/tests/check/elements/rtpjitterbuffer.c +++ b/tests/check/elements/rtpjitterbuffer.c @@ -2047,8 +2047,13 @@ GST_START_TEST (test_rtx_with_backwards_rtptime) gst_buffer_unref (gst_harness_pull (h)); /* crank to time-out the rtx-request for seqnum 6, the point here - being that the backwards rtptime did not mess up the timeout for - the rtx event */ + * being that the backwards rtptime did not mess up the timeout for + * the rtx event. + * + * Note: the jitterbuffer no longer update early timers, as a result + * we need to advance the clock to the expected point + */ + gst_harness_set_time (h, 6 * TEST_BUF_DURATION + 15 * GST_MSECOND); gst_harness_crank_single_clock_wait (h); verify_rtx_event (h, 6, 5 * TEST_BUF_DURATION + 15 * GST_MSECOND, 17, 35 * GST_MSECOND);