Skip to content
Snippets Groups Projects
Commit 7213b4c4 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

lal_matrixmixer:

- fix inability to handle 0-length buffers
parent 537df9df
No related branches found
No related tags found
No related merge requests found
......@@ -193,12 +193,19 @@ static GstFlowReturn mix(GSTLALMatrixMixer *element, GstBuffer *inbuf, GstBuffer
gsl_matrix_complex_view as_complex_double;
} input_channels, output_channels;
/*
* Number of samples to process.
*/
length = GST_BUFFER_OFFSET_END(inbuf) - GST_BUFFER_OFFSET(inbuf);
if(!length)
return GST_FLOW_OK;
/*
* Wrap the input and output buffers in GSL matrix views, then mix
* input channels into output channels.
*/
length = GST_BUFFER_OFFSET_END(inbuf) - GST_BUFFER_OFFSET(inbuf);
switch(element->data_type) {
case GSTLAL_MATRIXMIXER_FLOAT:
input_channels.as_float = gsl_matrix_float_view_array((float *) GST_BUFFER_DATA(inbuf), length, num_input_channels(element));
......
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