From 4bd2ffb26e75b3dfad4bc6733f644161e6753d78 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 27 Jun 2013 16:13:37 +0200 Subject: [PATCH] jitterbuffer: signal timestamp discont We can now use the RESYNC buffer flag to mark a timestamp discont when we update the ts-offset property. --- gst/rtpmanager/gstrtpjitterbuffer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c index 9f5f563c1e..4e4bb69ebf 100644 --- a/gst/rtpmanager/gstrtpjitterbuffer.c +++ b/gst/rtpmanager/gstrtpjitterbuffer.c @@ -131,6 +131,7 @@ struct _GstRtpJitterBufferPrivate GCond jbuf_cond; gboolean waiting; gboolean discont; + gboolean ts_discont; gboolean active; guint64 out_offset; @@ -1883,6 +1884,10 @@ push_buffer: GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT); priv->discont = FALSE; } + if (G_UNLIKELY (priv->ts_discont)) { + GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_RESYNC); + priv->ts_discont = FALSE; + } /* apply timestamp with offset to buffer now */ GST_BUFFER_PTS (outbuf) = out_time; @@ -2320,9 +2325,7 @@ gst_rtp_jitter_buffer_set_property (GObject * object, case PROP_TS_OFFSET: JBUF_LOCK (priv); priv->ts_offset = g_value_get_int64 (value); - /* FIXME, we don't really have a method for signaling a timestamp - * DISCONT without also making this a data discont. */ - /* priv->discont = TRUE; */ + priv->ts_discont = TRUE; JBUF_UNLOCK (priv); break; case PROP_DO_LOST: