uhd: fix timestamp conversion bug on 32-bit architectures
Type size_t was used in the UHD time_spec_t to integer conversion, which would overflow at roughly 4 and a half hours causing the sample buffer to error on timestamp validity. Builds where size_t takes on 64-bits were not affected by this bug. Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
parent
551dbd3326
commit
de018f7fef
|
@ -58,7 +58,7 @@ uhd::time_spec_t convert_time(TIMESTAMP ticks, double rate)
|
||||||
|
|
||||||
TIMESTAMP convert_time(uhd::time_spec_t ts, double rate)
|
TIMESTAMP convert_time(uhd::time_spec_t ts, double rate)
|
||||||
{
|
{
|
||||||
size_t ticks = ts.get_full_secs() * rate;
|
TIMESTAMP ticks = ts.get_full_secs() * rate;
|
||||||
return ts.get_tick_count(rate) + ticks;
|
return ts.get_tick_count(rate) + ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ uhd::time_spec_t convert_time(TIMESTAMP ticks, double rate)
|
||||||
|
|
||||||
TIMESTAMP convert_time(uhd::time_spec_t ts, double rate)
|
TIMESTAMP convert_time(uhd::time_spec_t ts, double rate)
|
||||||
{
|
{
|
||||||
size_t ticks = ts.get_full_secs() * rate;
|
TIMESTAMP ticks = ts.get_full_secs() * rate;
|
||||||
return ts.get_tick_count(rate) + ticks;
|
return ts.get_tick_count(rate) + ticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue