mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pod: don't call deref in reserve bytes
We already know that we could succesfully allocate enough space for the bytes because we checked that before so simply move to the body of the new bytes pod. We don't need to do the extensive checks we do in deref.
This commit is contained in:
parent
0c33101a42
commit
0f6b365138
1 changed files with 1 additions and 1 deletions
|
|
@ -347,7 +347,7 @@ spa_pod_builder_reserve_bytes(struct spa_pod_builder *builder, uint32_t len)
|
|||
uint32_t offset = builder->state.offset;
|
||||
if (spa_pod_builder_bytes(builder, NULL, len) < 0)
|
||||
return NULL;
|
||||
return SPA_POD_BODY(spa_pod_builder_deref(builder, offset));
|
||||
return SPA_PTROFF(builder->data, offset + sizeof(struct spa_pod), void);
|
||||
}
|
||||
|
||||
#define SPA_POD_INIT_Pointer(type,value) ((struct spa_pod_pointer){ { sizeof(struct spa_pod_pointer_body), SPA_TYPE_Pointer }, { (type), 0, (value) } })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue