aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/vrt_packet_handler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/transport/vrt_packet_handler.hpp')
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index 6623957ac..bd76cbb8f 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -146,6 +146,8 @@ namespace vrt_packet_handler{
const handle_overrun_t &handle_overrun,
size_t vrt_header_offset_words32
){
+ metadata.error_code = uhd::rx_metadata_t::ERROR_CODE_NONE;
+
//perform a receive if no rx data is waiting to be copied
if (state.size_of_copy_buffs == 0){
state.fragment_offset_in_samps = 0;
@@ -171,7 +173,6 @@ namespace vrt_packet_handler{
metadata.has_time_spec = false;
metadata.start_of_burst = false;
metadata.end_of_burst = false;
- metadata.error_code = uhd::rx_metadata_t::ERROR_CODE_NONE;
}
//extract the number of samples available to copy
@@ -323,7 +324,8 @@ namespace vrt_packet_handler{
);
//commit the samples to the zero-copy interface
- if (send_buffs[i]->commit(if_packet_info.num_packet_words32*sizeof(boost::uint32_t)) < ssize_t(num_samps)){
+ size_t num_bytes_total = (vrt_header_offset_words32+if_packet_info.num_packet_words32)*sizeof(boost::uint32_t);
+ if (send_buffs[i]->commit(num_bytes_total) < ssize_t(num_bytes_total)){
std::cerr << "commit to send buffer returned less than commit size" << std::endl;
}
}