diff options
Diffstat (limited to 'gr-uhd/lib/usrp_source_impl.cc')
-rw-r--r-- | gr-uhd/lib/usrp_source_impl.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc index e174e11334..eeb9521a5a 100644 --- a/gr-uhd/lib/usrp_source_impl.cc +++ b/gr-uhd/lib/usrp_source_impl.cc @@ -348,7 +348,8 @@ namespace gr { { _update_stream_args(stream_args); #ifdef GR_UHD_USE_STREAM_API - _rx_stream.reset(); + if(_rx_stream) + _rx_stream.reset(); #else throw std::runtime_error("not implemented in this version"); #endif @@ -409,7 +410,12 @@ namespace gr { while(true) { #ifdef GR_UHD_USE_STREAM_API const size_t bpi = ::uhd::convert::get_bytes_per_item(_stream_args.cpu_format); - _rx_stream->recv(outputs, nbytes/bpi, _metadata, 0.0); + if(_rx_stream) + // get the remaining samples out of the buffers + _rx_stream->recv(outputs, nbytes/bpi, _metadata, 0.0); + else + // no rx streamer -- nothing to flush + break; #else _dev->get_device()->recv (outputs, nbytes/_type->size, _metadata, *_type, |