aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/include/uhdlib/transport/rx_streamer_impl.hpp5
-rw-r--r--host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp28
-rw-r--r--host/lib/transport/super_recv_packet_handler.hpp6
3 files changed, 15 insertions, 24 deletions
diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
index f664eb68f..ce66d2ccb 100644
--- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
+++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
@@ -136,11 +136,6 @@ public:
return 0;
}
- if (nsamps_per_buff == 0) {
- metadata.reset();
- return 0;
- }
-
const int32_t timeout_ms = static_cast<int32_t>(timeout * 1000);
detail::eov_data_wrapper eov_positions(metadata);
diff --git a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
index ca2eb3506..f30e3c843 100644
--- a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
+++ b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
@@ -213,21 +213,23 @@ public:
auto result = _get_aligned_buffs(0);
if (result == get_aligned_buffs_t::TIMEOUT) {
- if (_stopped_due_to_overrun) {
- // An overrun occurred and the user has read all the packets
- // that were buffered prior to the overrun. Call the overrun
- // handler and return overrun error.
- _handle_overrun();
- std::tie(metadata.has_time_spec, metadata.time_spec) =
- _last_read_time_info.get_next_packet_time(_samp_rate);
- metadata.error_code = rx_metadata_t::ERROR_CODE_OVERFLOW;
- _stopped_due_to_overrun = false;
- return 0;
- } else {
+ if (!_stopped_due_to_overrun) {
// Packets were not available with zero timeout, wait for them
// to arrive using the specified timeout.
- result = _get_aligned_buffs(timeout_ms);
- if (_stopped_due_to_late_cmd) {
+ result = _get_aligned_buffs(std::max(1,timeout_ms));
+ }
+ if (result == get_aligned_buffs_t::TIMEOUT) {
+ if (_stopped_due_to_overrun) {
+ // An overrun occurred and the user has read all the packets
+ // that were buffered prior to the overrun. Call the overrun
+ // handler and return overrun error.
+ _handle_overrun();
+ std::tie(metadata.has_time_spec, metadata.time_spec) =
+ _last_read_time_info.get_next_packet_time(_samp_rate);
+ metadata.error_code = rx_metadata_t::ERROR_CODE_OVERFLOW;
+ _stopped_due_to_overrun = false;
+ return 0;
+ } else if (_stopped_due_to_late_cmd) {
metadata.has_time_spec = false;
metadata.error_code = rx_metadata_t::ERROR_CODE_LATE_COMMAND;
_stopped_due_to_late_cmd = false;
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp
index c6947ba26..f428f01f1 100644
--- a/host/lib/transport/super_recv_packet_handler.hpp
+++ b/host/lib/transport/super_recv_packet_handler.hpp
@@ -238,12 +238,6 @@ public:
return 0;
}
- // Just return if no samples requested
- if (nsamps_per_buff == 0) {
- metadata.reset();
- return 0;
- }
-
size_t accum_num_samps =
recv_one_packet(buffs, nsamps_per_buff, metadata, timeout);