]> sigrok.org Git - libsigrok.git/commitdiff
output/wav: Drop support for SR_DF_ANALOG_OLD.
authorUwe Hermann <redacted>
Sat, 14 May 2016 14:24:23 +0000 (16:24 +0200)
committerUwe Hermann <redacted>
Fri, 17 Jun 2016 13:13:12 +0000 (15:13 +0200)
src/output/wav.c

index f991cbfdc68526d9fea8754ad200565b712076a9..b266b203275fec65e9e4bf3f4215aba981ba2022 100644 (file)
@@ -237,7 +237,6 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
 {
        struct out_context *outc;
        const struct sr_datafeed_meta *meta;
-       const struct sr_datafeed_analog_old *analog_old;
        const struct sr_datafeed_analog *analog;
        const struct sr_config *src;
        struct sr_channel *ch;
@@ -262,7 +261,6 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
                        outc->samplerate = g_variant_get_uint64(src->data);
                }
                break;
-       case SR_DF_ANALOG_OLD:
        case SR_DF_ANALOG:
                if (!outc->header_done) {
                        *out = gen_header(o);
@@ -270,25 +268,16 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
                } else
                        *out = g_string_sized_new(512);
 
-               analog_old = packet->payload;
                analog = packet->payload;
-
-               if (packet->type == SR_DF_ANALOG_OLD) {
-                       num_samples = analog_old->num_samples;
-                       channels = analog_old->channels;
-                       num_channels = g_slist_length(analog_old->channels);
-                       data = analog_old->data;
-               } else {
-                       num_samples = analog->num_samples;
-                       channels = analog->meaning->channels;
-                       num_channels = g_slist_length(analog->meaning->channels);
-                       if (!(data = g_try_realloc(outc->fdata, sizeof(float) * num_samples * num_channels)))
-                               return SR_ERR_MALLOC;
-                       outc->fdata = data;
-                       ret = sr_analog_to_float(analog, data);
-                       if (ret != SR_OK)
-                               return ret;
-               }
+               num_samples = analog->num_samples;
+               channels = analog->meaning->channels;
+               num_channels = g_slist_length(analog->meaning->channels);
+               if (!(data = g_try_realloc(outc->fdata, sizeof(float) * num_samples * num_channels)))
+                       return SR_ERR_MALLOC;
+               outc->fdata = data;
+               ret = sr_analog_to_float(analog, data);
+               if (ret != SR_OK)
+                       return ret;
 
                if (num_samples == 0)
                        return SR_OK;
@@ -300,7 +289,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
                }
 
                if (num_samples > outc->chanbuf_size) {
-                       if (realloc_chanbufs(o, analog_old->num_samples) != SR_OK)
+                       if (realloc_chanbufs(o, analog->num_samples) != SR_OK)
                                return SR_ERR_MALLOC;
                }