mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
jitterbuffer: small cleanup
This commit is contained in:
parent
69c78f72d5
commit
aa951433ee
1 changed files with 9 additions and 14 deletions
|
@ -1777,6 +1777,11 @@ handle_next_buffer (GstRtpJitterBuffer * jitterbuffer)
|
||||||
gint gap;
|
gint gap;
|
||||||
GstRTPBuffer rtp = { NULL, };
|
GstRTPBuffer rtp = { NULL, };
|
||||||
|
|
||||||
|
/* only push buffers when PLAYING and active and not buffering */
|
||||||
|
if (priv->blocked || !priv->active ||
|
||||||
|
rtp_jitter_buffer_is_buffering (priv->jbuf))
|
||||||
|
return GST_FLOW_WAIT;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
/* peek a buffer, we're just looking at the sequence number.
|
/* peek a buffer, we're just looking at the sequence number.
|
||||||
* If all is fine, we'll pop and push it. If the sequence number is wrong we
|
* If all is fine, we'll pop and push it. If the sequence number is wrong we
|
||||||
|
@ -2065,23 +2070,13 @@ gst_rtp_jitter_buffer_loop (GstRtpJitterBuffer * jitterbuffer)
|
||||||
priv = jitterbuffer->priv;
|
priv = jitterbuffer->priv;
|
||||||
|
|
||||||
JBUF_LOCK_CHECK (priv, flushing);
|
JBUF_LOCK_CHECK (priv, flushing);
|
||||||
while (TRUE) {
|
do {
|
||||||
GST_DEBUG_OBJECT (jitterbuffer, "Peeking item");
|
|
||||||
|
|
||||||
/* only push buffers when PLAYING and active and not buffering */
|
|
||||||
if (!priv->blocked && priv->active &&
|
|
||||||
!rtp_jitter_buffer_is_buffering (priv->jbuf))
|
|
||||||
result = handle_next_buffer (jitterbuffer);
|
result = handle_next_buffer (jitterbuffer);
|
||||||
else
|
if (G_LIKELY (result == GST_FLOW_WAIT))
|
||||||
result = GST_FLOW_WAIT;
|
|
||||||
|
|
||||||
if (result == GST_FLOW_WAIT) {
|
|
||||||
/* now wait for the next event */
|
/* now wait for the next event */
|
||||||
result = wait_next_timeout (jitterbuffer);
|
result = wait_next_timeout (jitterbuffer);
|
||||||
}
|
}
|
||||||
if (result != GST_FLOW_OK)
|
while (result == GST_FLOW_OK);
|
||||||
break;
|
|
||||||
}
|
|
||||||
JBUF_UNLOCK (priv);
|
JBUF_UNLOCK (priv);
|
||||||
|
|
||||||
/* if we get here we need to pause */
|
/* if we get here we need to pause */
|
||||||
|
|
Loading…
Reference in a new issue