summaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-12 18:15:38 +0000
committerJosh Blum <josh@joshknows.com>2010-07-12 18:15:38 +0000
commit9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e (patch)
tree37188194053ca00dc69349e607cf77831939ab6e /host/lib/transport
parent3a3aefd68f054e3fccff31173be2a878841b29aa (diff)
parent8a81fe1a4cd39439d76d17ef65ba1cc696c3ca6d (diff)
downloaduhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.tar.gz
uhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.tar.bz2
uhd-9ee1b33bbc170b2e76fbb5b9a075d6b6c7315a7e.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index c5c63b089..6623957ac 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -146,9 +146,6 @@ namespace vrt_packet_handler{
const handle_overrun_t &handle_overrun,
size_t vrt_header_offset_words32
){
- metadata.has_time_spec = false; //false unless set in the helper
- 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;
@@ -169,11 +166,18 @@ namespace vrt_packet_handler{
return 0;
}
}
+ //defaults for the metadata when this is a fragment
+ else{
+ 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
size_t bytes_per_item = otw_type.get_sample_size();
- size_t bytes_available = state.size_of_copy_buffs;
- size_t nsamps_to_copy = std::min(total_samps, bytes_available/bytes_per_item);
+ size_t nsamps_available = state.size_of_copy_buffs/bytes_per_item;
+ size_t nsamps_to_copy = std::min(total_samps, nsamps_available);
size_t bytes_to_copy = nsamps_to_copy*bytes_per_item;
for (size_t i = 0; i < state.width; i++){