X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fdata%2Fdecoder.cpp;h=2cfb3a99a9b289f49103718a7169301d66ceb198;hb=52292f6c59053cbaf8c3b2d9a88cca496d2e10b3;hp=2848d16ca4dffd166697b2517193acaec7030592;hpb=e0fc58100fbcd6c3bfd5aecb213d7541a3436622;p=pulseview.git diff --git a/pv/data/decoder.cpp b/pv/data/decoder.cpp index 2848d16c..2cfb3a99 100644 --- a/pv/data/decoder.cpp +++ b/pv/data/decoder.cpp @@ -41,9 +41,11 @@ const int64_t Decoder::DecodeChunkLength = 4096; Decoder::Decoder(const srd_decoder *const dec, std::map > probes) : + boost::shared_ptr > probes, + GHashTable *options) : _decoder(dec), _probes(probes), + _options(options), _decoder_inst(NULL) { init_decoder(); @@ -54,6 +56,8 @@ Decoder::~Decoder() { _decode_thread.interrupt(); _decode_thread.join(); + + g_hash_table_destroy(_options); } const srd_decoder* Decoder::get_decoder() const @@ -111,8 +115,11 @@ void Decoder::init_decoder() } } - _decoder_inst = srd_inst_new(_decoder->id, NULL); - assert(_decoder_inst); + _decoder_inst = srd_inst_new(_decoder->id, _options); + if(!_decoder_inst) { + qDebug() << "Failed to initialise decoder"; + return; + } _decoder_inst->data_samplerate = _samplerate; @@ -185,6 +192,8 @@ void Decoder::annotation_callback(srd_proto_data *pdata, void *decoder) shared_ptr a(new Annotation(pdata)); lock_guard lock(d->_annotations_mutex); d->_annotations.push_back(a); + + d->new_decode_data(); } } // namespace data