From 17b788efc7262ebae17d3ab4c46c723c45cba884 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Tue, 14 Aug 2012 09:27:34 -0700 Subject: [PATCH] Possible fix for the hang bug -- preamble could under certain circumstances consume -1, which makes Gnuradio think we're done. --- lib/air_modes_preamble.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/air_modes_preamble.cc b/lib/air_modes_preamble.cc index 8046d78..6bcf2e6 100644 --- a/lib/air_modes_preamble.cc +++ b/lib/air_modes_preamble.cc @@ -157,7 +157,7 @@ int air_modes_preamble::general_work(int noutput_items, //be sure we've got enough room in the input buffer to copy out a whole packet if(ninputs-i < 240*d_samples_per_chip) { - consume_each(i-1); + consume_each(std::max(i-1,0)); return 0; }