mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
audioconvert: avoid unaligned writes and left shift of neagtives
See #3572
This commit is contained in:
parent
20b336b1d7
commit
cc109843e5
2 changed files with 12 additions and 7 deletions
|
|
@ -43,7 +43,7 @@ static inline uint24_t u32_to_u24(uint32_t src)
|
|||
|
||||
static inline int32_t s24_to_s32(int24_t src)
|
||||
{
|
||||
return ((int32_t)src.v1 << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
|
||||
return ((uint32_t)((int32_t)src.v1 & 0xFFFF) << 16) | ((uint32_t)src.v2 << 8) | (uint32_t)src.v3;
|
||||
}
|
||||
|
||||
#define S32_TO_S24(s) (int24_t) { .v1 = (int8_t)(((int32_t)s) >> 16), \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue