mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-30 11:10:29 -04:00
pod: check pod alignment
Make a SPA_POD_ALIGN = 8 and make sure all pods are aligned to it. Use the new constant to pad and check alignment. Make some new macros to check for the pod type, alignment and minimal size.
This commit is contained in:
parent
b75ed93e51
commit
aa2289a25b
5 changed files with 56 additions and 34 deletions
|
|
@ -167,7 +167,7 @@ SPA_API_POD_BUILDER void spa_pod_builder_remove(struct spa_pod_builder *builder,
|
|||
SPA_API_POD_BUILDER int spa_pod_builder_pad(struct spa_pod_builder *builder, uint32_t size)
|
||||
{
|
||||
uint64_t zeroes = 0;
|
||||
size = SPA_ROUND_UP_N(size, 8) - size;
|
||||
size = SPA_ROUND_UP_N(size, SPA_POD_ALIGN) - size;
|
||||
return size ? spa_pod_builder_raw(builder, &zeroes, size) : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue