discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Clearing a Blocks Buffers


From: Luke Berndt
Subject: Clearing a Blocks Buffers
Date: Wed, 31 May 2023 09:56:43 -0400

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();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]