rtpjitterbuffer: Stop waiting after EOS

After EOS is received, it is pointless to wait for further events,
specially waiting on timers. This patches fixes two cases where we could
wait instead of returning GST_FLOW_EOS and trigger a spin of the loop
function when EOS is queued, regardless if this EOS is the queue head or
not.
This commit is contained in:
Nicolas Dufresne 2018-11-22 10:41:29 -05:00 committed by Nicolas Dufresne
parent 88a6832b2a
commit 3de2c28fc1

View file

@ -1825,7 +1825,7 @@ queue_event (GstRtpJitterBuffer * jitterbuffer, GstEvent * event)
GST_DEBUG_OBJECT (jitterbuffer, "adding event");
item = alloc_item (event, ITEM_TYPE_EVENT, -1, -1, -1, 0, -1);
rtp_jitter_buffer_insert (priv->jbuf, item, &head, NULL);
if (head)
if (head || priv->eos)
JBUF_SIGNAL_EVENT (priv);
return TRUE;
@ -3625,7 +3625,13 @@ handle_next_buffer (GstRtpJitterBuffer * jitterbuffer)
GST_DEBUG_OBJECT (jitterbuffer,
"Sequence number GAP detected: expected %d instead of %d (%d missing)",
next_seqnum, seqnum, gap);
result = GST_FLOW_WAIT;
/* if we have reached EOS, just keep processing */
if (priv->eos) {
result = pop_and_push_next (jitterbuffer, seqnum);
result = GST_FLOW_OK;
} else {
result = GST_FLOW_WAIT;
}
}
}