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.
This commit is contained in:
Nicolas Dufresne 2019-06-20 15:59:48 -04:00 committed by Olivier Crête
parent 36771b75e9
commit d4c6c335c5
2 changed files with 7 additions and 9 deletions

View file

@ -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,

View file

@ -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);