]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoder.cpp
Print an error message, rather than asserting if the srd_inst_new fails
[pulseview.git] / pv / data / decoder.cpp
index 787d1600bb89f5695c44c90625c06aed44a5cf0a..2cfb3a99a9b289f49103718a7169301d66ceb198 100644 (file)
@@ -116,7 +116,10 @@ void Decoder::init_decoder()
        }
 
        _decoder_inst = srd_inst_new(_decoder->id, _options);
-       assert(_decoder_inst);
+       if(!_decoder_inst) {
+               qDebug() << "Failed to initialise decoder";
+               return;
+       }
 
        _decoder_inst->data_samplerate = _samplerate;
 
@@ -189,6 +192,8 @@ void Decoder::annotation_callback(srd_proto_data *pdata, void *decoder)
        shared_ptr<Annotation> a(new Annotation(pdata));
        lock_guard<mutex> lock(d->_annotations_mutex);
        d->_annotations.push_back(a);
+
+       d->new_decode_data();
 }
 
 } // namespace data