rtpjitterbuffer: output loop function sleeps and never wakes up to push again
I have a log for an intermittent bug where rtpjitterbuffer's output loop goes into JBUF_WAIT_EVENT() and never wakes up in the presence of sufficient packet loss, and input packets pile up.
0:26:45.015265630 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3179:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Pushed packet #35341, now 20 packets, head: 0, percent -1
0:26:45.015270604 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2174:update_current_timer:<rtpjitterbuffer0> waiting till 0:01:04.887498004 and earliest timeout is at 0:01:06.015148278
0:26:45.015315038 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2863:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Received packet #35344 at time 0:01:04.401075956, discont 0, rtx 0
0:26:45.015328149 1 0x7fcc2c0afed0 LOG rtpjitterbuffer gstrtpjitterbuffer.c:2565:calculate_jitter:<rtpjitterbuffer0> dtsdiff +0:00:00.000121167 rtptime +0:00:00.033000000, clock-rate 90000, diff +0:00:00.032878833, jitter: 0:00:00.109087906
0:26:45.015332804 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2984:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> expected #35342, got #35344, gap of 2
0:26:45.015336493 1 0x7fcc2c0afed0 WARN rtpjitterbuffer gstrtpjitterbuffer.c:2995:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> 1002 pending timers > 620 - resetting
0:26:45.015339642 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2705:gst_rtp_jitter_buffer_reset:<rtpjitterbuffer0> flush and reset jitterbuffer
0:26:45.015457141 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:4154:gst_rtp_jitter_buffer_loop: waiting event done
0:26:45.015465781 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3637:handle_next_buffer:<rtpjitterbuffer0> no buffer, going to wait
0:26:45.015468995 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:4154:gst_rtp_jitter_buffer_loop: waiting event
0:26:45.016944241 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2863:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Received packet #35345 at time 0:01:04.402665771, discont 0, rtx 0
0:26:45.016955880 1 0x7fcc2c0afed0 LOG rtpjitterbuffer gstrtpjitterbuffer.c:2565:calculate_jitter:<rtpjitterbuffer0> dtsdiff +0:00:00.001589815 rtptime +0:00:00.000000000, clock-rate 90000, diff +0:00:00.001589815, jitter: 0:00:00.102369275
0:26:45.016960504 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2956:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> First buffer #35345
0:26:45.017000490 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3179:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Pushed packet #35345, now 1 packets, head: 1, percent -1
0:26:45.017010469 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2174:update_current_timer:<rtpjitterbuffer0> waiting till 0:01:04.887498004 and earliest timeout is at 0:01:06.050814526
0:26:45.017019179 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:4154:gst_rtp_jitter_buffer_loop: waiting event done
0:26:45.017033701 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3619:handle_next_buffer:<rtpjitterbuffer0> Sequence number GAP detected: expected 35344 instead of 35345 (1 missing)
0:26:45.017039136 1 0x7fcbfc0034a0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:4154:gst_rtp_jitter_buffer_loop: waiting event
0:26:45.017055952 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2863:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Received packet #35346 at time 0:01:04.402782459, discont 0, rtx 0
0:26:45.017064953 1 0x7fcc2c0afed0 LOG rtpjitterbuffer gstrtpjitterbuffer.c:2565:calculate_jitter:<rtpjitterbuffer0> dtsdiff +0:00:00.000116688 rtptime +0:00:00.000000000, clock-rate 90000, diff +0:00:00.000116688, jitter: 0:00:00.095978488
0:26:45.017070633 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:2984:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> expected #35346, got #35346, gap of 0
0:26:45.017073442 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3015:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Clearing gap packets
0:26:45.017077781 1 0x7fcc2c0afed0 DEBUG rtpjitterbuffer gstrtpjitterbuffer.c:3179:gst_rtp_jitter_buffer_chain:<rtpjitterbuffer0> Pushed packet #35346, now 2 packets, head: 0, percent -1