Unlock the jitterbuffer before pushing out the packet-lost events.
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 22 Jan 2009 12:33:14 +0000 (13:33 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 11 Aug 2009 01:30:40 +0000 (02:30 +0100)
Move some code before we do the unlock to make the jitterbuffer state
consistent while we are unlocked.

gst/rtpmanager/gstrtpjitterbuffer.c

index 95cde21113cc040a0cb92b0202e6f8eb29091c1c..2d3d44585cce0708a1c9f4c05e038b2afdb350c3 100644 (file)
@@ -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;
     }