]> sigrok.org Git - sigrok-cli.git/blobdiff - decode.c
decode: start collecting internal state (samplerate)
[sigrok-cli.git] / decode.c
index 225162a45e4cde1238da788ec4e5c8754bd91f93..d27703929fe7d34a7e972627b87a5e0fd7d723e9 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -29,6 +29,8 @@ static GHashTable *pd_meta_visible = NULL;
 static GHashTable *pd_binary_visible = NULL;
 static GHashTable *pd_channel_maps = NULL;
 
+uint64_t pd_samplerate = 0;
+
 extern struct srd_session *srd_sess;
 
 static int opts_to_gvar(struct srd_decoder *dec, GHashTable *hash,
@@ -271,6 +273,11 @@ static void map_pd_inst_channels(void *key, void *value, void *user_data)
 
        g_hash_table_iter_init(&iter, channel_map);
        while (g_hash_table_iter_next(&iter, &channel_id, &channel_target)) {
+               if (!channel_target) {
+                       g_printerr("cli: Channel name for \"%s\" missing.\n",
+                                  (char *)channel_id);
+                       continue;
+               }
                ch = find_channel(channel_list, channel_target);
                if (!ch) {
                        g_printerr("cli: No channel with name \"%s\" found.\n",