decoderstack: Fix incorrect end sample number.
[pulseview.git] / pv / data / decoderstack.cpp
index e9876d21bc268299eeab4c1fd9d835a237001fd7..201c87f7fc668596fe49c0b30ffccc4a2b49ec77 100644 (file)
@@ -272,7 +272,7 @@ void DecoderStack::begin_decode()
        decode_thread_ = std::thread(&DecoderStack::decode_proc, this);
 }
 
-uint64_t DecoderStack::get_max_sample_count() const
+uint64_t DecoderStack::max_sample_count() const
 {
        uint64_t max_sample_count = 0;
 
@@ -312,7 +312,7 @@ 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,
+               if (srd_session_send(session, i, chunk_end, chunk,
                                (chunk_end - i) * unit_size) != SRD_OK) {
                        error_message_ = tr("Decoder reported an error");
                        break;
@@ -334,7 +334,7 @@ void DecoderStack::decode_proc()
 {
        optional<int64_t> sample_count;
        srd_session *session;
-       srd_decoder_inst *prev_di = NULL;
+       srd_decoder_inst *prev_di = nullptr;
 
        assert(segment_);