Skip to content
Snippets Groups Projects
Commit 637caf5f authored by Chad Hanna's avatar Chad Hanna
Browse files

gstlal_itacac.c: fix bug where you try to flush more samples than we have from...

gstlal_itacac.c: fix bug where you try to flush more samples than we have from an adapter in a corner case
parent 65c2ccb4
No related branches found
No related tags found
No related merge requests found
Pipeline #64191 passed
......@@ -1656,7 +1656,7 @@ static GstFlowReturn aggregate(GstAggregator *aggregator, gboolean timeout)
guint num_samples_behind = (guint) ((itacac->next_output_timestamp - itacacpad->initial_timestamp) / (1000000000 / itacacpad->rate));
//fprintf(stderr, "itacac->next_output_timestamp = %lu, itacacpad->initial_timestamp = %lu, %u num_samples_behind, gapsamps = %u, available_samps = %u, %s\n", (guint64) itacac->next_output_timestamp, (guint64) itacacpad->initial_timestamp, num_samples_behind, gst_audioadapter_head_gap_length(itacacpad->adapter), gst_audioadapter_available_samples(itacacpad->adapter), itacacpad->instrument);
if(num_samples_behind > itacacpad->maxdata->pad) {
gst_audioadapter_flush_samples(itacacpad->adapter, num_samples_behind - itacacpad->maxdata->pad);
gst_audioadapter_flush_samples(itacacpad->adapter, MIN(num_samples_behind - itacacpad->maxdata->pad, gst_audioadapter_available_samples(itacacpad->adapter)));
} else if(num_samples_behind < itacacpad->maxdata->pad)
itacacpad->adjust_window = num_samples_behind;
......
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