From f00fc2a9e1cc85888a732de9f981f50ce957e5f1 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Wed, 30 Oct 2013 23:15:46 +0100 Subject: [PATCH] Adjust to libsigrokdecode API changes --- pv/data/decoder.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pv/data/decoder.cpp b/pv/data/decoder.cpp index 133fcd19..9e7145f3 100644 --- a/pv/data/decoder.cpp +++ b/pv/data/decoder.cpp @@ -149,11 +149,7 @@ void Decoder::decode_proc(shared_ptr data) srd_session_new(&session); assert(session); - srd_session_config_set(session, SRD_CONF_NUM_PROBES, - g_variant_new_uint64(_probes.size())); - srd_session_config_set(session, SRD_CONF_UNITSIZE, - g_variant_new_uint64(snapshot->unit_size())); - srd_session_config_set(session, SRD_CONF_SAMPLERATE, + srd_session_metadata_set(session, SRD_CONF_SAMPLERATE, g_variant_new_uint64((uint64_t)_samplerate)); srd_pd_output_callback_add(session, SRD_OUTPUT_ANN, @@ -167,8 +163,6 @@ void Decoder::decode_proc(shared_ptr data) return; } - decoder_inst->data_samplerate = _samplerate; - // Setup the probes GHashTable *const probes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_variant_unref); @@ -199,8 +193,8 @@ void Decoder::decode_proc(shared_ptr data) i + DecodeChunkLength, sample_count); snapshot->get_samples(chunk, i, chunk_end); - if (srd_session_send(session, i, chunk, chunk_end - i) != - SRD_OK) { + if (srd_session_send(session, i, i + sample_count, + chunk, chunk_end - i) != SRD_OK) { _error_message = tr("Failed to initialise decoder"); break; } -- 2.30.2