output/wav: change default for scale factor from 0.0 to 1.0
The WAV output module supports an optional 'scale' factor, in its absence the samples will pass unmodified. The builtin help text is unexpected, and reads: $ sigrok-cli -O wav --show ... Options: scale: Scale values by factor (default 0.0) Setup a default scale factor of 1.0, which results in identical behaviour and better reflects what is happening.
This commit is contained in:
parent
aa0979482f
commit
23eeac46ed
|
@ -305,7 +305,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
|
||||||
idx = chan_idx[j];
|
idx = chan_idx[j];
|
||||||
buf = outc->chanbuf[idx] + outc->chanbuf_used[idx]++ * 4;
|
buf = outc->chanbuf[idx] + outc->chanbuf_used[idx]++ * 4;
|
||||||
f = data[i * num_channels + j];
|
f = data[i * num_channels + j];
|
||||||
if (outc->scale != 0.0)
|
if (outc->scale != 1.0)
|
||||||
f /= outc->scale;
|
f /= outc->scale;
|
||||||
float_to_le(buf, f);
|
float_to_le(buf, f);
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ static struct sr_option options[] = {
|
||||||
static const struct sr_option *get_options(void)
|
static const struct sr_option *get_options(void)
|
||||||
{
|
{
|
||||||
if (!options[0].def)
|
if (!options[0].def)
|
||||||
options[0].def = g_variant_ref_sink(g_variant_new_double(0.0));
|
options[0].def = g_variant_ref_sink(g_variant_new_double(1.0));
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue