diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index b3c1246..a352b20 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -1144,7 +1144,9 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstBuffer * buffer)
 
   if (G_UNLIKELY (priv->clock_rate == -1)) {
     /* no clock rate given on the caps, try to get one with the signal */
+    JBUF_UNLOCK (priv);
     gst_rtp_jitter_buffer_get_clock_rate (jitterbuffer, pt);
+    JBUF_LOCK_CHECK (priv, out_flushing);
     if (G_UNLIKELY (priv->clock_rate == -1))
       goto no_clock_rate;
   }
