From 04005863438b3638ed1e996ae59934f59725300a Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Wed, 4 Oct 2017 13:02:50 -0700 Subject: transport: liberio: Fix bug with recv timeout conversion The timeout value passed in by UHD would get multiplied by USEC, to convert from the UHD value in seconds to the liberio value in microseconds. The bug manifested itself by calling liberio_dequeue_buf() with a timeout equivalent to 100s. Fixes ed1c64c81 ('transport: Added liberio_zero_copy transport ...') Signed-off-by: Moritz Fischer Cc: Alex Williams --- host/lib/transport/liberio_zero_copy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host/lib/transport/liberio_zero_copy.cpp b/host/lib/transport/liberio_zero_copy.cpp index ebe509010..fb30f8936 100644 --- a/host/lib/transport/liberio_zero_copy.cpp +++ b/host/lib/transport/liberio_zero_copy.cpp @@ -68,7 +68,7 @@ public: } } - sptr get_new(int timeout, size_t &index) + sptr get_new(double timeout, size_t &index) { _buf = liberio_chan_buf_dequeue(_chan, timeout * USEC); if (!_buf) @@ -99,7 +99,7 @@ public: liberio_chan_buf_enqueue(_chan, _buf); } - sptr get_new(int timeout, size_t &index) + sptr get_new(double timeout, size_t &index) { _buf = liberio_chan_buf_dequeue(_chan, timeout * USEC); if (!_buf) @@ -200,7 +200,7 @@ public: if (_next_recv_buff_index == _num_recv_bufs) _next_recv_buff_index = 0; return _mrb_pool[_next_recv_buff_index]->get_new( - USEC * timeout, _next_recv_buff_index); + timeout, _next_recv_buff_index); } size_t get_num_recv_frames(void) const -- cgit v1.2.3