X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=9a13769ccf2a32ffbec850b88cf1225b5718a7bc;hb=77243b3e8c8a8b3c7742d4d4064ea236d1d81496;hp=c197e019fd16c6b1e1d5d35ff2aa02d62b9e2bfa;hpb=df4c1a0691f6d3a457a475e496186d5a9decc54a;p=pulseview.git diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index c197e01..9a13769 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -58,6 +58,7 @@ namespace data { const double DecoderStack::DecodeMargin = 1.0; const double DecoderStack::DecodeThreshold = 0.2; const int64_t DecoderStack::DecodeChunkLength = 4096; +const unsigned int DecoderStack::DecodeNotifyPeriod = 65536; mutex DecoderStack::_global_decode_mutex; @@ -314,6 +315,9 @@ void DecoderStack::decode_data( lock_guard lock(_output_mutex); _samples_decoded = chunk_end; } + + if (i % DecodeNotifyPeriod == 0) + new_decode_data(); } new_decode_data(); @@ -325,7 +329,6 @@ void DecoderStack::decode_proc() srd_session *session; srd_decoder_inst *prev_di = NULL; - assert(data); assert(_snapshot); // Create the session @@ -427,7 +430,8 @@ void DecoderStack::on_data_received() { { unique_lock lock(_input_mutex); - _sample_count = _snapshot->get_sample_count(); + if (_snapshot) + _sample_count = _snapshot->get_sample_count(); } _input_cond.notify_one(); } @@ -436,7 +440,8 @@ void DecoderStack::on_frame_ended() { { unique_lock lock(_input_mutex); - _frame_complete = true; + if (_snapshot) + _frame_complete = true; } _input_cond.notify_one(); }