From: Gerhard Sittig Date: Fri, 9 Jun 2017 21:07:25 +0000 (+0200) Subject: input/csv: Fixup datafeed chunk size calculation X-Git-Tag: libsigrok-0.5.0~10 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f027208ea7c058d482620af39be38835c045895f;p=libsigrok.git input/csv: Fixup datafeed chunk size calculation The constant at the top of the source file is the number of samples in a datafeed submission chunk. The previous implementation erroneously made it the size in bytes. There is no need to round down the buffer size according to the unit size. --- diff --git a/src/input/csv.c b/src/input/csv.c index a9e5f91f..ad18e322 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -625,7 +625,6 @@ static int initial_parse(const struct sr_input *in, GString *buf) */ inc->sample_unit_size = (inc->num_channels + 7) / 8; inc->datafeed_buf_size = DATAFEED_MAX_SAMPLES; - inc->datafeed_buf_size /= inc->sample_unit_size; inc->datafeed_buf_size *= inc->sample_unit_size; inc->datafeed_buffer = g_malloc(inc->datafeed_buf_size); inc->datafeed_buf_fill = 0;