summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-digital/include/gnuradio/digital/header_payload_demux.h3
-rw-r--r--gr-digital/lib/header_payload_demux_impl.cc5
2 files changed, 6 insertions, 2 deletions
diff --git a/gr-digital/include/gnuradio/digital/header_payload_demux.h b/gr-digital/include/gnuradio/digital/header_payload_demux.h
index 4fd3f8c2f2..d68c4ab9f3 100644
--- a/gr-digital/include/gnuradio/digital/header_payload_demux.h
+++ b/gr-digital/include/gnuradio/digital/header_payload_demux.h
@@ -58,6 +58,9 @@ namespace gr {
* should go on the payload.
* A special case are tags on items that make up the guard interval. These are copied
* to the first item of the following symbol.
+ * If a tag is situated very close to the end of the payload, it might be unclear if
+ * it belongs to this packet or the following. In this case, the tag might be propagated
+ * twice.
*
* Tags outside of packets are generally discarded. If this information is important,
* there are two additional mechanisms to preserve the tags:
diff --git a/gr-digital/lib/header_payload_demux_impl.cc b/gr-digital/lib/header_payload_demux_impl.cc
index 406d59e246..15308c0be1 100644
--- a/gr-digital/lib/header_payload_demux_impl.cc
+++ b/gr-digital/lib/header_payload_demux_impl.cc
@@ -266,10 +266,11 @@ namespace gr {
case STATE_PAYLOAD:
if (check_items_available(d_curr_payload_len, ninput_items, noutput_items, nread)) {
- update_special_tags(0, d_curr_payload_len * (d_items_per_symbol + d_gi));
+ // The -1 because we won't consume the last item, it might hold the next trigger.
+ update_special_tags(0, (d_curr_payload_len - 1) * (d_items_per_symbol + d_gi));
copy_n_symbols(in, out_payload, PORT_PAYLOAD, d_curr_payload_len);
produce(PORT_PAYLOAD, d_curr_payload_len * (d_output_symbols ? 1 : d_items_per_symbol));
- consume_each (d_curr_payload_len * (d_items_per_symbol + d_gi));
+ consume_each ((d_curr_payload_len - 1) * (d_items_per_symbol + d_gi)); // Same here
set_min_noutput_items(d_output_symbols ? 1 : (d_items_per_symbol + d_gi));
d_state = STATE_FIND_TRIGGER;
}