+ pd_name = g_strdup(g_hash_table_lookup(pd_opthash, "sigrok_key"));
+ g_hash_table_remove(pd_opthash, "sigrok_key");
+ if (srd_decoder_load(pd_name) != SRD_OK) {
+ fprintf(stderr, "Failed to load protocol decoder %s\n", pd_name);
+ goto err_out;
+ }
+ if (!(di = srd_inst_new(pd_name, pd_opthash))) {
+ fprintf(stderr, "Failed to instantiate protocol decoder %s\n", pd_name);
+ goto err_out;
+ }
+ g_datalist_set_data(&pd_ann_visible, di->inst_id, pd_name);
+
+ /* Any keys left in the options hash are probes, where the key
+ * is the probe name as specified in the decoder class, and the
+ * value is the probe number i.e. the order in which the PD's
+ * incoming samples are arranged. */
+ if (srd_inst_probes_set(di, pd_opthash) != SRD_OK)
+ goto err_out;
+ g_hash_table_destroy(pd_opthash);
+ pd_opthash = NULL;