Is there a good method for clearing or resetting a block’s buffers?
I have a program that tunes to different frequencies and is also started & paused. I want to clear out any of the existing samples in the buffers between blocks to make sure I am getting the current signal in and not something that was left over.
I have tried the following approach but it sometimes leads to segfaults with some blocks. Can this be done? Is there a better way to do this or achieve the same results?
| gr::block_detail_sptr detail; |
| gr::block_sptr grblock = cast_to_block_sptr(block); |
| detail = grblock->detail(); |
| detail->reset_nitem_counters(); |