From c5f473341f9198532c44525104d04792c1bd6459 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 17 Apr 2018 22:23:23 +0200 Subject: [PATCH] Fix #1162 by always submitting all changed options to libsrd --- pv/data/decode/decoder.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index c6995bcf..6ce60da8 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -91,8 +91,12 @@ void Decoder::set_option(const char *id, GVariant *value) GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref); - g_variant_ref(value); - g_hash_table_insert(opt_hash, (void*)g_strdup(id), value); + for (const auto& option : options_) { + GVariant *const value = option.second; + g_variant_ref(value); + g_hash_table_replace(opt_hash, (void*)g_strdup( + option.first.c_str()), value); + } srd_inst_option_set(decoder_inst_, opt_hash); g_hash_table_destroy(opt_hash); -- 2.30.2