projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
decode: Clear error message upon every new session run.
[pulseview.git]
/
pv
/
data
/
decoderstack.cpp
diff --git
a/pv/data/decoderstack.cpp
b/pv/data/decoderstack.cpp
index 5b58761f9c1c3464121299c3c6259a907015a10a..9d80e9b300e26782cc7873d8876ceb6f1372e892 100644
(file)
--- a/
pv/data/decoderstack.cpp
+++ b/
pv/data/decoderstack.cpp
@@
-172,13
+172,17
@@
void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
const shared_ptr<pv::data::LogicSnapshot> &snapshot =
snapshots.front();
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);
// Create the session
srd_session_new(&session);
assert(session);
-
// Create the decoders
BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
{
// Create the decoders
BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
{
@@
-209,12
+213,12
@@
void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
for (int64_t i = 0;
!boost::this_thread::interruption_requested() &&
i < sample_count;
for (int64_t i = 0;
!boost::this_thread::interruption_requested() &&
i < sample_count;
- i +=
DecodeChunkLength
)
+ i +=
chunk_sample_count
)
{
lock_guard<mutex> decode_lock(_global_decode_mutex);
const int64_t chunk_end = min(
{
lock_guard<mutex> decode_lock(_global_decode_mutex);
const int64_t chunk_end = min(
- i +
DecodeChunkLength
, sample_count);
+ i +
chunk_sample_count
, sample_count);
snapshot->get_samples(chunk, i, chunk_end);
if (srd_session_send(session, i, i + sample_count,
snapshot->get_samples(chunk, i, chunk_end);
if (srd_session_send(session, i, i + sample_count,