X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Finput%2Fcsv.c;h=ed2b49409b43d9b25c611ce47090c435d90cb5a2;hb=73f052d329574e6fa9fc8bebcc7682b120da5bab;hp=063145a07b4e0284483364414a28273aa37fe6e5;hpb=6ec6c43b4738dbc7091f4a49a4ec80ea6102cb52;p=libsigrok.git diff --git a/src/input/csv.c b/src/input/csv.c index 063145a0..ed2b4940 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -133,17 +133,6 @@ struct context { size_t line_number; }; -static int format_match(GHashTable *metadata) -{ - char *buf; - - buf = g_hash_table_lookup(metadata, GINT_TO_POINTER(SR_INPUT_META_MIMETYPE)); - if (!strcmp(buf, "text/csv")) - return SR_OK; - - return SR_ERR; -} - static void strip_comment(char *buf, const GString *prefix) { char *ptr; @@ -632,6 +621,7 @@ static int process_buffer(struct sr_input *in) src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(samplerate)); meta.config = g_slist_append(NULL, src); sr_session_send(in->sdi, &packet); + g_slist_free(meta.config); sr_config_free(src); } @@ -795,7 +785,7 @@ static struct sr_option options[] = { ALL_ZERO }; -static struct sr_option *get_options(void) +static const struct sr_option *get_options(void) { if (!options[0].def) { options[0].def = g_variant_ref_sink(g_variant_new_int32(0)); @@ -817,9 +807,7 @@ SR_PRIV struct sr_input_module input_csv = { .name = "CSV", .desc = "Comma-separated values", .exts = (const char*[]){"csv", NULL}, - .metadata = { SR_INPUT_META_MIMETYPE }, .options = get_options, - .format_match = format_match, .init = init, .receive = receive, .end = end,