- shared_ptr<pv::data::DecoderStack> decoder_stack = base_->decoder_stack();
-
- assert(decoder_stack);
-
- shared_ptr<Logic> data;
- shared_ptr<data::SignalBase> signalbase;
-
- const list< shared_ptr<Decoder> > &stack = decoder_stack->stack();
-
- // We get the logic data of the first channel in the list.
- // This works because we are currently assuming all
- // LogicSignals have the same data/segment
- for (const shared_ptr<Decoder> &dec : stack)
- if (dec && !dec->channels().empty() &&
- ((signalbase = (*dec->channels().begin()).second)) &&
- ((data = signalbase->logic_data())))
- break;
-
- if (!data || data->logic_segments().empty())
- return;
-
- const shared_ptr<LogicSegment> segment = data->logic_segments().front();
- assert(segment);
- const int64_t sample_count = (int64_t)segment->get_sample_count();