X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=input%2Fbinary.c;fp=input%2Fbinary.c;h=3d4418ca41044077a771afc3898e8940210d22cb;hb=2df1e81970b38bd4edb6e219ad295c8a83315797;hp=6e11cde0844eb5e0562657eafaf9f7511a0e921e;hpb=d8e3685c47088c3219c004885d1be3c34c6503a6;p=libsigrok.git diff --git a/input/binary.c b/input/binary.c index 6e11cde0..3d4418ca 100644 --- a/input/binary.c +++ b/input/binary.c @@ -100,8 +100,9 @@ static int loadfile(struct sr_input *in, const char *filename) { struct sr_datafeed_header header; struct sr_datafeed_packet packet; - struct sr_datafeed_meta_logic meta; + struct sr_datafeed_meta meta; struct sr_datafeed_logic logic; + struct sr_config *src; unsigned char buffer[CHUNKSIZE]; int fd, size, num_probes; struct context *ctx; @@ -120,12 +121,13 @@ static int loadfile(struct sr_input *in, const char *filename) packet.payload = &header; sr_session_send(in->sdi, &packet); - /* Send metadata about the SR_DF_LOGIC packets to come. */ - packet.type = SR_DF_META_LOGIC; - packet.payload = &meta; - meta.samplerate = ctx->samplerate; - meta.num_probes = num_probes; - sr_session_send(in->sdi, &packet); + if (ctx->samplerate) { + packet.type = SR_DF_META; + packet.payload = &meta; + src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&ctx->samplerate); + meta.config = g_slist_append(NULL, src); + sr_session_send(in->sdi, &packet); + } /* Chop up the input file into chunks & send it to the session bus. */ packet.type = SR_DF_LOGIC;