Skip to content

Commit

Permalink
faw処理時に音声がブツブツ切れる場合があったのを修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed Jun 23, 2023
1 parent b6d1c17 commit 5a904c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion VCECore/rgy_faw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ void faw_read(uint8_t *dst, const uint8_t *src, const size_t outlen) {
static uint32_t faw_checksum_calc(const uint8_t *buf, const size_t len) {
uint32_t _v4288 = 0;
uint32_t _v48 = 0;
for (size_t i = 0; i < len; i += 2) {
const size_t fin_mod2 = (len & (~1));
for (size_t i = 0; i < fin_mod2; i += 2) {
uint32_t _v132 = *(uint16_t *)(buf + i);
_v4288 += _v132;
_v48 ^= _v132;
}
if ((len & 1) != 0) {
uint32_t _v132 = *(uint8_t *)(buf + len - 1);
_v4288 += _v132;
_v48 ^= _v132;
}
uint32_t res = (_v4288 & 0xffff) | ((_v48 & 0xffff) << 16);
return res;
}
Expand Down

0 comments on commit 5a904c6

Please sign in to comment.