X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecodesignal.cpp;h=4739b60675ab3e97ee9496ebc1a1d642ccf12bca;hp=8483d91d0ce4a2b41de67a07605d2a757d761137;hb=e06cf18db72c518d11f90e9f96dfc3aeed85314f;hpb=808d1a7e63b957cf0b873294e53d7fd76b5e41b9 diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index 8483d91..4739b60 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -902,6 +902,13 @@ void DecodeSignal::decode_data( const int64_t chunk_end = min(i + chunk_sample_count, abs_start_samplenum + sample_count); + // Report this chunk as already decoded so that annotations don't + // appear in an area that we claim to not having been been decoded yet + { + lock_guard lock(output_mutex_); + segments_.at(current_segment_id_).samples_decoded = chunk_end; + } + int64_t data_size = (chunk_end - i) * unit_size; uint8_t* chunk = new uint8_t[data_size]; input_segment->get_samples(i, chunk_end, chunk); @@ -915,11 +922,6 @@ void DecodeSignal::decode_data( delete[] chunk; - { - lock_guard lock(output_mutex_); - segments_.at(current_segment_id_).samples_decoded = chunk_end; - } - // Notify the frontend that we processed some data and // possibly have new annotations as well new_annotations();