X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsession.cpp;h=11a867ab6f410f9e702124c4b82dac6b3e0ce6ef;hb=9009d9b5ca2e2039725040060c0fec19e7bc3caa;hp=605cc05c65fd8ab234f5509d5885f30f276f805d;hpb=558ad6ceb934ab7406d286c1a4ae08da4aba1448;p=pulseview.git diff --git a/pv/session.cpp b/pv/session.cpp index 605cc05..11a867a 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -677,16 +677,16 @@ double Session::get_samplerate() const return samplerate; } -int Session::get_segment_count() const +uint32_t Session::get_segment_count() const { - int min_val = INT_MAX; + uint32_t value = 0; - // Find the lowest common number of segments + // Find the highest number of segments for (shared_ptr data : all_signal_data_) - if (data->get_segment_count() < min_val) - min_val = data->get_segment_count(); + if (data->get_segment_count() > value) + value = data->get_segment_count(); - return (min_val != INT_MAX) ? min_val : 0; + return value; } const unordered_set< shared_ptr > Session::signalbases() const @@ -1109,7 +1109,8 @@ void Session::feed_in_logic(shared_ptr logic) // Create a new data segment cur_logic_segment_ = make_shared( - *logic_data_, logic->unit_size(), cur_samplerate_); + *logic_data_, logic_data_->get_segment_count(), + logic->unit_size(), cur_samplerate_); logic_data_->push_segment(cur_logic_segment_); signal_new_segment(); @@ -1162,7 +1163,7 @@ void Session::feed_in_analog(shared_ptr analog) // Create a segment, keep it in the maps of channels segment = make_shared( - *data, cur_samplerate_); + *data, data->get_segment_count(), cur_samplerate_); cur_analog_segments_[channel] = segment; // Push the segment into the analog data.