Commit 8b3d307
Benjamin Moody
_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.1 parent 6bede91 commit 8b3d307
1 file changed
Lines changed: 0 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | 1523 | | |
1532 | 1524 | | |
1533 | 1525 | | |
| |||
1539 | 1531 | | |
1540 | 1532 | | |
1541 | 1533 | | |
1542 | | - | |
1543 | | - | |
1544 | | - | |
1545 | | - | |
1546 | | - | |
1547 | 1534 | | |
1548 | 1535 | | |
1549 | 1536 | | |
1550 | 1537 | | |
1551 | 1538 | | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
1557 | | - | |
1558 | | - | |
1559 | | - | |
1560 | 1539 | | |
1561 | 1540 | | |
1562 | 1541 | | |
| |||
1568 | 1547 | | |
1569 | 1548 | | |
1570 | 1549 | | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | 1550 | | |
1577 | 1551 | | |
1578 | 1552 | | |
| |||
0 commit comments