From f5230ab8ecd7051abf24def778ce68aad0e7123f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 22 Mar 2013 13:48:03 +0100 Subject: [PATCH] fluidsynth: handle discont --- ext/fluidsynth/gstfluidsynth.c | 9 +++++++++ ext/fluidsynth/gstfluidsynth.h | 1 + 2 files changed, 10 insertions(+) diff --git a/ext/fluidsynth/gstfluidsynth.c b/ext/fluidsynth/gstfluidsynth.c index f7d4df1161..3f96f7f6b1 100644 --- a/ext/fluidsynth/gstfluidsynth.c +++ b/ext/fluidsynth/gstfluidsynth.c @@ -382,6 +382,11 @@ produce_samples (GstFluidsynth * fluidsynth, GstClockTime pts, guint64 sample) GST_BUFFER_OFFSET (outbuf) = offset; GST_BUFFER_OFFSET_END (outbuf) = offset + samples; + if (fluidsynth->discont) { + GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT); + fluidsynth->discont = FALSE; + } + return gst_pad_push (fluidsynth->srcpad, outbuf); } @@ -471,6 +476,10 @@ gst_fluidsynth_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buffer) fluidsynth = GST_FLUIDSYNTH (parent); + if (GST_BUFFER_IS_DISCONT (buffer)) { + fluidsynth->discont = TRUE; + } + pts = GST_BUFFER_PTS (buffer); if (pts != GST_CLOCK_TIME_NONE) { diff --git a/ext/fluidsynth/gstfluidsynth.h b/ext/fluidsynth/gstfluidsynth.h index 924cf00906..3344bd8e36 100644 --- a/ext/fluidsynth/gstfluidsynth.h +++ b/ext/fluidsynth/gstfluidsynth.h @@ -61,6 +61,7 @@ struct _GstFluidsynth int sf; GstSegment segment; + gboolean discont; GstClockTime last_pts; guint64 last_sample; };