]> sigrok.org Git - pulseview.git/blobdiff - pv/data/decoderstack.cpp
pv::data::decode::Annotation: Add row() and set_row().
[pulseview.git] / pv / data / decoderstack.cpp
index b8eff67ffd02d0dc5ab018806b056b0c9849cf67..f08e349240571cabf18f64259ca205daaef8bcb1 100644 (file)
@@ -172,10 +172,13 @@ void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
 
        const shared_ptr<pv::data::LogicSnapshot> &snapshot =
                snapshots.front();
-       const int64_t sample_count = snapshot->get_sample_count() - 1;
+       const int64_t sample_count = snapshot->get_sample_count();
        const unsigned int chunk_sample_count =
                DecodeChunkLength / snapshot->unit_size();
 
+       // Clear error message upon every new session run
+       _error_message = QString();
+
        // Create the session
        srd_session_new(&session);
        assert(session);
@@ -187,7 +190,7 @@ void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
 
                if (!di)
                {
-                       _error_message = tr("Failed to initialise decoder");
+                       _error_message = tr("Failed to create decoder instance");
                        srd_session_destroy(session);
                        return;
                }
@@ -220,7 +223,7 @@ void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
 
                if (srd_session_send(session, i, i + sample_count,
                                chunk, chunk_end - i) != SRD_OK) {
-                       _error_message = tr("Failed to initialise decoder");
+                       _error_message = tr("Decoder reported an error");
                        break;
                }