You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_blocks_to_samples: handle partial blocks in formats 310/311.
In formats 310 and 311, each block of three samples is written as four
bytes. _rd_dat_signals will retrieve the minimum range of bytes (as
determined by _dat_read_params and _required_byte_num) that are needed
in order to decode the desired samples; thus, the data passed to
_blocks_to_samples may include an incomplete block at the end.
The previous implementation of _blocks_to_samples was meant to pad the
input data to a multiple of four bytes. However, this logic was
wrong: added_samps was always set to zero, so the intended extra bytes
were not appended, and (if the lack of extra bytes didn't cause an
error) the wrong number of samples was returned to the caller.
In fact, the subsequent statements for decoding blocks into samples
already worked correctly for an unpadded input array (since each input
slice is correctly truncated to the length of the output slice.) So
remove the padding logic entirely.
0 commit comments