Unconditionally generate output text when a session packet is received
which carries analog or logic sample data. Even if the data gets queued
and is not shown immediately, in that case the output text remains empty
but needs to be present. Otherwise applications may assume that the CSV
output module had not handled the data at all, which would result in
unexpected "screen output" with fallback data being interleaved with the
CSV output.
This resolves bug #1026 in its strictest sense (the unexpected presence
of fallback data). But leaves all other issues mentioned in comment 1.
} else {
sr_info("Dumping %u samples", ctx->num_samples);
- *out = g_string_sized_new(512);
+ if (!*out)
+ *out = g_string_sized_new(512);
num_channels =
ctx->num_logic_channels + ctx->num_analog_channels;
ctx->trigger = TRUE;
break;
case SR_DF_LOGIC:
+ *out = g_string_sized_new(512);
logic = packet->payload;
ctx->pkt_snums = logic->length;
ctx->pkt_snums /= logic->length;
process_logic(ctx, logic);
break;
case SR_DF_ANALOG:
+ *out = g_string_sized_new(512);
analog = packet->payload;
ctx->pkt_snums = analog->num_samples;
ctx->pkt_snums /= g_slist_length(analog->meaning->channels);