X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fdecoderstack.cpp;h=0bb875da74b68e8a30086e90124d69eea93400b5;hp=912d98c7bc4cda8fc364aaf76e75f9ca23584193;hb=60d9b99a32e551cffd2b537d3e157d578a761c9b;hpb=e45b13b536666034c9b6fe52a9321d749dae3c02 diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 912d98c7..0bb875da 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -107,7 +107,7 @@ void DecoderStack::remove(int index) // Find the decoder in the stack auto iter = stack_.begin(); - for(int i = 0; i < index; i++, iter++) + for (int i = 0; i < index; i++, iter++) assert(iter != stack_.end()); // Delete the element @@ -119,7 +119,7 @@ double DecoderStack::samplerate() const return samplerate_; } -double DecoderStack::start_time() const +const pv::util::Timestamp& DecoderStack::start_time() const { return start_time_; } @@ -286,7 +286,7 @@ uint64_t DecoderStack::max_sample_count() const optional DecoderStack::wait_for_data() const { unique_lock input_lock(input_mutex_); - while(!interrupt_ && !frame_complete_ && + while (!interrupt_ && !frame_complete_ && samples_decoded_ >= sample_count_) input_cond_.wait(input_lock); return boost::make_optional(!interrupt_ && @@ -312,8 +312,8 @@ void DecoderStack::decode_data( i + chunk_sample_count, sample_count); segment_->get_samples(chunk, i, chunk_end); - if (srd_session_send(session, i, i + sample_count, chunk, - (chunk_end - i) * unit_size) != SRD_OK) { + if (srd_session_send(session, i, chunk_end, chunk, + (chunk_end - i) * unit_size, unit_size) != SRD_OK) { error_message_ = tr("Decoder reported an error"); break; } @@ -334,7 +334,7 @@ void DecoderStack::decode_proc() { optional sample_count; srd_session *session; - srd_decoder_inst *prev_di = NULL; + srd_decoder_inst *prev_di = nullptr; assert(segment_); @@ -347,7 +347,7 @@ void DecoderStack::decode_proc() for (const shared_ptr &dec : stack_) { - srd_decoder_inst *const di = dec->create_decoder_inst(session, unit_size); + srd_decoder_inst *const di = dec->create_decoder_inst(session); if (!di) { @@ -379,7 +379,7 @@ void DecoderStack::decode_proc() do { decode_data(*sample_count, unit_size, session); - } while(error_message_.isEmpty() && (sample_count = wait_for_data())); + } while (error_message_.isEmpty() && (sample_count = wait_for_data())); // Destroy the session srd_session_destroy(session);