diff options
author | Tom Rondeau <tom@trondeau.com> | 2016-01-27 06:46:16 -0500 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2016-01-28 09:37:20 -0500 |
commit | cf95377ae162c6145e954d7c29c9814e6465f9fc (patch) | |
tree | f6bfba5dc5109937ab60da97c7663545b81c53ea /gnuradio-runtime/include/gnuradio/buffer.h | |
parent | 4ce1d4991f41173d6e2e6469f6b61e205b7172a5 (diff) |
runtime: addresses issue #713.
When disconnecting and reconnecting, buffers can change and new
buffers will have their item counters zeroed out. Buffers held over
will keep their current item counters at some value >> 0. In the case
of the pfb_arb_resampler of issue #713, the rate update in the
scheduler was getting confusing numbers and setting the rates to
ridiculous values. Also, tags emitted from these new blocks will have
offsets meaningless to the other blocks that held on to their buffers.
This patch tells the scheduler to reset all buffer item counters (read
and write) to 0 when connections are merged and also makes sure all
tags are cleared from each block's input buffers. So upon a
lock/unlock and reset event, all buffers' counters and tag containers
are reset/cleared.
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/buffer.h')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/buffer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gnuradio-runtime/include/gnuradio/buffer.h b/gnuradio-runtime/include/gnuradio/buffer.h index 5da383dc8f..914661b318 100644 --- a/gnuradio-runtime/include/gnuradio/buffer.h +++ b/gnuradio-runtime/include/gnuradio/buffer.h @@ -100,6 +100,8 @@ namespace gr { uint64_t nitems_written() { return d_abs_write_offset; } + void reset_nitem_counter() { d_abs_write_offset = 0; } + size_t get_sizeof_item() { return d_sizeof_item; } /*! @@ -288,6 +290,8 @@ namespace gr { uint64_t nitems_read() { return d_abs_read_offset; } + void reset_nitem_counter() { d_abs_read_offset = 0; } + size_t get_sizeof_item() { return d_buffer->get_sizeof_item(); } /*! |