Skip to content
Snippets Groups Projects
Commit ed2d2662 authored by Daichi Tsuna's avatar Daichi Tsuna
Browse files

lal_string_triggergen: move safety check

Set_caps seems to be executed *after* start, so in the previous commit audio_info will not be updated before the safety check and stumbles there. After this fix things seem to be going, and a sane value for chisq is obtained.
parent ff465035
No related branches found
No related tags found
No related merge requests found
......@@ -367,8 +367,14 @@ static gboolean set_caps(GstBaseTransform *trans, GstCaps *incaps, GstCaps *outc
GSTLALStringTriggergen *element = GSTLAL_STRING_TRIGGERGEN(trans);
gboolean success = gst_audio_info_from_caps(&element->audio_info, incaps);
if(success)
if(success) {
if(GST_AUDIO_INFO_CHANNELS(&element->audio_info) != element->num_templates) {
GST_ELEMENT_ERROR(trans, CORE, NEGOTIATION, (NULL), ("number of channels %d is not equal to number of templates %d", GST_AUDIO_INFO_CHANNELS(&element->audio_info), element->num_templates));
success = FALSE;
}
g_object_set(element->adapter, "unit-size", GST_AUDIO_INFO_BPF(&element->audio_info), NULL);
}
/*
* done
......@@ -391,9 +397,6 @@ static gboolean start(GstBaseTransform *trans)
if(!element->bank) {
GST_ELEMENT_ERROR(trans, CORE, NEGOTIATION, (NULL), ("no template bank"));
success = FALSE;
} else if(GST_AUDIO_INFO_CHANNELS(&element->audio_info) != element->num_templates) {
GST_ELEMENT_ERROR(trans, CORE, NEGOTIATION, (NULL), ("number of channels is not equal to number of templates"));
success = FALSE;
} else {
for(i=0; i < element->num_templates; i++) {
/*
......
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