]> sigrok.org Git - libsigrok.git/blobdiff - output/vcd.c
input/output modules: Adjust to GVariant-based sr_config_* functions
[libsigrok.git] / output / vcd.c
index b60890ae63627bcafe38a1fb3b3826641f6f84a7..829fcde7722e5d05b2b91a8d4590c72237d91ab4 100644 (file)
@@ -53,7 +53,7 @@ static int init(struct sr_output *o)
        struct context *ctx;
        struct sr_probe *probe;
        GSList *l;
-       uint64_t *samplerate;
+       GVariant *gvar;
        int num_probes, i;
        char *samplerate_s, *frequency_s, *timestamp;
        time_t t;
@@ -93,17 +93,18 @@ static int init(struct sr_output *o)
                        PACKAGE, PACKAGE_VERSION);
 
        if (o->sdi->driver && sr_dev_has_option(o->sdi, SR_CONF_SAMPLERATE)) {
-               o->sdi->driver->config_get(SR_CONF_SAMPLERATE,
-                               (const void **)&samplerate, o->sdi);
-               ctx->samplerate = *samplerate;
+               o->sdi->driver->config_get(SR_CONF_SAMPLERATE, &gvar, o->sdi);
+               ctx->samplerate = g_variant_get_uint64(gvar);
                if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
                        g_string_free(ctx->header, TRUE);
                        g_free(ctx);
+                       g_variant_unref(gvar);
                        return SR_ERR;
                }
                g_string_append_printf(ctx->header, vcd_header_comment,
                                 ctx->num_enabled_probes, num_probes, samplerate_s);
                g_free(samplerate_s);
+               g_variant_unref(gvar);
        }
 
        /* timescale */