- if (sr_output_send(o, packet, &out) == SR_OK && out) {
- fwrite(out->str, 1, out->len, outfile);
- fflush(outfile);
- g_string_free(out, TRUE);
+ if (sr_output_send(o, packet, &out) == SR_OK) {
+ if (!out || (out->len == 0 && default_output_format
+ && packet->type == SR_DF_ANALOG)) {
+ /* The user didn't specify an output module,
+ * but needs to see this analog data. */
+ sr_output_send(oa, packet, &out);
+ }
+ if (out && out->len > 0) {
+ fwrite(out->str, 1, out->len, outfile);
+ fflush(outfile);
+ }
+ if (out)
+ g_string_free(out, TRUE);