X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gr-usrp2%2Fsrc%2Fusrp2_sink_16sc.cc;fp=gr-usrp2%2Fsrc%2Fusrp2_sink_16sc.cc;h=1e7c54dcdb16d8c0cb62f0281c39af9303b0c3bf;hb=8a9ddbb0675f9bfcc6e03b457fba6c79474a3693;hp=96e6b174c7aa2c9468a6d4b0a41aaa81ba5caa33;hpb=82d471b9b4a8b389b5da44b19c69c36420828382;p=debian%2Fgnuradio diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc index 96e6b174..1e7c54dc 100644 --- a/gr-usrp2/src/usrp2_sink_16sc.cc +++ b/gr-usrp2/src/usrp2_sink_16sc.cc @@ -29,6 +29,9 @@ #include #include +// FIXME hack until VRT replaces libusrp2 +#define U2_MIN_SAMPLES 9 + usrp2_sink_16sc_sptr usrp2_make_sink_16sc(const std::string &ifc, const std::string &mac_addr) throw (std::runtime_error) @@ -57,6 +60,12 @@ usrp2_sink_16sc::work(int noutput_items, { std::complex *in = (std::complex *)input_items[0]; + // FIXME: Current libusrp2 can't handle short packets. + // Returning 0 assumes there will be more samples + // the next round... + if (noutput_items < U2_MIN_SAMPLES) + return 0; + usrp2::tx_metadata metadata; metadata.timestamp = -1; metadata.send_now = 1;