summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-01-22 13:33:14 +0100
committerWim Taymans <wim@wtay.(none)>2009-01-22 13:36:08 +0100
commitf8f5b55ddd367d1a72321ec476deae0e035269dc (patch)
tree22f44117afa046ad8852d21bead7a7925ade44c5
parent054167100d601e5f609a87c6f8f56eacf1fd0340 (diff)
downloadgst-plugins-bad-f8f5b55ddd367d1a72321ec476deae0e035269dc.tar.gz
gst-plugins-bad-f8f5b55ddd367d1a72321ec476deae0e035269dc.tar.bz2
gst-plugins-bad-f8f5b55ddd367d1a72321ec476deae0e035269dc.zip
Unlock the jitterbuffer before pushing out the packet-lost events.
Move some code before we do the unlock to make the jitterbuffer state consistent while we are unlocked.
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 95cde211..2d3d4458 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -1442,6 +1442,11 @@ again:
priv->num_late++;
discont = TRUE;
+ /* update our expected next packet */
+ priv->last_popped_seqnum = next_seqnum;
+ priv->last_out_time = out_time;
+ priv->next_seqnum = (next_seqnum + 1) & 0xffff;
+
if (priv->do_lost) {
/* create paket lost event */
event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
@@ -1449,13 +1454,11 @@ again:
"seqnum", G_TYPE_UINT, (guint) next_seqnum,
"timestamp", G_TYPE_UINT64, out_time,
"duration", G_TYPE_UINT64, duration, NULL));
+
+ JBUF_UNLOCK (priv);
gst_pad_push_event (priv->srcpad, event);
+ JBUF_LOCK_CHECK (priv, flushing);
}
-
- /* update our expected next packet */
- priv->last_popped_seqnum = next_seqnum;
- priv->last_out_time = out_time;
- priv->next_seqnum = (next_seqnum + 1) & 0xffff;
/* look for next packet */
goto again;
}