With the current conditions, when using the 'srzip' output module with
device generating SR_DF_ANALOG packets, they are processed both by
'srzip' and the backup 'analog' module (as 'out' is always null for
srzip which does its own file operation).
For a moderately fast continuous analog capture (e.g. 2.4MSamples/s),
the overhead of the 'analog' module is important (e.g. 80% of the whole
processing of my workstation) while we are not using its output,
so disable it when the user actually selected an output format/file
but the module doesn't generate text output.
Also remove the second part of the condition as 'opt_output_format'
never seems to be null or at least not in the case where the user has
omitted output parameters.
Tested with a device generating analog packets both with '-o test.sr'
and no output option.
g_critical("Failed to initialize output module.");
/* Set up backup analog output module. */
g_critical("Failed to initialize output module.");
/* Set up backup analog output module. */
- oa = sr_output_new(sr_output_find("analog"), NULL, sdi, NULL);
+ if (outfile)
+ oa = sr_output_new(sr_output_find("analog"), NULL,
+ sdi, NULL);
rcvd_samples_logic = rcvd_samples_analog = 0;
rcvd_samples_logic = rcvd_samples_analog = 0;
if (o && !opt_pds) {
if (sr_output_send(o, packet, &out) == SR_OK) {
if (o && !opt_pds) {
if (sr_output_send(o, packet, &out) == SR_OK) {
- if (!out || (out->len == 0
- && !opt_output_format
- && packet->type == SR_DF_ANALOG)) {
/*
* The user didn't specify an output module,
* but needs to see this analog data.
/*
* The user didn't specify an output module,
* but needs to see this analog data.
sr_output_free(o);
o = NULL;
sr_output_free(o);
o = NULL;
+ if (oa)
+ sr_output_free(oa);
oa = NULL;
if (outfile && outfile != stdout)
oa = NULL;
if (outfile && outfile != stdout)