From 512bd5d2b082807c6687a546d5fe096c9c9b7af6 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Mon, 25 Apr 2016 14:33:17 +0200 Subject: [PATCH] gr-blocks: fix tag propagation policy for stream mux block --- gr-blocks/lib/stream_mux_impl.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gr-blocks/lib/stream_mux_impl.cc b/gr-blocks/lib/stream_mux_impl.cc index 698cf89..4d5e71b 100644 --- a/gr-blocks/lib/stream_mux_impl.cc +++ b/gr-blocks/lib/stream_mux_impl.cc @@ -53,6 +53,7 @@ namespace gr { } } d_residual = d_lengths[d_stream]; + set_tag_propagation_policy(TPP_DONT); } void @@ -76,6 +77,7 @@ namespace gr { const char *in; int out_index = 0; // Items written gr_vector_int input_index(d_lengths.size(), 0); // Items read + std::vector stream_t; while (out_index < noutput_items) { if (ninput_items[d_stream] <= input_index[d_stream]) { @@ -91,6 +93,12 @@ namespace gr { ); in = (const char *) input_items[d_stream] + input_index[d_stream]*d_itemsize; memcpy(&out[out_index*d_itemsize], in, items_to_copy*d_itemsize); + get_tags_in_window(stream_t, d_stream,input_index[d_stream],input_index[d_stream] + items_to_copy); + BOOST_FOREACH(gr::tag_t t, stream_t){ + t.offset = t.offset - nitems_read(d_stream) - input_index[d_stream] + nitems_written(0) + out_index; + add_item_tag(0, t); + } + out_index += items_to_copy; input_index[d_stream] += items_to_copy; d_residual -= items_to_copy; -- 2.7.3