discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] How to know that the last sample has arrived


From: Ruben Undheim
Subject: [Discuss-gnuradio] How to know that the last sample has arrived
Date: Fri, 31 Mar 2017 12:06:11 +0200

Hi,

Is there a good way to find out from inside general_work that the last
sample has arrived? (such as from vector_source_X or file_source)

If I consume (ninput_items[0] - 1) samples every time general_work is
called, I will eventually get general_work called with ninput_items[0]
== 1. Would this be a reliable way to do it? Or is there a more
straightforward way which I cannot see?

The goal is to have a block which reliably appends something specific
after the last incoming sample. When I detect that the last sample has
arrived, the following call to forecast will return 0, causing
general_work to be called again even when ninput_items[0] == 0, and I
then return -1 when all the appended samples have been produced. That
seems to work fine, but I am unsure if there is a more straight
forward way.

Best regards

Ruben



reply via email to

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