X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=f08e349240571cabf18f64259ca205daaef8bcb1;hp=b8eff67ffd02d0dc5ab018806b056b0c9849cf67;hb=3f53457656c72dc870f603677843613b708b4ea1;hpb=064a7f42c7a107eae88c946718fe4141b52f8e0c diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index b8eff67f..f08e3492 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -172,10 +172,13 @@ void DecoderStack::decode_proc(shared_ptr data) const shared_ptr &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) 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) 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; }