Skip to content
Snippets Groups Projects
Commit fd2c43ce authored by Cody Messick's avatar Cody Messick Committed by chad.hanna
Browse files

interpolator: fix bug where interpolator was pushing out nongap buffers when...

interpolator: fix bug where interpolator was pushing out nongap buffers when it received gap buffers (chads patch)
parent 0f9d95d3
No related branches found
No related tags found
No related merge requests found
Pipeline #51220 passed with warnings
......@@ -501,6 +501,7 @@ static void gstlal_interpolator_init(GSTLALInterpolator *element)
/* Always initialize with a discont */
element->need_discont = TRUE;
element->need_pretend = TRUE;
element->last_gap_state = FALSE;
element->adapter = g_object_new(GST_TYPE_AUDIOADAPTER, NULL);
}
......@@ -802,10 +803,14 @@ static void set_metadata(GSTLALInterpolator *element, GstBuffer *buf, guint64 ou
GST_BUFFER_FLAG_SET(buf, GST_BUFFER_FLAG_DISCONT);
element->need_discont = FALSE;
}
if(gap)
if(gap) {
GST_BUFFER_FLAG_SET(buf, GST_BUFFER_FLAG_GAP);
else
element->last_gap_state = TRUE;
}
else {
GST_BUFFER_FLAG_UNSET(buf, GST_BUFFER_FLAG_GAP);
element->last_gap_state = FALSE;
}
GST_INFO_OBJECT(element, "%s%s output_buffer %p spans %" GST_BUFFER_BOUNDARIES_FORMAT, gap ? "gap" : "nongap", GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLAG_DISCONT) ? "+discont" : "", buf, GST_BUFFER_BOUNDARIES_ARGS(buf));
}
......@@ -872,7 +877,7 @@ static GstFlowReturn transform(GstBaseTransform *trans, GstBuffer *inbuf, GstBuf
output_length = gst_buffer_get_size(outbuf) / element->unitsize;
if (gst_buffer_get_size(outbuf) == 0)
set_metadata(element, outbuf, 0, FALSE);
set_metadata(element, outbuf, 0, element->last_gap_state);
else {
if (element->width == 32) {
......
......@@ -87,6 +87,7 @@ struct _GSTLALInterpolator {
GstClockTime next_output_timestamp;
gboolean need_discont;
gboolean need_pretend;
gboolean last_gap_state;
/* Variables to control the size of transforms */
gsize unitsize;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment